From dc96a58f7b778e870312077ffe8c58ef1fecd708 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 11 Jun 2026 15:11:34 +0200 Subject: [PATCH 01/45] fix: Add SLF4J-simple for logging --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index 6dc54d7..6f0417c 100644 --- a/pom.xml +++ b/pom.xml @@ -206,6 +206,13 @@ 1.11.0 + + + org.slf4j + slf4j-simple + 2.0.17 + + org.junit.jupiter From 553ac0d48fc94faed524e92b053f5bdf61b56e25 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 16 Jun 2026 16:20:04 +0200 Subject: [PATCH 02/45] chore(tests): remove committed test case --- .../resources/shapes/rml-cc/generate_shape.py | 0 src/main/resources/shapes/rml-cc/tests.py | 0 .../shapes/rml-core/generate_shape.py | 0 .../shapes/rml-core/mapping_validator.py | 0 src/main/resources/shapes/rml-core/tests.py | 0 .../shapes/rml-fnml/generate_shape.py | 0 src/main/resources/shapes/rml-fnml/tests.py | 0 .../resources/shapes/rml-io/generate_shape.py | 0 src/main/resources/shapes/rml-io/tests.py | 0 src/main/resources/shapes/rml-lv/lv.ttl | 27 +- .../shapes/rml-lv/mapping_validator.py | 0 src/main/resources/shapes/rml-lv/tests.py | 7 +- .../rml-cc/RMLTC-CC-0001-Alt/README.md | 64 - .../rml-cc/RMLTC-CC-0001-Alt/data.json | 26 - .../rml-cc/RMLTC-CC-0001-Alt/default.nq | 17 - .../rml-cc/RMLTC-CC-0001-Alt/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0001-Bag/README.md | 61 - .../rml-cc/RMLTC-CC-0001-Bag/data.json | 26 - .../rml-cc/RMLTC-CC-0001-Bag/default.nq | 15 - .../rml-cc/RMLTC-CC-0001-Bag/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0001-List/README.md | 70 - .../rml-cc/RMLTC-CC-0001-List/data.json | 26 - .../rml-cc/RMLTC-CC-0001-List/default.nq | 23 - .../rml-cc/RMLTC-CC-0001-List/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0001-Seq/README.md | 61 - .../rml-cc/RMLTC-CC-0001-Seq/data.json | 26 - .../rml-cc/RMLTC-CC-0001-Seq/default.nq | 15 - .../rml-cc/RMLTC-CC-0001-Seq/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0002-Bag/README.md | 62 - .../rml-cc/RMLTC-CC-0002-Bag/data.json | 26 - .../rml-cc/RMLTC-CC-0002-Bag/default.nq | 15 - .../rml-cc/RMLTC-CC-0002-Bag/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0002-List/README.md | 68 - .../rml-cc/RMLTC-CC-0002-List/data.json | 26 - .../rml-cc/RMLTC-CC-0002-List/default.nq | 21 - .../rml-cc/RMLTC-CC-0002-List/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0003-EB/README.md | 54 - .../rml-cc/RMLTC-CC-0003-EB/data.json | 14 - .../rml-cc/RMLTC-CC-0003-EB/default.nq | 7 - .../rml-cc/RMLTC-CC-0003-EB/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0003-EL-BN/README.md | 56 - .../rml-cc/RMLTC-CC-0003-EL-BN/data.json | 14 - .../rml-cc/RMLTC-CC-0003-EL-BN/default.nq | 8 - .../rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl | 29 - .../rml-cc/RMLTC-CC-0003-EL-Named/README.md | 56 - .../rml-cc/RMLTC-CC-0003-EL-Named/data.json | 14 - .../rml-cc/RMLTC-CC-0003-EL-Named/default.nq | 8 - .../rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl | 29 - .../rml-cc/RMLTC-CC-0003-EL/README.md | 55 - .../rml-cc/RMLTC-CC-0003-EL/data.json | 14 - .../rml-cc/RMLTC-CC-0003-EL/default.nq | 8 - .../rml-cc/RMLTC-CC-0003-EL/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0003-NEB/README.md | 51 - .../rml-cc/RMLTC-CC-0003-NEB/data.json | 14 - .../rml-cc/RMLTC-CC-0003-NEB/default.nq | 5 - .../rml-cc/RMLTC-CC-0003-NEB/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0003-NEL/README.md | 53 - .../rml-cc/RMLTC-CC-0003-NEL/data.json | 14 - .../rml-cc/RMLTC-CC-0003-NEL/default.nq | 7 - .../rml-cc/RMLTC-CC-0003-NEL/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0003-NELb/README.md | 54 - .../rml-cc/RMLTC-CC-0003-NELb/data.json | 14 - .../rml-cc/RMLTC-CC-0003-NELb/default.nq | 7 - .../rml-cc/RMLTC-CC-0003-NELb/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0004-SM1/README.md | 59 - .../rml-cc/RMLTC-CC-0004-SM1/data.json | 18 - .../rml-cc/RMLTC-CC-0004-SM1/default.nq | 14 - .../rml-cc/RMLTC-CC-0004-SM1/mapping.ttl | 25 - .../rml-cc/RMLTC-CC-0004-SM2/README.md | 52 - .../rml-cc/RMLTC-CC-0004-SM2/data.json | 18 - .../rml-cc/RMLTC-CC-0004-SM2/default.nq | 12 - .../rml-cc/RMLTC-CC-0004-SM2/mapping.ttl | 20 - .../rml-cc/RMLTC-CC-0004-SM3/README.md | 45 - .../rml-cc/RMLTC-CC-0004-SM3/data.json | 14 - .../rml-cc/RMLTC-CC-0004-SM3/default.nq | 6 - .../rml-cc/RMLTC-CC-0004-SM3/mapping.ttl | 20 - .../rml-cc/RMLTC-CC-0004-SM4/README.md | 54 - .../rml-cc/RMLTC-CC-0004-SM4/data.json | 18 - .../rml-cc/RMLTC-CC-0004-SM4/default.nq | 10 - .../rml-cc/RMLTC-CC-0004-SM4/mapping.ttl | 25 - .../rml-cc/RMLTC-CC-0004-SM5/README.md | 43 - .../rml-cc/RMLTC-CC-0004-SM5/data.json | 14 - .../rml-cc/RMLTC-CC-0004-SM5/default.nq | 4 - .../rml-cc/RMLTC-CC-0004-SM5/mapping.ttl | 20 - .../rml-cc/RMLTC-CC-0005-App1/README.md | 63 - .../rml-cc/RMLTC-CC-0005-App1/data.json | 23 - .../rml-cc/RMLTC-CC-0005-App1/default.nq | 16 - .../rml-cc/RMLTC-CC-0005-App1/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0005-App2/README.md | 64 - .../rml-cc/RMLTC-CC-0005-App2/data.json | 23 - .../rml-cc/RMLTC-CC-0005-App2/default.nq | 18 - .../rml-cc/RMLTC-CC-0005-App2/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0005-Car1/README.md | 82 - .../rml-cc/RMLTC-CC-0005-Car1/data.json | 23 - .../rml-cc/RMLTC-CC-0005-Car1/default.nq | 35 - .../rml-cc/RMLTC-CC-0005-Car1/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0005-Car2/README.md | 70 - .../rml-cc/RMLTC-CC-0005-Car2/data.json | 21 - .../rml-cc/RMLTC-CC-0005-Car2/default.nq | 23 - .../rml-cc/RMLTC-CC-0005-Car2/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0006-IT0/README.md | 63 - .../rml-cc/RMLTC-CC-0006-IT0/data.json | 23 - .../rml-cc/RMLTC-CC-0006-IT0/default.nq | 17 - .../rml-cc/RMLTC-CC-0006-IT0/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0006-IT1/README.md | 63 - .../rml-cc/RMLTC-CC-0006-IT1/data.json | 23 - .../rml-cc/RMLTC-CC-0006-IT1/default.nq | 15 - .../rml-cc/RMLTC-CC-0006-IT1/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0006-IT2/README.md | 73 - .../rml-cc/RMLTC-CC-0006-IT2/data.json | 34 - .../rml-cc/RMLTC-CC-0006-IT2/default.nq | 25 - .../rml-cc/RMLTC-CC-0006-IT2/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0006-IT3/README.md | 60 - .../rml-cc/RMLTC-CC-0006-IT3/data.json | 23 - .../rml-cc/RMLTC-CC-0006-IT3/default.nq | 14 - .../rml-cc/RMLTC-CC-0006-IT3/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0006-IT4/README.md | 58 - .../rml-cc/RMLTC-CC-0006-IT4/data.json | 23 - .../rml-cc/RMLTC-CC-0006-IT4/default.nq | 11 - .../rml-cc/RMLTC-CC-0006-IT4/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0006-IT5/README.md | 63 - .../rml-cc/RMLTC-CC-0006-IT5/data.json | 34 - .../rml-cc/RMLTC-CC-0006-IT5/default.nq | 16 - .../rml-cc/RMLTC-CC-0006-IT5/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0007-NES/README.md | 85 - .../rml-cc/RMLTC-CC-0007-NES/data.json | 23 - .../rml-cc/RMLTC-CC-0007-NES/default.nq | 29 - .../rml-cc/RMLTC-CC-0007-NES/mapping.ttl | 36 - .../rml-cc/RMLTC-CC-0008-ROMa/README.md | 61 - .../rml-cc/RMLTC-CC-0008-ROMa/default.nq | 13 - .../rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0008-ROMa/student.csv | 4 - .../rml-cc/RMLTC-CC-0008-ROMb/README.md | 57 - .../rml-cc/RMLTC-CC-0008-ROMb/default.nq | 9 - .../rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0008-ROMb/student.csv | 4 - .../rml-cc/RMLTC-CC-0009-DUP-Bag/README.md | 61 - .../rml-cc/RMLTC-CC-0009-DUP-Bag/data.json | 26 - .../rml-cc/RMLTC-CC-0009-DUP-Bag/default.nq | 15 - .../rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0009-DUP-List/README.md | 70 - .../rml-cc/RMLTC-CC-0009-DUP-List/data.json | 26 - .../rml-cc/RMLTC-CC-0009-DUP-List/default.nq | 23 - .../rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl | 27 - .../rml-cc/RMLTC-CC-0010-Lista/README.md | 57 - .../rml-cc/RMLTC-CC-0010-Lista/data.json | 23 - .../rml-cc/RMLTC-CC-0010-Lista/default.nq | 10 - .../rml-cc/RMLTC-CC-0010-Lista/mapping.ttl | 28 - .../rml-cc/RMLTC-CC-0010-Listb/README.md | 57 - .../rml-cc/RMLTC-CC-0010-Listb/data.json | 23 - .../rml-cc/RMLTC-CC-0010-Listb/default.nq | 9 - .../rml-cc/RMLTC-CC-0010-Listb/mapping.ttl | 29 - src/test/resources/rml-cc/config.js | 72 - src/test/resources/rml-cc/descriptions.csv | 36 - src/test/resources/rml-cc/dev.html | 219 - .../resources/rml-cc/docs/20250130/index.html | 2158 -- .../resources/rml-cc/docs/20250206/index.html | 2158 -- .../resources/rml-cc/docs/20250225/index.html | 2472 -- .../resources/rml-cc/docs/20250915/index.html | 2544 -- src/test/resources/rml-cc/docs/index.html | 2544 -- src/test/resources/rml-cc/list.sh | 5 - src/test/resources/rml-cc/make-metadata.py | 209 - src/test/resources/rml-cc/manifest.rml.ttl | 267 - src/test/resources/rml-cc/manifest.ttl | 420 - src/test/resources/rml-cc/metadata.csv | 36 - src/test/resources/rml-cc/publish.js | 59 - src/test/resources/rml-cc/rendered.html | 2544 -- src/test/resources/rml-cc/section/abstract.md | 1 - .../resources/rml-cc/section/data-model.md | 12 - .../resources/rml-cc/section/introduction.md | 4 - .../resources/rml-cc/section/test-cases.md | 10 - .../rml-core-gm/RMLTC0001/mapping.ttl | 22 - .../resources/rml-core-gm/RMLTC0001/output.nq | 2 - .../rml-core-gm/RMLTC0001/student.json | 6 - .../rml-core-gm/RMLTC0002/mapping.ttl | 24 - .../resources/rml-core-gm/RMLTC0002/output.nq | 2 - .../rml-core-gm/RMLTC0002/student.json | 6 - .../rml-core-gm/RMLTC0003/mapping.ttl | 23 - .../resources/rml-core-gm/RMLTC0003/output.nq | 2 - .../rml-core-gm/RMLTC0003/student.json | 6 - .../rml-core-gm/RMLTC0004/mapping.ttl | 24 - .../resources/rml-core-gm/RMLTC0004/output.nq | 3 - .../rml-core-gm/RMLTC0004/student.json | 6 - .../rml-core-gm/RMLTC0005/mapping.ttl | 24 - .../resources/rml-core-gm/RMLTC0005/output.nq | 3 - .../rml-core-gm/RMLTC0005/student.json | 6 - src/test/resources/rml-core/README.md | 9 - .../rml-core/RMLTC0000-JSON/README.md | 50 - .../rml-core/RMLTC0000-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0000-JSON/output.nq | 1 - .../rml-core/RMLTC0000-JSON/student.json | 3 - .../rml-core/RMLTC0001a-JSON/README.md | 53 - .../rml-core/RMLTC0001a-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0001a-JSON/output.nq | 2 - .../rml-core/RMLTC0001a-JSON/student.json | 5 - .../rml-core/RMLTC0001b-JSON/README.md | 54 - .../rml-core/RMLTC0001b-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0001b-JSON/output.nq | 2 - .../rml-core/RMLTC0001b-JSON/student.json | 5 - .../rml-core/RMLTC0002a-JSON/README.md | 63 - .../rml-core/RMLTC0002a-JSON/mapping.ttl | 28 - .../rml-core/RMLTC0002a-JSON/output.nq | 4 - .../rml-core/RMLTC0002a-JSON/student.json | 6 - .../rml-core/RMLTC0002b-JSON/README.md | 55 - .../rml-core/RMLTC0002b-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0002b-JSON/output.nq | 2 - .../rml-core/RMLTC0002b-JSON/student.json | 6 - .../rml-core/RMLTC0002e-JSON/README.md | 47 - .../rml-core/RMLTC0002e-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0002e-JSON/student.json | 6 - .../rml-core/RMLTC0002g-JSON/README.md | 47 - .../rml-core/RMLTC0002g-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0002g-JSON/student.json | 6 - .../rml-core/RMLTC0003c-JSON/README.md | 55 - .../rml-core/RMLTC0003c-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0003c-JSON/output.nq | 1 - .../rml-core/RMLTC0003c-JSON/student.json | 7 - .../rml-core/RMLTC0004a-JSON/README.md | 79 - .../rml-core/RMLTC0004a-JSON/mapping.ttl | 43 - .../rml-core/RMLTC0004a-JSON/output.nq | 5 - .../RMLTC0004a-JSON/student_sport.json | 6 - .../rml-core/RMLTC0004b-JSON/README.md | 47 - .../rml-core/RMLTC0004b-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0004b-JSON/student.json | 5 - .../rml-core/RMLTC0005a-JSON/README.md | 72 - .../rml-core/RMLTC0005a-JSON/ious.json | 19 - .../rml-core/RMLTC0005a-JSON/mapping.ttl | 23 - .../rml-core/RMLTC0005a-JSON/output.nq | 5 - .../rml-core/RMLTC0006a-JSON/README.md | 58 - .../rml-core/RMLTC0006a-JSON/mapping.ttl | 26 - .../rml-core/RMLTC0006a-JSON/output.nq | 1 - .../rml-core/RMLTC0006a-JSON/student.json | 7 - .../rml-core/RMLTC0007a-JSON/README.md | 54 - .../rml-core/RMLTC0007a-JSON/mapping.ttl | 20 - .../rml-core/RMLTC0007a-JSON/output.nq | 2 - .../rml-core/RMLTC0007a-JSON/student.json | 7 - .../rml-core/RMLTC0007b-JSON/README.md | 62 - .../rml-core/RMLTC0007b-JSON/mapping.ttl | 27 - .../rml-core/RMLTC0007b-JSON/output.nq | 3 - .../rml-core/RMLTC0007b-JSON/student.json | 7 - .../rml-core/RMLTC0007c-JSON/README.md | 65 - .../rml-core/RMLTC0007c-JSON/mapping.ttl | 28 - .../rml-core/RMLTC0007c-JSON/output.nq | 5 - .../rml-core/RMLTC0007c-JSON/student.json | 7 - .../rml-core/RMLTC0007d-JSON/README.md | 71 - .../rml-core/RMLTC0007d-JSON/mapping.ttl | 34 - .../rml-core/RMLTC0007d-JSON/output.nq | 5 - .../rml-core/RMLTC0007d-JSON/student.json | 7 - .../rml-core/RMLTC0007e-JSON/README.md | 64 - .../rml-core/RMLTC0007e-JSON/mapping.ttl | 29 - .../rml-core/RMLTC0007e-JSON/output.nq | 4 - .../rml-core/RMLTC0007e-JSON/student.json | 6 - .../rml-core/RMLTC0007f-JSON/README.md | 68 - .../rml-core/RMLTC0007f-JSON/mapping.ttl | 32 - .../rml-core/RMLTC0007f-JSON/output.nq | 4 - .../rml-core/RMLTC0007f-JSON/student.json | 7 - .../rml-core/RMLTC0007g-JSON/README.md | 56 - .../rml-core/RMLTC0007g-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0007g-JSON/output.nq | 2 - .../rml-core/RMLTC0007g-JSON/student.json | 7 - .../rml-core/RMLTC0007h-JSON/README.md | 52 - .../rml-core/RMLTC0007h-JSON/mapping.ttl | 25 - .../rml-core/RMLTC0007h-JSON/student.json | 7 - .../rml-core/RMLTC0008a-JSON/README.md | 76 - .../rml-core/RMLTC0008a-JSON/mapping.ttl | 39 - .../rml-core/RMLTC0008a-JSON/output.nq | 5 - .../rml-core/RMLTC0008a-JSON/student.json | 7 - .../rml-core/RMLTC0008b-JSON/README.md | 94 - .../rml-core/RMLTC0008b-JSON/mapping.ttl | 55 - .../rml-core/RMLTC0008b-JSON/output.nq | 7 - .../rml-core/RMLTC0008b-JSON/student.json | 7 - .../rml-core/RMLTC0008c-JSON/README.md | 57 - .../rml-core/RMLTC0008c-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0008c-JSON/output.nq | 3 - .../rml-core/RMLTC0008c-JSON/student.json | 7 - .../rml-core/RMLTC0009a-JSON/README.md | 105 - .../rml-core/RMLTC0009a-JSON/mapping.ttl | 50 - .../rml-core/RMLTC0009a-JSON/output.nq | 4 - .../rml-core/RMLTC0009a-JSON/sport.json | 8 - .../rml-core/RMLTC0009a-JSON/student.json | 13 - .../rml-core/RMLTC0009b-JSON/README.md | 115 - .../rml-core/RMLTC0009b-JSON/mapping.ttl | 56 - .../rml-core/RMLTC0009b-JSON/output.nq | 8 - .../rml-core/RMLTC0009b-JSON/sport.json | 8 - .../rml-core/RMLTC0009b-JSON/student.json | 13 - .../rml-core/RMLTC0010a-JSON/README.md | 65 - .../RMLTC0010a-JSON/country_info.json | 15 - .../rml-core/RMLTC0010a-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0010a-JSON/output.nq | 4 - .../rml-core/RMLTC0010b-JSON/README.md | 65 - .../RMLTC0010b-JSON/country_info.json | 15 - .../rml-core/RMLTC0010b-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0010b-JSON/output.nq | 4 - .../rml-core/RMLTC0010c-JSON/README.md | 66 - .../RMLTC0010c-JSON/country_info.json | 15 - .../rml-core/RMLTC0010c-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0010c-JSON/output.nq | 4 - .../rml-core/RMLTC0011b-JSON/README.md | 143 - .../rml-core/RMLTC0011b-JSON/mapping.ttl | 69 - .../rml-core/RMLTC0011b-JSON/output.nq | 17 - .../rml-core/RMLTC0011b-JSON/sport.json | 7 - .../rml-core/RMLTC0011b-JSON/student.json | 7 - .../RMLTC0011b-JSON/student_sport.json | 8 - .../rml-core/RMLTC0012a-JSON/README.md | 66 - .../rml-core/RMLTC0012a-JSON/mapping.ttl | 29 - .../rml-core/RMLTC0012a-JSON/output.nq | 5 - .../rml-core/RMLTC0012a-JSON/persons.json | 7 - .../rml-core/RMLTC0012b-JSON/README.md | 93 - .../rml-core/RMLTC0012b-JSON/lives.json | 7 - .../rml-core/RMLTC0012b-JSON/mapping.ttl | 44 - .../rml-core/RMLTC0012b-JSON/output.nq | 5 - .../rml-core/RMLTC0012b-JSON/persons.json | 7 - .../rml-core/RMLTC0012c-JSON/README.md | 52 - .../rml-core/RMLTC0012c-JSON/mapping.ttl | 25 - .../rml-core/RMLTC0012c-JSON/persons.json | 7 - .../rml-core/RMLTC0012d-JSON/README.md | 59 - .../rml-core/RMLTC0012d-JSON/mapping.ttl | 32 - .../rml-core/RMLTC0012d-JSON/persons.json | 7 - .../rml-core/RMLTC0013a-JSON/README.md | 53 - .../rml-core/RMLTC0013a-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0013a-JSON/output.nq | 1 - .../rml-core/RMLTC0013a-JSON/persons.json | 6 - .../rml-core/RMLTC0015a-JSON/README.md | 79 - .../rml-core/RMLTC0015a-JSON/country_en.json | 6 - .../rml-core/RMLTC0015a-JSON/country_es.json | 6 - .../rml-core/RMLTC0015a-JSON/mapping.ttl | 42 - .../rml-core/RMLTC0015a-JSON/output.nq | 6 - .../rml-core/RMLTC0015b-JSON/README.md | 68 - .../rml-core/RMLTC0015b-JSON/country_en.json | 6 - .../rml-core/RMLTC0015b-JSON/country_es.json | 6 - .../rml-core/RMLTC0015b-JSON/mapping.ttl | 42 - .../rml-core/RMLTC0019a-JSON/README.md | 62 - .../rml-core/RMLTC0019a-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0019a-JSON/output.nq | 2 - .../rml-core/RMLTC0019a-JSON/persons.json | 14 - .../rml-core/RMLTC0019b-JSON/README.md | 50 - .../rml-core/RMLTC0019b-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0019b-JSON/persons.json | 9 - .../rml-core/RMLTC0020a-JSON/README.md | 60 - .../rml-core/RMLTC0020a-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0020a-JSON/output.nq | 5 - .../rml-core/RMLTC0020a-JSON/student.json | 9 - .../rml-core/RMLTC0021a-JSON/README.md | 75 - .../rml-core/RMLTC0021a-JSON/mapping.ttl | 28 - .../rml-core/RMLTC0021a-JSON/output.nq | 7 - .../rml-core/RMLTC0021a-JSON/student.json | 15 - .../rml-core/RMLTC0022a-JSON/README.md | 64 - .../rml-core/RMLTC0022a-JSON/mapping.ttl | 30 - .../rml-core/RMLTC0022a-JSON/output.nq | 2 - .../rml-core/RMLTC0022a-JSON/student.json | 7 - .../rml-core/RMLTC0022b-JSON/README.md | 56 - .../rml-core/RMLTC0022b-JSON/data.json | 4 - .../rml-core/RMLTC0022b-JSON/mapping.ttl | 25 - .../rml-core/RMLTC0022b-JSON/output.nq | 2 - .../rml-core/RMLTC0022c-JSON/README.md | 55 - .../rml-core/RMLTC0022c-JSON/data.json | 4 - .../rml-core/RMLTC0022c-JSON/mapping.ttl | 24 - .../rml-core/RMLTC0022c-JSON/output.nq | 2 - .../rml-core/RMLTC0023a-JSON/README.md | 42 - .../rml-core/RMLTC0023a-JSON/mapping.ttl | 16 - .../rml-core/RMLTC0023a-JSON/student.json | 6 - .../rml-core/RMLTC0023b-JSON/README.md | 43 - .../rml-core/RMLTC0023b-JSON/mapping.ttl | 17 - .../rml-core/RMLTC0023b-JSON/student.json | 6 - .../rml-core/RMLTC0023c-JSON/README.md | 43 - .../rml-core/RMLTC0023c-JSON/mapping.ttl | 17 - .../rml-core/RMLTC0023c-JSON/student.json | 6 - .../rml-core/RMLTC0023d-JSON/README.md | 43 - .../rml-core/RMLTC0023d-JSON/mapping.ttl | 17 - .../rml-core/RMLTC0023d-JSON/student.json | 6 - .../rml-core/RMLTC0023e-JSON/README.md | 42 - .../rml-core/RMLTC0023e-JSON/mapping.ttl | 16 - .../rml-core/RMLTC0023e-JSON/student.json | 6 - .../rml-core/RMLTC0023f-JSON/README.md | 48 - .../rml-core/RMLTC0023f-JSON/mapping.ttl | 17 - .../rml-core/RMLTC0023f-JSON/output.nq | 1 - .../rml-core/RMLTC0023f-JSON/student.json | 6 - .../rml-core/RMLTC0024a-JSON/README.md | 51 - .../rml-core/RMLTC0024a-JSON/mapping.ttl | 23 - .../rml-core/RMLTC0024a-JSON/student.json | 8 - .../rml-core/RMLTC0025a-JSON/README.md | 55 - .../rml-core/RMLTC0025a-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0025a-JSON/output.nq | 3 - .../rml-core/RMLTC0025a-JSON/persons.json | 5 - .../rml-core/RMLTC0025b-JSON/README.md | 47 - .../rml-core/RMLTC0025b-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0025b-JSON/persons.json | 5 - .../rml-core/RMLTC0025c-JSON/README.md | 58 - .../rml-core/RMLTC0025c-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0025c-JSON/output.nq | 6 - .../rml-core/RMLTC0025c-JSON/persons.json | 5 - .../rml-core/RMLTC0026a-JSON/README.md | 77 - .../rml-core/RMLTC0026a-JSON/mapping.ttl | 42 - .../rml-core/RMLTC0026a-JSON/output.nq | 4 - .../rml-core/RMLTC0026a-JSON/persons.json | 6 - .../rml-core/RMLTC0026b-JSON/README.md | 77 - .../rml-core/RMLTC0026b-JSON/mapping.ttl | 42 - .../rml-core/RMLTC0026b-JSON/output.nq | 4 - .../rml-core/RMLTC0026b-JSON/persons.json | 6 - .../rml-core/RMLTC0026c-JSON/README.md | 78 - .../rml-core/RMLTC0026c-JSON/mapping.ttl | 43 - .../rml-core/RMLTC0026c-JSON/output.nq | 4 - .../rml-core/RMLTC0026c-JSON/persons.json | 6 - .../rml-core/RMLTC0026d-JSON/README.md | 78 - .../rml-core/RMLTC0026d-JSON/mapping.ttl | 43 - .../rml-core/RMLTC0026d-JSON/output.nq | 4 - .../rml-core/RMLTC0026d-JSON/persons.json | 6 - .../resources/rml-core/RMLTC0027-XML/ious.xml | 19 - .../rml-core/RMLTC0027-XML/mapping.ttl | 23 - .../rml-core/RMLTC0027-XML/output.nq | 5 - .../rml-core/RMLTC0027a-JSON/README.md | 60 - .../rml-core/RMLTC0027a-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0027a-JSON/output.nq | 5 - .../rml-core/RMLTC0027a-JSON/student.json | 9 - .../rml-core/RMLTC0027b-JSON/README.md | 60 - .../rml-core/RMLTC0027b-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0027b-JSON/output.nq | 5 - .../rml-core/RMLTC0027b-JSON/student.json | 9 - .../rml-core/RMLTC0027c-JSON/README.md | 60 - .../rml-core/RMLTC0027c-JSON/mapping.ttl | 21 - .../rml-core/RMLTC0027c-JSON/output.nq | 5 - .../rml-core/RMLTC0027c-JSON/student.json | 9 - .../rml-core/RMLTC0028a-JSON/README.md | 45 - .../rml-core/RMLTC0028a-JSON/data.json | 1 - .../rml-core/RMLTC0028a-JSON/mapping.ttl | 18 - .../rml-core/RMLTC0028a-JSON/output.nq | 1 - .../rml-core/RMLTC0028b-JSON/README.md | 51 - .../rml-core/RMLTC0028b-JSON/data.json | 1 - .../rml-core/RMLTC0028b-JSON/mapping.ttl | 22 - .../rml-core/RMLTC0028b-JSON/output.nq | 3 - .../rml-core/RMLTC0028c-JSON/README.md | 45 - .../rml-core/RMLTC0028c-JSON/data.json | 1 - .../rml-core/RMLTC0028c-JSON/mapping.ttl | 18 - .../rml-core/RMLTC0028c-JSON/output.nq | 1 - src/test/resources/rml-core/config.js | 79 - src/test/resources/rml-core/descriptions.csv | 64 - .../resources/rml-core/descriptions_old.csv | 426 - src/test/resources/rml-core/dev.html | 163 - .../rml-core/docs/20250130/index.html | 19356 ---------------- .../rml-core/docs/20250204/index.html | 19356 ---------------- .../rml-core/docs/20250217/index.html | 2988 --- .../rml-core/docs/20250224/index.html | 3113 --- .../rml-core/docs/20250228/index.html | 3113 --- .../rml-core/docs/20250908/index.html | 3906 ---- .../rml-core/docs/20250927/index.html | 3891 ---- .../rml-core/docs/20250930/index.html | 3878 ---- src/test/resources/rml-core/docs/index.html | 3878 ---- src/test/resources/rml-core/list.sh | 5 - src/test/resources/rml-core/make-metadata.py | 180 - src/test/resources/rml-core/manifest.rml.ttl | 274 - src/test/resources/rml-core/manifest.ttl | 779 - src/test/resources/rml-core/metadata.csv | 64 - .../resources/rml-core/section/abstract.md | 1 - .../resources/rml-core/section/data-model.md | 12 - .../rml-core/section/introduction.md | 4 - .../resources/rml-core/section/test-cases.md | 10 - src/test/resources/rml-fnml-burp/README.md | 54 - .../RMLFNOTC0000-CSV/mapping.ttl | 31 - .../rml-fnml-burp/RMLFNOTC0000-CSV/output.nq | 1 - .../RMLFNOTC0000-CSV/student.csv | 2 - .../RMLFNOTC0000b-CSV/mapping.ttl | 31 - .../rml-fnml-burp/RMLFNOTC0000b-CSV/output.nq | 1 - .../RMLFNOTC0000b-CSV/student.csv | 2 - .../RMLFNOTC0001-CSV/mapping.ttl | 38 - .../rml-fnml-burp/RMLFNOTC0001-CSV/output.nq | 1 - .../RMLFNOTC0001-CSV/student.csv | 2 - .../RMLFNOTC0002-CSV/mapping.ttl | 38 - .../RMLFNOTC0002-CSV/student.csv | 2 - .../RMLFNOTC0003-CSV/mapping.ttl | 42 - .../rml-fnml-burp/RMLFNOTC0003-CSV/output.nq | 1 - .../RMLFNOTC0003-CSV/student.csv | 2 - .../RMLFNOTC0004-CSV/mapping.ttl | 38 - .../rml-fnml-burp/RMLFNOTC0004-CSV/output.nq | 1 - .../RMLFNOTC0004-CSV/student.csv | 2 - .../RMLFNOTC0004b-CSV/mapping.ttl | 39 - .../rml-fnml-burp/RMLFNOTC0004b-CSV/output.nq | 1 - .../RMLFNOTC0004b-CSV/student.csv | 2 - .../RMLFNOTC0005-CSV/mapping.ttl | 36 - .../rml-fnml-burp/RMLFNOTC0005-CSV/output.nq | 1 - .../RMLFNOTC0005-CSV/student.csv | 2 - .../RMLFNOTC0005b-CSV/mapping.ttl | 37 - .../rml-fnml-burp/RMLFNOTC0005b-CSV/output.nq | 1 - .../RMLFNOTC0005b-CSV/student.csv | 2 - .../RMLFNOTC0006-CSV/mapping.ttl | 39 - .../rml-fnml-burp/RMLFNOTC0006-CSV/output.nq | 1 - .../RMLFNOTC0006-CSV/student.csv | 2 - .../RMLFNOTC0006b-CSV/mapping.ttl | 40 - .../rml-fnml-burp/RMLFNOTC0006b-CSV/output.nq | 1 - .../RMLFNOTC0006b-CSV/student.csv | 2 - .../RMLFNOTC0008-CSV/mapping.ttl | 36 - .../rml-fnml-burp/RMLFNOTC0008-CSV/output.nq | 1 - .../RMLFNOTC0008-CSV/student.csv | 2 - .../RMLFNOTC0009-CSV/mapping.ttl | 62 - .../rml-fnml-burp/RMLFNOTC0009-CSV/output.nq | 1 - .../RMLFNOTC0009-CSV/student.csv | 2 - .../RMLFNOTC0010-CSV/mapping.ttl | 42 - .../rml-fnml-burp/RMLFNOTC0010-CSV/output.nq | 1 - .../RMLFNOTC0010-CSV/student.csv | 2 - .../resources/rml-fnml-burp/functions.ttl | 231 - src/test/resources/rml-fnml-grel/README.md | 132 - .../boolean-and-false/mapping.ttl | 89 - .../rml-fnml-grel/boolean-and-false/output.nq | 1 - .../boolean-and-false/student.csv | 2 - .../boolean-and-true/mapping.ttl | 89 - .../rml-fnml-grel/boolean-and-true/output.nq | 1 - .../boolean-and-true/student.csv | 2 - .../boolean-not-false/mapping.ttl | 47 - .../rml-fnml-grel/boolean-not-false/output.nq | 1 - .../boolean-not-false/student.csv | 2 - .../boolean-not-true/mapping.ttl | 47 - .../rml-fnml-grel/boolean-not-true/output.nq | 1 - .../boolean-not-true/student.csv | 2 - .../boolean-or-false/mapping.ttl | 89 - .../rml-fnml-grel/boolean-or-false/output.nq | 1 - .../boolean-or-false/student.csv | 2 - .../rml-fnml-grel/boolean-or-true/mapping.ttl | 89 - .../rml-fnml-grel/boolean-or-true/output.nq | 1 - .../rml-fnml-grel/boolean-or-true/student.csv | 2 - .../boolean-xor-false/mapping.ttl | 89 - .../rml-fnml-grel/boolean-xor-false/output.nq | 1 - .../boolean-xor-false/student.csv | 2 - .../boolean-xor-true/mapping.ttl | 89 - .../rml-fnml-grel/boolean-xor-true/output.nq | 1 - .../boolean-xor-true/student.csv | 2 - .../resources/rml-fnml-grel/math-abs/data.csv | 2 - .../rml-fnml-grel/math-abs/mapping.ttl | 34 - .../rml-fnml-grel/math-abs/output.nq | 1 - .../rml-fnml-grel/math-ceil/data.csv | 2 - .../rml-fnml-grel/math-ceil/mapping.ttl | 34 - .../rml-fnml-grel/math-ceil/output.nq | 1 - .../rml-fnml-grel/math-floor/data.csv | 2 - .../rml-fnml-grel/math-floor/mapping.ttl | 34 - .../rml-fnml-grel/math-floor/output.nq | 1 - .../rml-fnml-grel/string-chomp-a/mapping.ttl | 39 - .../rml-fnml-grel/string-chomp-a/output.nq | 1 - .../rml-fnml-grel/string-chomp-a/student.csv | 2 - .../rml-fnml-grel/string-chomp-b/mapping.ttl | 39 - .../rml-fnml-grel/string-chomp-b/output.nq | 1 - .../rml-fnml-grel/string-chomp-b/student.csv | 2 - .../string-contains-p-false/mapping.ttl | 39 - .../string-contains-p-false/output.nq | 1 - .../string-contains-p-false/student.csv | 2 - .../string-contains-p-true/mapping.ttl | 39 - .../string-contains-p-true/output.nq | 1 - .../string-contains-p-true/student.csv | 2 - .../string-contains-s-false/mapping.ttl | 39 - .../string-contains-s-false/output.nq | 1 - .../string-contains-s-false/student.csv | 2 - .../string-contains-s-true/mapping.ttl | 39 - .../string-contains-s-true/output.nq | 1 - .../string-contains-s-true/student.csv | 2 - .../string-endswith-false/mapping.ttl | 39 - .../string-endswith-false/output.nq | 1 - .../string-endswith-false/student.csv | 2 - .../string-endswith-true/mapping.ttl | 39 - .../string-endswith-true/output.nq | 1 - .../string-endswith-true/student.csv | 2 - .../rml-fnml-grel/string-get-a/mapping.ttl | 46 - .../rml-fnml-grel/string-get-a/output.nq | 1 - .../rml-fnml-grel/string-get-a/student.csv | 2 - .../rml-fnml-grel/string-get-b/mapping.ttl | 41 - .../rml-fnml-grel/string-get-b/output.nq | 1 - .../rml-fnml-grel/string-get-b/student.csv | 2 - .../rml-fnml-grel/string-get-c/mapping.ttl | 46 - .../rml-fnml-grel/string-get-c/output.nq | 1 - .../rml-fnml-grel/string-get-c/student.csv | 2 - .../rml-fnml-grel/string-length/mapping.ttl | 33 - .../rml-fnml-grel/string-length/output.nq | 1 - .../rml-fnml-grel/string-length/student.csv | 2 - .../rml-fnml-grel/string-replace/mapping.ttl | 62 - .../rml-fnml-grel/string-replace/output.nq | 1 - .../rml-fnml-grel/string-replace/student.csv | 2 - .../string-startswith-false/mapping.ttl | 39 - .../string-startswith-false/output.nq | 1 - .../string-startswith-false/student.csv | 2 - .../string-startswith-true/mapping.ttl | 39 - .../string-startswith-true/output.nq | 1 - .../string-startswith-true/student.csv | 2 - .../rml-fnml-grel/string-strip/mapping.ttl | 36 - .../rml-fnml-grel/string-strip/output.nq | 1 - .../rml-fnml-grel/string-strip/student.csv | 2 - .../string-substring-a/mapping.ttl | 46 - .../string-substring-a/output.nq | 1 - .../string-substring-a/student.csv | 2 - .../string-substring-b/mapping.ttl | 41 - .../string-substring-b/output.nq | 1 - .../string-substring-b/student.csv | 2 - .../string-substring-c/mapping.ttl | 46 - .../string-substring-c/output.nq | 1 - .../string-substring-c/student.csv | 2 - .../string-tolowercase/mapping.ttl | 36 - .../string-tolowercase/output.nq | 1 - .../string-tolowercase/student.csv | 2 - .../string-totitlecase-a/mapping.ttl | 36 - .../string-totitlecase-a/output.nq | 1 - .../string-totitlecase-a/student.csv | 2 - .../string-totitlecase-b/mapping.ttl | 36 - .../string-totitlecase-b/output.nq | 1 - .../string-totitlecase-b/student.csv | 2 - .../string-touppercase/mapping.ttl | 36 - .../string-touppercase/output.nq | 1 - .../string-touppercase/student.csv | 2 - .../rml-fnml-grel/string-trim/mapping.ttl | 36 - .../rml-fnml-grel/string-trim/output.nq | 1 - .../rml-fnml-grel/string-trim/student.csv | 2 - src/test/resources/rml-fnml/README.md | 38 - .../rml-fnml/RMLFNMLTC0001-CSV/README.md | 59 - .../rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl | 30 - .../rml-fnml/RMLFNMLTC0001-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0001-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0002-CSV/README.md | 65 - .../rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl | 37 - .../rml-fnml/RMLFNMLTC0002-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0002-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0003-CSV/README.md | 65 - .../rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl | 39 - .../rml-fnml/RMLFNMLTC0003-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0003-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0004-CSV/README.md | 64 - .../rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl | 38 - .../rml-fnml/RMLFNMLTC0004-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0004-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0005-CSV/README.md | 63 - .../rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl | 37 - .../rml-fnml/RMLFNMLTC0005-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0005-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0007-CSV/README.md | 69 - .../rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl | 43 - .../rml-fnml/RMLFNMLTC0007-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0007-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0008-CSV/README.md | 68 - .../rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl | 43 - .../rml-fnml/RMLFNMLTC0008-CSV/output.nq | 0 .../rml-fnml/RMLFNMLTC0008-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0011-CSV/README.md | 64 - .../rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl | 38 - .../rml-fnml/RMLFNMLTC0011-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0011-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0021-CSV/README.md | 67 - .../rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl | 41 - .../rml-fnml/RMLFNMLTC0021-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0021-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0031-CSV/README.md | 64 - .../rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl | 36 - .../rml-fnml/RMLFNMLTC0031-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0031-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0032-CSV/README.md | 70 - .../rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl | 43 - .../rml-fnml/RMLFNMLTC0032-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0032-CSV/student.csv | 3 - .../rml-fnml/RMLFNMLTC0041-CSV/README.md | 65 - .../rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl | 39 - .../rml-fnml/RMLFNMLTC0041-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0041-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0051-CSV/README.md | 88 - .../rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl | 62 - .../rml-fnml/RMLFNMLTC0051-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0051-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0061-CSV/README.md | 69 - .../rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl | 43 - .../rml-fnml/RMLFNMLTC0061-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0061-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0071-CSV/README.md | 72 - .../rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl | 46 - .../rml-fnml/RMLFNMLTC0071-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0071-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0081-CSV/README.md | 72 - .../rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl | 46 - .../rml-fnml/RMLFNMLTC0081-CSV/output.nq | 1 - .../rml-fnml/RMLFNMLTC0081-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0101-CSV/README.md | 58 - .../rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl | 38 - .../rml-fnml/RMLFNMLTC0101-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0102-CSV/README.md | 62 - .../rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl | 37 - .../rml-fnml/RMLFNMLTC0102-CSV/output.nq | 0 .../rml-fnml/RMLFNMLTC0102-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0103-CSV/README.md | 62 - .../rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl | 37 - .../rml-fnml/RMLFNMLTC0103-CSV/output.nq | 0 .../rml-fnml/RMLFNMLTC0103-CSV/student.csv | 2 - .../rml-fnml/RMLFNMLTC0104-CSV/README.md | 62 - .../rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl | 37 - .../rml-fnml/RMLFNMLTC0104-CSV/output.nq | 0 .../rml-fnml/RMLFNMLTC0104-CSV/student.csv | 2 - src/test/resources/rml-fnml/config.js | 93 - src/test/resources/rml-fnml/descriptions.csv | 28 - src/test/resources/rml-fnml/dev.html | 120 - .../rml-fnml/docs/20250130/index.html | 1325 -- .../rml-fnml/docs/20250303/index.html | 1496 -- .../rml-fnml/docs/20250630/index.html | 1768 -- .../rml-fnml/docs/20250806/index.html | 1865 -- src/test/resources/rml-fnml/docs/index.html | 1865 -- src/test/resources/rml-fnml/functions.ttl | 102 - src/test/resources/rml-fnml/list.sh | 5 - src/test/resources/rml-fnml/make-metadata.py | 139 - src/test/resources/rml-fnml/manifest.rml.ttl | 267 - src/test/resources/rml-fnml/manifest.ttl | 236 - src/test/resources/rml-fnml/metadata.csv | 28 - .../resources/rml-fnml/section/abstract.md | 1 - .../resources/rml-fnml/section/data-model.md | 12 - .../rml-fnml/section/introduction.md | 4 - .../resources/rml-fnml/section/test-cases.md | 10 - src/test/resources/rml-io/README.md | 14 - .../resources/rml-io/RMLSTC0001a/Friends.json | 27 - .../resources/rml-io/RMLSTC0001a/README.md | 94 - .../resources/rml-io/RMLSTC0001a/default.nq | 10 - .../resources/rml-io/RMLSTC0001a/mapping.ttl | 34 - .../rml-io/RMLSTC0001b/Friends-UTF16.json | Bin 664 -> 0 bytes .../resources/rml-io/RMLSTC0001b/README.md | 94 - .../resources/rml-io/RMLSTC0001b/default.nq | 10 - .../resources/rml-io/RMLSTC0001b/mapping.ttl | 34 - .../resources/rml-io/RMLSTC0002a/Friends.json | 27 - .../resources/rml-io/RMLSTC0002a/README.md | 94 - .../resources/rml-io/RMLSTC0002a/default.nq | 10 - .../resources/rml-io/RMLSTC0002a/mapping.ttl | 34 - .../rml-io/RMLSTC0002b/Friends.json.gz | Bin 166 -> 0 bytes .../resources/rml-io/RMLSTC0002b/README.md | 66 - .../resources/rml-io/RMLSTC0002b/default.nq | 10 - .../resources/rml-io/RMLSTC0002b/mapping.ttl | 35 - .../resources/rml-io/RMLSTC0002c/README.md | 65 - .../resources/rml-io/RMLSTC0002c/default.nq | 10 - .../resources/rml-io/RMLSTC0002c/mapping.ttl | 34 - .../rml-io/RMLSTC0002d/Friends.json.tar.xz | Bin 284 -> 0 bytes .../resources/rml-io/RMLSTC0002d/README.md | 65 - .../resources/rml-io/RMLSTC0002d/default.nq | 10 - .../resources/rml-io/RMLSTC0002d/mapping.ttl | 34 - .../resources/rml-io/RMLSTC0002e/README.md | 65 - .../resources/rml-io/RMLSTC0002e/default.nq | 10 - .../resources/rml-io/RMLSTC0002e/mapping.ttl | 34 - .../resources/rml-io/RMLSTC0003/Friends.nt | 10 - .../resources/rml-io/RMLSTC0003/README.md | 83 - .../resources/rml-io/RMLSTC0003/default.nq | 10 - .../resources/rml-io/RMLSTC0003/mapping.ttl | 40 - .../rml-io/RMLSTC0004a/Friends-NULL.csv | 7 - .../resources/rml-io/RMLSTC0004a/README.md | 73 - .../resources/rml-io/RMLSTC0004a/default.nq | 10 - .../resources/rml-io/RMLSTC0004a/mapping.ttl | 33 - .../rml-io/RMLSTC0004b/Friends-NULL.csv | 7 - .../resources/rml-io/RMLSTC0004b/README.md | 74 - .../resources/rml-io/RMLSTC0004b/default.nq | 10 - .../resources/rml-io/RMLSTC0004b/mapping.ttl | 34 - .../rml-io/RMLSTC0004c/Friends-NULL.csv | 8 - .../resources/rml-io/RMLSTC0004c/README.md | 76 - .../resources/rml-io/RMLSTC0004c/default.nq | 10 - .../resources/rml-io/RMLSTC0004c/mapping.ttl | 35 - .../resources/rml-io/RMLSTC0006a/Friends.csv | 6 - .../resources/rml-io/RMLSTC0006a/README.md | 77 - .../resources/rml-io/RMLSTC0006a/default.nq | 10 - .../resources/rml-io/RMLSTC0006a/mapping.ttl | 38 - .../resources/rml-io/RMLSTC0006b/Friends.csv | 6 - .../resources/rml-io/RMLSTC0006b/README.md | 72 - .../resources/rml-io/RMLSTC0006b/default.nq | 10 - .../resources/rml-io/RMLSTC0006b/mapping.ttl | 33 - .../resources/rml-io/RMLSTC0007a/Friends.json | 27 - .../resources/rml-io/RMLSTC0007a/README.md | 94 - .../resources/rml-io/RMLSTC0007a/default.nq | 10 - .../resources/rml-io/RMLSTC0007a/mapping.ttl | 34 - .../resources/rml-io/RMLSTC0007b/Friends.csv | 6 - .../resources/rml-io/RMLSTC0007b/README.md | 72 - .../resources/rml-io/RMLSTC0007b/default.nq | 10 - .../resources/rml-io/RMLSTC0007b/mapping.ttl | 33 - .../resources/rml-io/RMLSTC0007c/Friends.xml | 22 - .../resources/rml-io/RMLSTC0007c/README.md | 88 - .../resources/rml-io/RMLSTC0007c/default.nq | 10 - .../resources/rml-io/RMLSTC0007c/mapping.ttl | 33 - .../resources/rml-io/RMLSTC0007d/Friends.xml | 22 - .../resources/rml-io/RMLSTC0007d/README.md | 93 - .../resources/rml-io/RMLSTC0007d/default.nq | 10 - .../resources/rml-io/RMLSTC0007d/mapping.ttl | 38 - .../resources/rml-io/RMLSTC0008a/Friends.json | 27 - .../rml-io/RMLSTC0008a/Friends2.json | 7 - .../resources/rml-io/RMLSTC0008a/README.md | 127 - .../resources/rml-io/RMLSTC0008a/default.nq | 12 - .../resources/rml-io/RMLSTC0008a/mapping.ttl | 65 - .../resources/rml-io/RMLSTC0008b/Friends.csv | 2 - .../resources/rml-io/RMLSTC0008b/Friends.json | 27 - .../resources/rml-io/RMLSTC0008b/README.md | 126 - .../resources/rml-io/RMLSTC0008b/default.nq | 12 - .../resources/rml-io/RMLSTC0008b/mapping.ttl | 64 - .../resources/rml-io/RMLSTC0009a/Friends.csv | 6 - .../resources/rml-io/RMLSTC0009a/README.md | 57 - .../resources/rml-io/RMLSTC0009a/mapping.ttl | 33 - .../resources/rml-io/RMLSTC0009a/output.nq | 10 - .../resources/rml-io/RMLSTC0010a/Friends.csv | 2 - .../resources/rml-io/RMLSTC0010a/README.md | 52 - .../resources/rml-io/RMLSTC0010a/mapping.ttl | 32 - .../resources/rml-io/RMLSTC0010b/Friends.csv | 2 - .../resources/rml-io/RMLSTC0010b/README.md | 44 - .../resources/rml-io/RMLSTC0010b/mapping.ttl | 24 - .../resources/rml-io/RMLSTC0011a/README.md | 48 - .../rml-io/RMLSTC0011a/companies.json | 91 - .../resources/rml-io/RMLSTC0011a/default.nq | 2 - .../resources/rml-io/RMLSTC0011a/mapping.ttl | 25 - .../resources/rml-io/RMLSTC0011b/README.md | 51 - .../rml-io/RMLSTC0011b/companies.json | 91 - .../resources/rml-io/RMLSTC0011b/default.nq | 4 - .../resources/rml-io/RMLSTC0011b/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0011c/README.md | 53 - .../rml-io/RMLSTC0011c/companies.json | 91 - .../resources/rml-io/RMLSTC0011c/default.nq | 6 - .../resources/rml-io/RMLSTC0011c/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0011d/README.md | 51 - .../rml-io/RMLSTC0011d/companies.json | 91 - .../resources/rml-io/RMLSTC0011d/default.nq | 4 - .../resources/rml-io/RMLSTC0011d/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0011e/README.md | 65 - .../rml-io/RMLSTC0011e/companies.json | 91 - .../resources/rml-io/RMLSTC0011e/default.nq | 18 - .../resources/rml-io/RMLSTC0011e/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0012a/README.md | 49 - .../rml-io/RMLSTC0012a/companies.xml | 112 - .../resources/rml-io/RMLSTC0012a/default.nq | 2 - .../resources/rml-io/RMLSTC0012a/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0012b/README.md | 51 - .../rml-io/RMLSTC0012b/companies.xml | 112 - .../resources/rml-io/RMLSTC0012b/default.nq | 4 - .../resources/rml-io/RMLSTC0012b/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0012c/README.md | 53 - .../rml-io/RMLSTC0012c/companies.xml | 112 - .../resources/rml-io/RMLSTC0012c/default.nq | 6 - .../resources/rml-io/RMLSTC0012c/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0012d/README.md | 51 - .../rml-io/RMLSTC0012d/companies.xml | 112 - .../resources/rml-io/RMLSTC0012d/default.nq | 4 - .../resources/rml-io/RMLSTC0012d/mapping.ttl | 26 - .../resources/rml-io/RMLSTC0012e/README.md | 65 - .../rml-io/RMLSTC0012e/companies.xml | 112 - .../resources/rml-io/RMLSTC0012e/default.nq | 18 - .../resources/rml-io/RMLSTC0012e/mapping.ttl | 26 - .../resources/rml-io/RMLTTC0000/Friends.json | 27 - .../resources/rml-io/RMLTTC0000/README.md | 94 - .../resources/rml-io/RMLTTC0000/default.nq | 10 - .../resources/rml-io/RMLTTC0000/mapping.ttl | 34 - .../resources/rml-io/RMLTTC0001a/Friends.json | 27 - .../resources/rml-io/RMLTTC0001a/README.md | 108 - .../resources/rml-io/RMLTTC0001a/default.nq | 0 .../resources/rml-io/RMLTTC0001a/dump1.nq | 10 - .../resources/rml-io/RMLTTC0001a/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0001b/Friends.json | 27 - .../resources/rml-io/RMLTTC0001b/README.md | 108 - .../resources/rml-io/RMLTTC0001b/default.nq | 5 - .../resources/rml-io/RMLTTC0001b/dump1.nq | 5 - .../resources/rml-io/RMLTTC0001b/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0001c/Friends.json | 27 - .../resources/rml-io/RMLTTC0001c/README.md | 108 - .../resources/rml-io/RMLTTC0001c/default.nq | 5 - .../resources/rml-io/RMLTTC0001c/dump1.nq | 5 - .../resources/rml-io/RMLTTC0001c/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0001d/Friends.json | 27 - .../resources/rml-io/RMLTTC0001d/README.md | 113 - .../resources/rml-io/RMLTTC0001d/default.nq | 0 .../resources/rml-io/RMLTTC0001d/dump1.nq | 10 - .../resources/rml-io/RMLTTC0001d/mapping.ttl | 48 - .../resources/rml-io/RMLTTC0001e/Friends.json | 27 - .../resources/rml-io/RMLTTC0001e/README.md | 111 - .../resources/rml-io/RMLTTC0001e/default.nq | 5 - .../resources/rml-io/RMLTTC0001e/dump1.nq | 5 - .../resources/rml-io/RMLTTC0001e/mapping.ttl | 46 - .../resources/rml-io/RMLTTC0001f/Friends.json | 27 - .../resources/rml-io/RMLTTC0001f/README.md | 112 - .../resources/rml-io/RMLTTC0001f/default.nq | 5 - .../resources/rml-io/RMLTTC0001f/dump1.nq | 5 - .../resources/rml-io/RMLTTC0001f/mapping.ttl | 47 - .../resources/rml-io/RMLTTC0002a/Friends.json | 27 - .../resources/rml-io/RMLTTC0002a/README.md | 132 - .../resources/rml-io/RMLTTC0002a/default.nq | 0 .../resources/rml-io/RMLTTC0002a/dump1.nq | 10 - .../resources/rml-io/RMLTTC0002a/dump2.nq | 10 - .../resources/rml-io/RMLTTC0002a/mapping.ttl | 52 - .../resources/rml-io/RMLTTC0002b/Friends.json | 27 - .../resources/rml-io/RMLTTC0002b/README.md | 127 - .../resources/rml-io/RMLTTC0002b/default.nq | 0 .../resources/rml-io/RMLTTC0002b/dump1.nq | 10 - .../resources/rml-io/RMLTTC0002b/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002b/mapping.ttl | 52 - .../resources/rml-io/RMLTTC0002c/Friends.json | 27 - .../resources/rml-io/RMLTTC0002c/README.md | 127 - .../resources/rml-io/RMLTTC0002c/default.nq | 0 .../resources/rml-io/RMLTTC0002c/dump1.nq | 10 - .../resources/rml-io/RMLTTC0002c/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002c/mapping.ttl | 52 - .../resources/rml-io/RMLTTC0002d/Friends.json | 27 - .../resources/rml-io/RMLTTC0002d/README.md | 122 - .../resources/rml-io/RMLTTC0002d/default.nq | 0 .../resources/rml-io/RMLTTC0002d/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002d/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002d/mapping.ttl | 52 - .../resources/rml-io/RMLTTC0002e/Friends.json | 27 - .../resources/rml-io/RMLTTC0002e/README.md | 131 - .../resources/rml-io/RMLTTC0002e/default.nq | 0 .../resources/rml-io/RMLTTC0002e/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002e/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002e/dump3.nq | 10 - .../resources/rml-io/RMLTTC0002e/mapping.ttl | 61 - .../resources/rml-io/RMLTTC0002f/Friends.json | 27 - .../resources/rml-io/RMLTTC0002f/README.md | 131 - .../resources/rml-io/RMLTTC0002f/default.nq | 0 .../resources/rml-io/RMLTTC0002f/dump1.nq | 10 - .../resources/rml-io/RMLTTC0002f/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002f/mapping.ttl | 56 - .../resources/rml-io/RMLTTC0002g/Friends.json | 27 - .../resources/rml-io/RMLTTC0002g/README.md | 126 - .../resources/rml-io/RMLTTC0002g/default.nq | 0 .../resources/rml-io/RMLTTC0002g/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002g/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002g/mapping.ttl | 56 - .../resources/rml-io/RMLTTC0002h/Friends.json | 27 - .../resources/rml-io/RMLTTC0002h/README.md | 126 - .../resources/rml-io/RMLTTC0002h/default.nq | 0 .../resources/rml-io/RMLTTC0002h/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002h/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002h/mapping.ttl | 56 - .../resources/rml-io/RMLTTC0002i/Friends.json | 27 - .../resources/rml-io/RMLTTC0002i/README.md | 129 - .../resources/rml-io/RMLTTC0002i/default.nq | 0 .../resources/rml-io/RMLTTC0002i/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002i/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002i/mapping.ttl | 59 - .../resources/rml-io/RMLTTC0002j/Friends.json | 27 - .../resources/rml-io/RMLTTC0002j/README.md | 126 - .../resources/rml-io/RMLTTC0002j/default.nq | 0 .../resources/rml-io/RMLTTC0002j/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002j/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002j/mapping.ttl | 56 - .../resources/rml-io/RMLTTC0002k/Friends.json | 27 - .../resources/rml-io/RMLTTC0002k/README.md | 135 - .../resources/rml-io/RMLTTC0002k/default.nq | 5 - .../resources/rml-io/RMLTTC0002k/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002k/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002k/mapping.ttl | 60 - .../resources/rml-io/RMLTTC0002l/Friends.json | 27 - .../resources/rml-io/RMLTTC0002l/README.md | 127 - .../resources/rml-io/RMLTTC0002l/default.nq | 0 .../resources/rml-io/RMLTTC0002l/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002l/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002l/mapping.ttl | 57 - .../resources/rml-io/RMLTTC0002m/Friends.json | 27 - .../resources/rml-io/RMLTTC0002m/README.md | 122 - .../resources/rml-io/RMLTTC0002m/default.nq | 0 .../resources/rml-io/RMLTTC0002m/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002m/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002m/mapping.ttl | 52 - .../resources/rml-io/RMLTTC0002n/Friends.json | 27 - .../resources/rml-io/RMLTTC0002n/README.md | 122 - .../resources/rml-io/RMLTTC0002n/default.nq | 0 .../resources/rml-io/RMLTTC0002n/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002n/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002n/mapping.ttl | 52 - .../resources/rml-io/RMLTTC0002o/Friends.json | 27 - .../resources/rml-io/RMLTTC0002o/README.md | 134 - .../resources/rml-io/RMLTTC0002o/default.nq | 0 .../resources/rml-io/RMLTTC0002o/dump1.nq | 10 - .../resources/rml-io/RMLTTC0002o/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002o/mapping.ttl | 60 - .../resources/rml-io/RMLTTC0002p/Friends.json | 27 - .../resources/rml-io/RMLTTC0002p/README.md | 141 - .../resources/rml-io/RMLTTC0002p/default.nq | 5 - .../resources/rml-io/RMLTTC0002p/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002p/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002p/mapping.ttl | 66 - .../resources/rml-io/RMLTTC0002q/Friends.json | 27 - .../resources/rml-io/RMLTTC0002q/README.md | 142 - .../resources/rml-io/RMLTTC0002q/default.nq | 5 - .../resources/rml-io/RMLTTC0002q/dump1.nq | 5 - .../resources/rml-io/RMLTTC0002q/dump2.nq | 5 - .../resources/rml-io/RMLTTC0002q/mapping.ttl | 67 - .../resources/rml-io/RMLTTC0002r/Friends.json | 27 - .../resources/rml-io/RMLTTC0002r/README.md | 109 - .../resources/rml-io/RMLTTC0002r/default.nq | 0 .../resources/rml-io/RMLTTC0002r/dump1.nq | 10 - .../resources/rml-io/RMLTTC0002r/mapping.ttl | 44 - .../resources/rml-io/RMLTTC0003a/Friends.json | 27 - .../resources/rml-io/RMLTTC0003a/README.md | 136 - .../resources/rml-io/RMLTTC0003a/default.nq | 0 .../resources/rml-io/RMLTTC0003a/dump1.nq | 5 - .../resources/rml-io/RMLTTC0003a/dump2.nq | 5 - .../resources/rml-io/RMLTTC0003a/mapping.ttl | 66 - .../resources/rml-io/RMLTTC0004a/Friends.json | 27 - .../resources/rml-io/RMLTTC0004a/README.md | 131 - .../resources/rml-io/RMLTTC0004a/default.nq | 0 .../resources/rml-io/RMLTTC0004a/dump1.jsonld | 33 - .../resources/rml-io/RMLTTC0004a/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0004b/Friends.json | 27 - .../resources/rml-io/RMLTTC0004b/README.md | 110 - .../resources/rml-io/RMLTTC0004b/default.nq | 0 .../resources/rml-io/RMLTTC0004b/dump1.n3 | 12 - .../resources/rml-io/RMLTTC0004b/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0004c/Friends.json | 27 - .../resources/rml-io/RMLTTC0004c/README.md | 108 - .../resources/rml-io/RMLTTC0004c/default.nq | 0 .../resources/rml-io/RMLTTC0004c/dump1.nt | 10 - .../resources/rml-io/RMLTTC0004c/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0004d/Friends.json | 27 - .../resources/rml-io/RMLTTC0004d/README.md | 108 - .../resources/rml-io/RMLTTC0004d/default.nq | 0 .../resources/rml-io/RMLTTC0004d/dump1.nq | 10 - .../resources/rml-io/RMLTTC0004d/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0004e/Friends.json | 27 - .../resources/rml-io/RMLTTC0004e/README.md | 120 - .../resources/rml-io/RMLTTC0004e/default.nq | 0 .../rml-io/RMLTTC0004e/dump1.rdfjson | 22 - .../resources/rml-io/RMLTTC0004e/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0004f/Friends.json | 27 - .../resources/rml-io/RMLTTC0004f/README.md | 121 - .../resources/rml-io/RMLTTC0004f/default.nq | 0 .../resources/rml-io/RMLTTC0004f/dump1.rdfxml | 23 - .../resources/rml-io/RMLTTC0004f/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0004g/Friends.json | 27 - .../resources/rml-io/RMLTTC0004g/README.md | 108 - .../resources/rml-io/RMLTTC0004g/default.nq | 0 .../resources/rml-io/RMLTTC0004g/dump1.ttl | 10 - .../resources/rml-io/RMLTTC0004g/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0005a/Friends.json | 27 - .../resources/rml-io/RMLTTC0005a/README.md | 109 - .../resources/rml-io/RMLTTC0005a/default.nq | 0 .../resources/rml-io/RMLTTC0005a/dump1.nq | 10 - .../resources/rml-io/RMLTTC0005a/mapping.ttl | 44 - .../resources/rml-io/RMLTTC0005b/Friends.json | 27 - .../resources/rml-io/RMLTTC0005b/README.md | 109 - .../resources/rml-io/RMLTTC0005b/default.nq | 0 .../resources/rml-io/RMLTTC0005b/dump1.nq | Bin 1358 -> 0 bytes .../resources/rml-io/RMLTTC0005b/mapping.ttl | 44 - .../resources/rml-io/RMLTTC0006a/Friends.json | 27 - .../resources/rml-io/RMLTTC0006a/README.md | 108 - .../resources/rml-io/RMLTTC0006a/default.nq | 0 .../resources/rml-io/RMLTTC0006a/dump1.nq | 10 - .../resources/rml-io/RMLTTC0006a/mapping.ttl | 43 - .../resources/rml-io/RMLTTC0006b/Friends.json | 27 - .../resources/rml-io/RMLTTC0006b/README.md | 97 - .../resources/rml-io/RMLTTC0006b/default.nq | 0 .../resources/rml-io/RMLTTC0006b/dump1.nq.gz | Bin 193 -> 0 bytes .../resources/rml-io/RMLTTC0006b/mapping.ttl | 44 - .../resources/rml-io/RMLTTC0006c/Friends.json | 27 - .../resources/rml-io/RMLTTC0006c/README.md | 97 - .../resources/rml-io/RMLTTC0006c/default.nq | 0 .../resources/rml-io/RMLTTC0006c/mapping.ttl | 44 - .../resources/rml-io/RMLTTC0006d/Friends.json | 27 - .../resources/rml-io/RMLTTC0006d/README.md | 98 - .../resources/rml-io/RMLTTC0006d/default.nq | 0 .../rml-io/RMLTTC0006d/dump1.nq.tar.xz | Bin 277 -> 0 bytes .../resources/rml-io/RMLTTC0006d/mapping.ttl | 45 - .../resources/rml-io/RMLTTC0006e/Friends.json | 27 - .../resources/rml-io/RMLTTC0006e/README.md | 97 - .../resources/rml-io/RMLTTC0006e/default.nq | 0 .../resources/rml-io/RMLTTC0006e/mapping.ttl | 44 - .../resources/rml-io/RMLTTC0007a/Friends.json | 27 - .../resources/rml-io/RMLTTC0007a/README.md | 108 - .../resources/rml-io/RMLTTC0007a/default.nq | 0 .../resources/rml-io/RMLTTC0007a/dump1.nq | 10 - .../resources/rml-io/RMLTTC0007a/mapping.ttl | 43 - src/test/resources/rml-io/config.js | 73 - src/test/resources/rml-io/descriptions.csv | 85 - src/test/resources/rml-io/dev.html | 173 - .../resources/rml-io/docs/20250130/index.html | 5687 ----- .../resources/rml-io/docs/20250217/index.html | 5298 ----- .../resources/rml-io/docs/20250228/index.html | 6190 ----- .../resources/rml-io/docs/20250630/index.html | 6880 ------ src/test/resources/rml-io/docs/index.html | 6880 ------ src/test/resources/rml-io/list.sh | 5 - src/test/resources/rml-io/make-metadata.py | 210 - src/test/resources/rml-io/manifest.rml.ttl | 267 - src/test/resources/rml-io/manifest.ttl | 1096 - src/test/resources/rml-io/metadata.csv | 74 - src/test/resources/rml-io/section/abstract.md | 1 - .../resources/rml-io/section/data-model.md | 12 - .../resources/rml-io/section/introduction.md | 4 - .../resources/rml-io/section/test-cases.md | 10 - src/test/resources/rml-lv/README.md | 12 - .../resources/rml-lv/RMLLVTC0000a/README.md | 82 - .../resources/rml-lv/RMLLVTC0000a/mapping.ttl | 31 - .../resources/rml-lv/RMLLVTC0000a/output.nq | 2 - .../resources/rml-lv/RMLLVTC0000a/people.json | 26 - .../resources/rml-lv/RMLLVTC0000b/README.md | 59 - .../resources/rml-lv/RMLLVTC0000b/mapping.ttl | 30 - .../resources/rml-lv/RMLLVTC0000b/output.nq | 3 - .../resources/rml-lv/RMLLVTC0000b/people.csv | 4 - .../resources/rml-lv/RMLLVTC0000c/README.md | 90 - .../resources/rml-lv/RMLLVTC0000c/mapping.ttl | 39 - .../resources/rml-lv/RMLLVTC0000c/output.nq | 2 - .../resources/rml-lv/RMLLVTC0000c/people.json | 26 - .../resources/rml-lv/RMLLVTC0001a/README.md | 82 - .../resources/rml-lv/RMLLVTC0001a/mapping.ttl | 31 - .../resources/rml-lv/RMLLVTC0001a/output.nq | 2 - .../resources/rml-lv/RMLLVTC0001a/people.json | 26 - .../resources/rml-lv/RMLLVTC0001b/README.md | 87 - .../resources/rml-lv/RMLLVTC0001b/mapping.ttl | 36 - .../resources/rml-lv/RMLLVTC0001b/output.nq | 2 - .../resources/rml-lv/RMLLVTC0001b/people.json | 26 - .../resources/rml-lv/RMLLVTC0001c/README.md | 89 - .../resources/rml-lv/RMLLVTC0001c/mapping.ttl | 36 - .../resources/rml-lv/RMLLVTC0001c/output.nq | 2 - .../resources/rml-lv/RMLLVTC0001c/people.json | 28 - .../resources/rml-lv/RMLLVTC0001d/README.md | 90 - .../resources/rml-lv/RMLLVTC0001d/mapping.ttl | 37 - .../resources/rml-lv/RMLLVTC0001d/output.nq | 2 - .../resources/rml-lv/RMLLVTC0001d/people.json | 28 - .../resources/rml-lv/RMLLVTC0002a/README.md | 94 - .../resources/rml-lv/RMLLVTC0002a/mapping.ttl | 42 - .../resources/rml-lv/RMLLVTC0002a/output.nq | 3 - .../resources/rml-lv/RMLLVTC0002a/people.json | 26 - .../resources/rml-lv/RMLLVTC0002b/README.md | 109 - .../resources/rml-lv/RMLLVTC0002b/mapping.ttl | 54 - .../resources/rml-lv/RMLLVTC0002b/output.nq | 6 - .../resources/rml-lv/RMLLVTC0002b/people.json | 26 - .../resources/rml-lv/RMLLVTC0002c/README.md | 112 - .../resources/rml-lv/RMLLVTC0002c/mapping.ttl | 52 - .../resources/rml-lv/RMLLVTC0002c/output.nq | 3 - .../resources/rml-lv/RMLLVTC0002c/people.json | 34 - .../resources/rml-lv/RMLLVTC0003a/README.md | 84 - .../resources/rml-lv/RMLLVTC0003a/mapping.ttl | 33 - .../resources/rml-lv/RMLLVTC0003a/output.nq | 2 - .../resources/rml-lv/RMLLVTC0003a/people.json | 26 - .../resources/rml-lv/RMLLVTC0003b/README.md | 94 - .../resources/rml-lv/RMLLVTC0003b/mapping.ttl | 41 - .../resources/rml-lv/RMLLVTC0003b/output.nq | 4 - .../resources/rml-lv/RMLLVTC0003b/people.json | 26 - .../resources/rml-lv/RMLLVTC0003c/README.md | 80 - .../resources/rml-lv/RMLLVTC0003c/mapping.ttl | 37 - .../resources/rml-lv/RMLLVTC0003c/output.nq | 3 - .../resources/rml-lv/RMLLVTC0003c/people.json | 17 - .../resources/rml-lv/RMLLVTC0004a/README.md | 82 - .../resources/rml-lv/RMLLVTC0004a/mapping.ttl | 31 - .../resources/rml-lv/RMLLVTC0004a/output.nq | 2 - .../resources/rml-lv/RMLLVTC0004a/people.json | 26 - .../resources/rml-lv/RMLLVTC0004b/README.md | 93 - .../resources/rml-lv/RMLLVTC0004b/mapping.ttl | 41 - .../resources/rml-lv/RMLLVTC0004b/output.nq | 3 - .../resources/rml-lv/RMLLVTC0004b/people.json | 26 - .../resources/rml-lv/RMLLVTC0004c/README.md | 80 - .../resources/rml-lv/RMLLVTC0004c/mapping.ttl | 37 - .../resources/rml-lv/RMLLVTC0004c/output.nq | 3 - .../resources/rml-lv/RMLLVTC0004c/people.json | 17 - .../resources/rml-lv/RMLLVTC0004d/README.md | 74 - .../resources/rml-lv/RMLLVTC0004d/mapping.ttl | 37 - .../resources/rml-lv/RMLLVTC0004d/output.nq | 2 - .../resources/rml-lv/RMLLVTC0004d/people.json | 12 - .../resources/rml-lv/RMLLVTC0005a/README.md | 75 - .../resources/rml-lv/RMLLVTC0005a/mapping.ttl | 31 - .../resources/rml-lv/RMLLVTC0005a/people.json | 26 - .../resources/rml-lv/RMLLVTC0005b/README.md | 75 - .../resources/rml-lv/RMLLVTC0005b/mapping.ttl | 31 - .../resources/rml-lv/RMLLVTC0005b/people.json | 26 - .../resources/rml-lv/RMLLVTC0005c/README.md | 86 - .../resources/rml-lv/RMLLVTC0005c/mapping.ttl | 42 - .../resources/rml-lv/RMLLVTC0005c/people.json | 26 - .../resources/rml-lv/RMLLVTC0006a/README.md | 133 - .../resources/rml-lv/RMLLVTC0006a/mapping.ttl | 78 - .../resources/rml-lv/RMLLVTC0006a/output.nq | 6 - .../resources/rml-lv/RMLLVTC0006a/people.csv | 4 - .../resources/rml-lv/RMLLVTC0006a/people.json | 17 - .../resources/rml-lv/RMLLVTC0006b/README.md | 132 - .../resources/rml-lv/RMLLVTC0006b/mapping.ttl | 78 - .../resources/rml-lv/RMLLVTC0006b/output.nq | 5 - .../resources/rml-lv/RMLLVTC0006b/people.csv | 4 - .../resources/rml-lv/RMLLVTC0006b/people.json | 17 - .../resources/rml-lv/RMLLVTC0006c/README.md | 176 - .../resources/rml-lv/RMLLVTC0006c/mapping.ttl | 112 - .../resources/rml-lv/RMLLVTC0006c/output.nq | 6 - .../resources/rml-lv/RMLLVTC0006c/people.csv | 4 - .../resources/rml-lv/RMLLVTC0006c/people.json | 17 - .../resources/rml-lv/RMLLVTC0006c/people2.csv | 4 - .../resources/rml-lv/RMLLVTC0006d/README.md | 175 - .../resources/rml-lv/RMLLVTC0006d/mapping.ttl | 112 - .../resources/rml-lv/RMLLVTC0006d/output.nq | 5 - .../resources/rml-lv/RMLLVTC0006d/people.csv | 4 - .../resources/rml-lv/RMLLVTC0006d/people.json | 17 - .../resources/rml-lv/RMLLVTC0006d/people2.csv | 4 - .../resources/rml-lv/RMLLVTC0006e/README.md | 171 - .../resources/rml-lv/RMLLVTC0006e/mapping.ttl | 112 - .../resources/rml-lv/RMLLVTC0006e/output.nq | 3 - .../resources/rml-lv/RMLLVTC0006e/people.csv | 4 - .../resources/rml-lv/RMLLVTC0006e/people.json | 17 - .../resources/rml-lv/RMLLVTC0006e/people2.csv | 2 - .../resources/rml-lv/RMLLVTC0006f/README.md | 133 - .../resources/rml-lv/RMLLVTC0006f/mapping.ttl | 78 - .../resources/rml-lv/RMLLVTC0006f/output.nq | 6 - .../resources/rml-lv/RMLLVTC0006f/people.csv | 4 - .../resources/rml-lv/RMLLVTC0006f/people.json | 17 - .../resources/rml-lv/RMLLVTC0007a/README.md | 91 - .../resources/rml-lv/RMLLVTC0007a/mapping.ttl | 59 - .../resources/rml-lv/RMLLVTC0007a/output.nq | 6 - .../resources/rml-lv/RMLLVTC0007a/people.csv | 3 - .../resources/rml-lv/RMLLVTC0007b/README.md | 91 - .../resources/rml-lv/RMLLVTC0007b/mapping.ttl | 58 - .../resources/rml-lv/RMLLVTC0007b/output.nq | 6 - .../resources/rml-lv/RMLLVTC0007b/people.csv | 4 - .../resources/rml-lv/RMLLVTC0007c/README.md | 100 - .../resources/rml-lv/RMLLVTC0007c/mapping.ttl | 59 - .../resources/rml-lv/RMLLVTC0007c/output.nq | 6 - .../resources/rml-lv/RMLLVTC0007c/people.json | 12 - .../resources/rml-lv/RMLLVTC0008a/README.md | 43 - .../resources/rml-lv/RMLLVTC0008a/mapping.ttl | 30 - .../resources/rml-lv/RMLLVTC0008b/README.md | 134 - .../resources/rml-lv/RMLLVTC0008b/mapping.ttl | 90 - .../resources/rml-lv/RMLLVTC0008b/output.nq | 6 - .../resources/rml-lv/RMLLVTC0008b/people.csv | 4 - .../resources/rml-lv/RMLLVTC0008b/people.json | 17 - .../resources/rml-lv/RMLLVTC0008c/README.md | 87 - .../resources/rml-lv/RMLLVTC0008c/mapping.ttl | 43 - .../resources/rml-lv/RMLLVTC0008c/people.json | 26 - .../resources/rml-lv/RMLLVTC0008d/README.md | 70 - .../resources/rml-lv/RMLLVTC0008d/mapping.ttl | 26 - .../resources/rml-lv/RMLLVTC0008d/people.json | 26 - .../resources/rml-lv/RMLLVTC0009a/README.md | 65 - .../resources/rml-lv/RMLLVTC0009a/mapping.ttl | 35 - .../resources/rml-lv/RMLLVTC0009a/people.json | 12 - .../resources/rml-lv/RMLLVTC0009b/README.md | 118 - .../resources/rml-lv/RMLLVTC0009b/mapping.ttl | 72 - .../resources/rml-lv/RMLLVTC0009b/people.csv | 4 - .../resources/rml-lv/RMLLVTC0009b/people.json | 19 - .../resources/rml-lv/RMLLVTC0009c/README.md | 156 - .../resources/rml-lv/RMLLVTC0009c/mapping.ttl | 105 - .../resources/rml-lv/RMLLVTC0009c/people.csv | 4 - .../resources/rml-lv/RMLLVTC0009c/people.json | 17 - .../resources/rml-lv/RMLLVTC0009c/people2.csv | 3 - src/test/resources/rml-lv/config.js | 87 - src/test/resources/rml-lv/descriptions.csv | 41 - src/test/resources/rml-lv/dev.html | 133 - .../resources/rml-lv/docs/20250130/index.html | 1742 -- .../resources/rml-lv/docs/20250204/index.html | 1742 -- .../resources/rml-lv/docs/20250216/index.html | 2142 -- .../resources/rml-lv/docs/20250228/index.html | 3383 --- .../resources/rml-lv/docs/20250508/index.html | 3529 --- .../resources/rml-lv/docs/20250725/index.html | 3490 --- .../resources/rml-lv/docs/20250805/index.html | 3524 --- .../resources/rml-lv/docs/20251029/index.html | 3850 --- src/test/resources/rml-lv/docs/index.html | 3524 --- src/test/resources/rml-lv/list.sh | 5 - src/test/resources/rml-lv/make-metadata.py | 148 - src/test/resources/rml-lv/manifest.rml.ttl | 267 - src/test/resources/rml-lv/manifest.ttl | 396 - src/test/resources/rml-lv/metadata.csv | 33 - src/test/resources/rml-lv/section/abstract.md | 1 - .../resources/rml-lv/section/data-model.md | 12 - .../resources/rml-lv/section/introduction.md | 4 - .../resources/rml-lv/section/test-cases.md | 10 - .../rml-star/RMLSTARTC001a/README.md | 67 - .../resources/rml-star/RMLSTARTC001a/data.csv | 2 - .../rml-star/RMLSTARTC001a/mapping.ttl | 40 - .../rml-star/RMLSTARTC001a/output.nt | 2 - .../rml-star/RMLSTARTC001b/README.md | 79 - .../rml-star/RMLSTARTC001b/data1.csv | 2 - .../rml-star/RMLSTARTC001b/data2.csv | 3 - .../rml-star/RMLSTARTC001b/mapping.ttl | 44 - .../rml-star/RMLSTARTC001b/output.nt | 2 - .../rml-star/RMLSTARTC002a/README.md | 69 - .../resources/rml-star/RMLSTARTC002a/data.csv | 2 - .../rml-star/RMLSTARTC002a/mapping.ttl | 42 - .../rml-star/RMLSTARTC002a/output.nt | 2 - .../rml-star/RMLSTARTC002b/README.md | 81 - .../rml-star/RMLSTARTC002b/data1.csv | 2 - .../rml-star/RMLSTARTC002b/data2.csv | 3 - .../rml-star/RMLSTARTC002b/mapping.ttl | 46 - .../rml-star/RMLSTARTC002b/output.nt | 2 - .../rml-star/RMLSTARTC003a/README.md | 86 - .../resources/rml-star/RMLSTARTC003a/data.csv | 2 - .../rml-star/RMLSTARTC003a/mapping.ttl | 58 - .../rml-star/RMLSTARTC003a/output.nt | 3 - .../rml-star/RMLSTARTC003b/README.md | 98 - .../rml-star/RMLSTARTC003b/data1.csv | 2 - .../rml-star/RMLSTARTC003b/data2.csv | 3 - .../rml-star/RMLSTARTC003b/mapping.ttl | 62 - .../rml-star/RMLSTARTC003b/output.nt | 3 - .../rml-star/RMLSTARTC004a/README.md | 85 - .../resources/rml-star/RMLSTARTC004a/data.csv | 2 - .../rml-star/RMLSTARTC004a/mapping.ttl | 57 - .../rml-star/RMLSTARTC004a/output.nt | 3 - .../rml-star/RMLSTARTC004b/README.md | 97 - .../rml-star/RMLSTARTC004b/data1.csv | 2 - .../rml-star/RMLSTARTC004b/data2.csv | 3 - .../rml-star/RMLSTARTC004b/mapping.ttl | 61 - .../rml-star/RMLSTARTC004b/output.nt | 3 - .../rml-star/RMLSTARTC005a/README.md | 66 - .../resources/rml-star/RMLSTARTC005a/data.csv | 2 - .../rml-star/RMLSTARTC005a/mapping.ttl | 40 - .../rml-star/RMLSTARTC005a/output.nt | 1 - .../rml-star/RMLSTARTC005b/README.md | 78 - .../rml-star/RMLSTARTC005b/data1.csv | 2 - .../rml-star/RMLSTARTC005b/data2.csv | 3 - .../rml-star/RMLSTARTC005b/mapping.ttl | 44 - .../rml-star/RMLSTARTC005b/output.nt | 1 - .../rml-star/RMLSTARTC006a/README.md | 66 - .../resources/rml-star/RMLSTARTC006a/data.csv | 2 - .../rml-star/RMLSTARTC006a/mapping.ttl | 40 - .../rml-star/RMLSTARTC006a/output.nt | 1 - .../rml-star/RMLSTARTC006b/README.md | 78 - .../rml-star/RMLSTARTC006b/data1.csv | 2 - .../rml-star/RMLSTARTC006b/data2.csv | 3 - .../rml-star/RMLSTARTC006b/mapping.ttl | 44 - .../rml-star/RMLSTARTC006b/output.nt | 1 - .../rml-star/RMLSTARTC007a/README.md | 83 - .../resources/rml-star/RMLSTARTC007a/data.csv | 2 - .../rml-star/RMLSTARTC007a/mapping.ttl | 57 - .../rml-star/RMLSTARTC007a/output.nt | 1 - .../rml-star/RMLSTARTC007b/README.md | 95 - .../rml-star/RMLSTARTC007b/data1.csv | 2 - .../rml-star/RMLSTARTC007b/data2.csv | 3 - .../rml-star/RMLSTARTC007b/mapping.ttl | 61 - .../rml-star/RMLSTARTC007b/output.nt | 1 - .../rml-star/RMLSTARTC008a/README.md | 151 - .../resources/rml-star/RMLSTARTC008a/data.csv | 2 - .../rml-star/RMLSTARTC008a/mapping.ttl | 125 - .../rml-star/RMLSTARTC008a/output.nt | 1 - .../rml-star/RMLSTARTC008b/README.md | 163 - .../rml-star/RMLSTARTC008b/data1.csv | 2 - .../rml-star/RMLSTARTC008b/data2.csv | 3 - .../rml-star/RMLSTARTC008b/mapping.ttl | 129 - .../rml-star/RMLSTARTC008b/output.nt | 1 - .../resources/rml-star/RMLSTARTC009/README.md | 59 - .../resources/rml-star/RMLSTARTC009/data.csv | 2 - .../rml-star/RMLSTARTC009/mapping.ttl | 39 - .../resources/rml-star/RMLSTARTC010/README.md | 57 - .../resources/rml-star/RMLSTARTC010/data.csv | 2 - .../rml-star/RMLSTARTC010/mapping.ttl | 37 - src/test/resources/rml-star/config.js | 72 - src/test/resources/rml-star/descriptions.csv | 19 - src/test/resources/rml-star/dev.html | 118 - .../rml-star/docs/20250130/index.html | 1895 -- .../rml-star/docs/20251029/index.html | 2017 -- src/test/resources/rml-star/docs/index.html | 2017 -- .../rml-star/invalid/RMLSTARTC009/data.csv | 2 - .../rml-star/invalid/RMLSTARTC009/mapping.ttl | 39 - .../rml-star/invalid/RMLSTARTC010/data.csv | 2 - .../rml-star/invalid/RMLSTARTC010/mapping.ttl | 37 - src/test/resources/rml-star/list.sh | 5 - src/test/resources/rml-star/make-metadata.py | 143 - src/test/resources/rml-star/manifest.rml.ttl | 267 - src/test/resources/rml-star/manifest.ttl | 240 - src/test/resources/rml-star/metadata.csv | 19 - .../resources/rml-star/section/abstract.md | 1 - .../resources/rml-star/section/data-model.md | 12 - .../rml-star/section/introduction.md | 4 - .../resources/rml-star/section/test-cases.md | 10 - .../rml-star/valid/RMLSTARTC001a/data.csv | 2 - .../rml-star/valid/RMLSTARTC001a/mapping.ttl | 40 - .../rml-star/valid/RMLSTARTC001a/output.nt | 2 - .../rml-star/valid/RMLSTARTC001b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC001b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC001b/mapping.ttl | 44 - .../rml-star/valid/RMLSTARTC001b/output.nt | 2 - .../rml-star/valid/RMLSTARTC002a/data.csv | 2 - .../rml-star/valid/RMLSTARTC002a/mapping.ttl | 42 - .../rml-star/valid/RMLSTARTC002a/output.nt | 2 - .../rml-star/valid/RMLSTARTC002b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC002b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC002b/mapping.ttl | 46 - .../rml-star/valid/RMLSTARTC002b/output.nt | 2 - .../rml-star/valid/RMLSTARTC003a/data.csv | 2 - .../rml-star/valid/RMLSTARTC003a/mapping.ttl | 58 - .../rml-star/valid/RMLSTARTC003a/output.nt | 3 - .../rml-star/valid/RMLSTARTC003b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC003b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC003b/mapping.ttl | 62 - .../rml-star/valid/RMLSTARTC003b/output.nt | 3 - .../rml-star/valid/RMLSTARTC004a/data.csv | 2 - .../rml-star/valid/RMLSTARTC004a/mapping.ttl | 57 - .../rml-star/valid/RMLSTARTC004a/output.nt | 3 - .../rml-star/valid/RMLSTARTC004b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC004b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC004b/mapping.ttl | 61 - .../rml-star/valid/RMLSTARTC004b/output.nt | 3 - .../rml-star/valid/RMLSTARTC005a/data.csv | 2 - .../rml-star/valid/RMLSTARTC005a/mapping.ttl | 40 - .../rml-star/valid/RMLSTARTC005a/output.nt | 1 - .../rml-star/valid/RMLSTARTC005b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC005b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC005b/mapping.ttl | 44 - .../rml-star/valid/RMLSTARTC005b/output.nt | 1 - .../rml-star/valid/RMLSTARTC006a/data.csv | 2 - .../rml-star/valid/RMLSTARTC006a/mapping.ttl | 40 - .../rml-star/valid/RMLSTARTC006a/output.nt | 1 - .../rml-star/valid/RMLSTARTC006b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC006b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC006b/mapping.ttl | 44 - .../rml-star/valid/RMLSTARTC006b/output.nt | 1 - .../rml-star/valid/RMLSTARTC007a/data.csv | 2 - .../rml-star/valid/RMLSTARTC007a/mapping.ttl | 57 - .../rml-star/valid/RMLSTARTC007a/output.nt | 1 - .../rml-star/valid/RMLSTARTC007b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC007b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC007b/mapping.ttl | 61 - .../rml-star/valid/RMLSTARTC007b/output.nt | 1 - .../rml-star/valid/RMLSTARTC008a/data.csv | 2 - .../rml-star/valid/RMLSTARTC008a/mapping.ttl | 125 - .../rml-star/valid/RMLSTARTC008a/output.nt | 1 - .../rml-star/valid/RMLSTARTC008b/data1.csv | 2 - .../rml-star/valid/RMLSTARTC008b/data2.csv | 2 - .../rml-star/valid/RMLSTARTC008b/mapping.ttl | 129 - .../rml-star/valid/RMLSTARTC008b/output.nt | 1 - 1390 files changed, 28 insertions(+), 197947 deletions(-) mode change 100755 => 100644 src/main/resources/shapes/rml-cc/generate_shape.py mode change 100755 => 100644 src/main/resources/shapes/rml-cc/tests.py mode change 100755 => 100644 src/main/resources/shapes/rml-core/generate_shape.py mode change 100755 => 100644 src/main/resources/shapes/rml-core/mapping_validator.py mode change 100755 => 100644 src/main/resources/shapes/rml-core/tests.py mode change 100755 => 100644 src/main/resources/shapes/rml-fnml/generate_shape.py mode change 100755 => 100644 src/main/resources/shapes/rml-fnml/tests.py mode change 100755 => 100644 src/main/resources/shapes/rml-io/generate_shape.py mode change 100755 => 100644 src/main/resources/shapes/rml-io/tests.py mode change 100755 => 100644 src/main/resources/shapes/rml-lv/mapping_validator.py mode change 100755 => 100644 src/main/resources/shapes/rml-lv/tests.py delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Alt/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Alt/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Alt/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Bag/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Bag/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Bag/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-List/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-List/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-List/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Seq/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Seq/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Seq/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-Bag/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-Bag/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-Bag/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-List/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-List/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-List/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EB/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EB/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EB/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEB/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEB/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEB/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEL/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEL/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEL/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NELb/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NELb/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NELb/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM1/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM1/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM1/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM2/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM2/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM2/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM3/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM3/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM3/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM4/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM4/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM4/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM5/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM5/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM5/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App1/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App1/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App1/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App2/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App2/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App2/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car1/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car1/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car1/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car2/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car2/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car2/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT0/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT0/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT0/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT1/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT1/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT1/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT2/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT2/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT2/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT3/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT3/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT3/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT3/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT4/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT4/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT4/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT4/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT5/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT5/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT5/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0006-IT5/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0007-NES/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0007-NES/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0007-NES/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/student.csv delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/student.csv delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Lista/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Lista/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Lista/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Lista/mapping.ttl delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Listb/README.md delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Listb/data.json delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Listb/default.nq delete mode 100644 src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl delete mode 100644 src/test/resources/rml-cc/config.js delete mode 100644 src/test/resources/rml-cc/descriptions.csv delete mode 100644 src/test/resources/rml-cc/dev.html delete mode 100644 src/test/resources/rml-cc/docs/20250130/index.html delete mode 100644 src/test/resources/rml-cc/docs/20250206/index.html delete mode 100644 src/test/resources/rml-cc/docs/20250225/index.html delete mode 100644 src/test/resources/rml-cc/docs/20250915/index.html delete mode 100644 src/test/resources/rml-cc/docs/index.html delete mode 100755 src/test/resources/rml-cc/list.sh delete mode 100755 src/test/resources/rml-cc/make-metadata.py delete mode 100644 src/test/resources/rml-cc/manifest.rml.ttl delete mode 100644 src/test/resources/rml-cc/manifest.ttl delete mode 100644 src/test/resources/rml-cc/metadata.csv delete mode 100644 src/test/resources/rml-cc/publish.js delete mode 100644 src/test/resources/rml-cc/rendered.html delete mode 100644 src/test/resources/rml-cc/section/abstract.md delete mode 100644 src/test/resources/rml-cc/section/data-model.md delete mode 100644 src/test/resources/rml-cc/section/introduction.md delete mode 100644 src/test/resources/rml-cc/section/test-cases.md delete mode 100644 src/test/resources/rml-core-gm/RMLTC0001/mapping.ttl delete mode 100644 src/test/resources/rml-core-gm/RMLTC0001/output.nq delete mode 100644 src/test/resources/rml-core-gm/RMLTC0001/student.json delete mode 100644 src/test/resources/rml-core-gm/RMLTC0002/mapping.ttl delete mode 100644 src/test/resources/rml-core-gm/RMLTC0002/output.nq delete mode 100644 src/test/resources/rml-core-gm/RMLTC0002/student.json delete mode 100644 src/test/resources/rml-core-gm/RMLTC0003/mapping.ttl delete mode 100644 src/test/resources/rml-core-gm/RMLTC0003/output.nq delete mode 100644 src/test/resources/rml-core-gm/RMLTC0003/student.json delete mode 100644 src/test/resources/rml-core-gm/RMLTC0004/mapping.ttl delete mode 100644 src/test/resources/rml-core-gm/RMLTC0004/output.nq delete mode 100644 src/test/resources/rml-core-gm/RMLTC0004/student.json delete mode 100644 src/test/resources/rml-core-gm/RMLTC0005/mapping.ttl delete mode 100644 src/test/resources/rml-core-gm/RMLTC0005/output.nq delete mode 100644 src/test/resources/rml-core-gm/RMLTC0005/student.json delete mode 100644 src/test/resources/rml-core/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0000-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0000-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0000-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0001a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0001a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0001a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0001b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0001b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0001b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0002a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0002a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0002a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0002b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0002b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0002b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0002e-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0002e-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0002g-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0002g-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0003c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0003c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0003c-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0004a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0004a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0004a-JSON/student_sport.json delete mode 100644 src/test/resources/rml-core/RMLTC0004b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0004b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0005a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0005a-JSON/ious.json delete mode 100644 src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0005a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0006a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0006a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0006a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0006a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0007a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0007b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0007c-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007d-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007d-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0007d-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007e-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007e-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0007e-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007f-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007f-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0007f-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007g-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007g-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0007g-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0007h-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0007h-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0008a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0008a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0008a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0008b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0008b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0008b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0008c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0008c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0008c-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0009a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0009a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0009a-JSON/sport.json delete mode 100644 src/test/resources/rml-core/RMLTC0009a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0009b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0009b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0009b-JSON/sport.json delete mode 100644 src/test/resources/rml-core/RMLTC0009b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0010a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0010a-JSON/country_info.json delete mode 100644 src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0010a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0010b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0010b-JSON/country_info.json delete mode 100644 src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0010b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0010c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0010c-JSON/country_info.json delete mode 100644 src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0010c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0011b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0011b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0011b-JSON/sport.json delete mode 100644 src/test/resources/rml-core/RMLTC0011b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0011b-JSON/student_sport.json delete mode 100644 src/test/resources/rml-core/RMLTC0012a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0012a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0012a-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0012b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0012b-JSON/lives.json delete mode 100644 src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0012b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0012b-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0012c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0012c-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0012d-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0012d-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0013a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0013a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0013a-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0015a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0015a-JSON/country_en.json delete mode 100644 src/test/resources/rml-core/RMLTC0015a-JSON/country_es.json delete mode 100644 src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0015a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0015b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0015b-JSON/country_en.json delete mode 100644 src/test/resources/rml-core/RMLTC0015b-JSON/country_es.json delete mode 100644 src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0019a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0019a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0019a-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0019b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0019b-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0020a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0020a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0020a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0021a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0021a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0021a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0022a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0022a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0022a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0022a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0022b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0022b-JSON/data.json delete mode 100644 src/test/resources/rml-core/RMLTC0022b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0022b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0022c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0022c-JSON/data.json delete mode 100644 src/test/resources/rml-core/RMLTC0022c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0022c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0023a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0023a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0023a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0023b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0023b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0023b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0023c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0023c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0023c-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0023d-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0023d-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0023d-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0023e-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0023e-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0023e-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0023f-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0023f-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0023f-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0023f-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0024a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0024a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0024a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0025a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0025a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0025a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0025a-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0025b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0025b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0025b-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0025c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0025c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0025c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0025c-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0026a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0026a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0026a-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0026b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0026b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0026b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0026b-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0026c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0026c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0026c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0026c-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0026d-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0026d-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0026d-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0026d-JSON/persons.json delete mode 100644 src/test/resources/rml-core/RMLTC0027-XML/ious.xml delete mode 100644 src/test/resources/rml-core/RMLTC0027-XML/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0027-XML/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0027a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0027a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0027a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0027a-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0027b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0027b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0027b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0027b-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0027c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0027c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0027c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0027c-JSON/student.json delete mode 100644 src/test/resources/rml-core/RMLTC0028a-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0028a-JSON/data.json delete mode 100644 src/test/resources/rml-core/RMLTC0028a-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0028a-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0028b-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0028b-JSON/data.json delete mode 100644 src/test/resources/rml-core/RMLTC0028b-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0028b-JSON/output.nq delete mode 100644 src/test/resources/rml-core/RMLTC0028c-JSON/README.md delete mode 100644 src/test/resources/rml-core/RMLTC0028c-JSON/data.json delete mode 100644 src/test/resources/rml-core/RMLTC0028c-JSON/mapping.ttl delete mode 100644 src/test/resources/rml-core/RMLTC0028c-JSON/output.nq delete mode 100644 src/test/resources/rml-core/config.js delete mode 100644 src/test/resources/rml-core/descriptions.csv delete mode 100644 src/test/resources/rml-core/descriptions_old.csv delete mode 100644 src/test/resources/rml-core/dev.html delete mode 100644 src/test/resources/rml-core/docs/20250130/index.html delete mode 100644 src/test/resources/rml-core/docs/20250204/index.html delete mode 100644 src/test/resources/rml-core/docs/20250217/index.html delete mode 100644 src/test/resources/rml-core/docs/20250224/index.html delete mode 100644 src/test/resources/rml-core/docs/20250228/index.html delete mode 100644 src/test/resources/rml-core/docs/20250908/index.html delete mode 100644 src/test/resources/rml-core/docs/20250927/index.html delete mode 100644 src/test/resources/rml-core/docs/20250930/index.html delete mode 100644 src/test/resources/rml-core/docs/index.html delete mode 100755 src/test/resources/rml-core/list.sh delete mode 100755 src/test/resources/rml-core/make-metadata.py delete mode 100644 src/test/resources/rml-core/manifest.rml.ttl delete mode 100644 src/test/resources/rml-core/manifest.ttl delete mode 100644 src/test/resources/rml-core/metadata.csv delete mode 100644 src/test/resources/rml-core/section/abstract.md delete mode 100644 src/test/resources/rml-core/section/data-model.md delete mode 100644 src/test/resources/rml-core/section/introduction.md delete mode 100644 src/test/resources/rml-core/section/test-cases.md delete mode 100644 src/test/resources/rml-fnml-burp/README.md delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml-burp/functions.ttl delete mode 100644 src/test/resources/rml-fnml-grel/README.md delete mode 100644 src/test/resources/rml-fnml-grel/boolean-and-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-and-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-and-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/boolean-and-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-and-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-and-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/boolean-not-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-not-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-not-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/boolean-not-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-not-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-not-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/boolean-or-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-or-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-or-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/boolean-or-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-or-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-or-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/boolean-xor-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-xor-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-xor-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/boolean-xor-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/boolean-xor-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/boolean-xor-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/math-abs/data.csv delete mode 100644 src/test/resources/rml-fnml-grel/math-abs/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/math-abs/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/math-ceil/data.csv delete mode 100644 src/test/resources/rml-fnml-grel/math-ceil/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/math-ceil/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/math-floor/data.csv delete mode 100644 src/test/resources/rml-fnml-grel/math-floor/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/math-floor/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-chomp-a/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-chomp-a/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-chomp-a/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-chomp-b/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-chomp-b/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-chomp-b/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-p-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-p-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-p-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-p-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-p-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-p-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-s-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-s-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-s-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-s-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-s-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-contains-s-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-endswith-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-endswith-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-endswith-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-endswith-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-endswith-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-endswith-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-get-a/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-get-a/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-get-a/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-get-b/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-get-b/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-get-b/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-get-c/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-get-c/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-get-c/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-length/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-length/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-length/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-replace/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-replace/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-replace/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-startswith-false/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-startswith-false/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-startswith-false/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-startswith-true/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-startswith-true/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-startswith-true/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-strip/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-strip/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-strip/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-a/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-a/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-a/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-b/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-b/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-b/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-c/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-c/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-substring-c/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-tolowercase/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-tolowercase/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-tolowercase/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-totitlecase-a/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-totitlecase-a/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-totitlecase-a/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-totitlecase-b/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-totitlecase-b/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-totitlecase-b/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-touppercase/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-touppercase/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-touppercase/student.csv delete mode 100644 src/test/resources/rml-fnml-grel/string-trim/mapping.ttl delete mode 100644 src/test/resources/rml-fnml-grel/string-trim/output.nq delete mode 100644 src/test/resources/rml-fnml-grel/string-trim/student.csv delete mode 100644 src/test/resources/rml-fnml/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/README.md delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/output.nq delete mode 100644 src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/student.csv delete mode 100644 src/test/resources/rml-fnml/config.js delete mode 100644 src/test/resources/rml-fnml/descriptions.csv delete mode 100644 src/test/resources/rml-fnml/dev.html delete mode 100644 src/test/resources/rml-fnml/docs/20250130/index.html delete mode 100644 src/test/resources/rml-fnml/docs/20250303/index.html delete mode 100644 src/test/resources/rml-fnml/docs/20250630/index.html delete mode 100644 src/test/resources/rml-fnml/docs/20250806/index.html delete mode 100644 src/test/resources/rml-fnml/docs/index.html delete mode 100644 src/test/resources/rml-fnml/functions.ttl delete mode 100755 src/test/resources/rml-fnml/list.sh delete mode 100755 src/test/resources/rml-fnml/make-metadata.py delete mode 100644 src/test/resources/rml-fnml/manifest.rml.ttl delete mode 100644 src/test/resources/rml-fnml/manifest.ttl delete mode 100644 src/test/resources/rml-fnml/metadata.csv delete mode 100644 src/test/resources/rml-fnml/section/abstract.md delete mode 100644 src/test/resources/rml-fnml/section/data-model.md delete mode 100644 src/test/resources/rml-fnml/section/introduction.md delete mode 100644 src/test/resources/rml-fnml/section/test-cases.md delete mode 100644 src/test/resources/rml-io/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0001a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLSTC0001a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0001a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0001a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0001b/Friends-UTF16.json delete mode 100644 src/test/resources/rml-io/RMLSTC0001b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0001b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0001b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0002a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLSTC0002a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0002a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0002a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0002b/Friends.json.gz delete mode 100644 src/test/resources/rml-io/RMLSTC0002b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0002b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0002b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0002c/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0002c/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0002c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz delete mode 100644 src/test/resources/rml-io/RMLSTC0002d/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0002d/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0002d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0002e/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0002e/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0002e/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0003/Friends.nt delete mode 100644 src/test/resources/rml-io/RMLSTC0003/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0003/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0003/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0004a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0004a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0004a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0004b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0004b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0004b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0004c/Friends-NULL.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0004c/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0004c/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0004c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0006a/Friends.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0006a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0006a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0006a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0006b/Friends.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0006b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0006b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0006b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0007a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLSTC0007a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0007a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0007a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0007b/Friends.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0007b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0007b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0007b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0007c/Friends.xml delete mode 100644 src/test/resources/rml-io/RMLSTC0007c/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0007c/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0007c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0007d/Friends.xml delete mode 100644 src/test/resources/rml-io/RMLSTC0007d/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0007d/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0007d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0008a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLSTC0008a/Friends2.json delete mode 100644 src/test/resources/rml-io/RMLSTC0008a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0008a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0008a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0008b/Friends.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0008b/Friends.json delete mode 100644 src/test/resources/rml-io/RMLSTC0008b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0008b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0008b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0009a/Friends.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0009a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0009a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0009a/output.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0010a/Friends.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0010a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0010a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0010b/Friends.csv delete mode 100644 src/test/resources/rml-io/RMLSTC0010b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0010b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0011a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0011a/companies.json delete mode 100644 src/test/resources/rml-io/RMLSTC0011a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0011a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0011b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0011b/companies.json delete mode 100644 src/test/resources/rml-io/RMLSTC0011b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0011b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0011c/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0011c/companies.json delete mode 100644 src/test/resources/rml-io/RMLSTC0011c/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0011c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0011d/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0011d/companies.json delete mode 100644 src/test/resources/rml-io/RMLSTC0011d/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0011d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0011e/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0011e/companies.json delete mode 100644 src/test/resources/rml-io/RMLSTC0011e/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0011e/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0012a/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0012a/companies.xml delete mode 100644 src/test/resources/rml-io/RMLSTC0012a/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0012a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0012b/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0012b/companies.xml delete mode 100644 src/test/resources/rml-io/RMLSTC0012b/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0012b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0012c/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0012c/companies.xml delete mode 100644 src/test/resources/rml-io/RMLSTC0012c/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0012c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0012d/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0012d/companies.xml delete mode 100644 src/test/resources/rml-io/RMLSTC0012d/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0012d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLSTC0012e/README.md delete mode 100644 src/test/resources/rml-io/RMLSTC0012e/companies.xml delete mode 100644 src/test/resources/rml-io/RMLSTC0012e/default.nq delete mode 100644 src/test/resources/rml-io/RMLSTC0012e/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0000/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0000/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0000/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0000/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0001a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0001a/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0001a/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001a/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0001b/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0001b/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0001b/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001b/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0001c/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0001c/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0001c/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001c/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0001d/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0001d/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0001d/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001d/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0001e/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0001e/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0001e/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001e/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001e/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0001f/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0001f/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0001f/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001f/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0001f/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002a/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002a/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002a/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002a/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002b/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002b/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002b/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002b/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002b/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002c/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002c/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002c/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002c/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002c/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002d/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002d/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002d/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002d/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002d/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002e/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002e/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002e/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002e/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002e/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002e/dump3.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002e/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002f/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002f/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002f/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002f/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002f/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002f/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002g/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002g/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002g/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002g/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002g/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002g/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002h/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002h/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002h/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002h/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002h/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002h/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002i/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002i/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002i/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002i/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002i/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002i/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002j/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002j/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002j/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002j/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002j/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002j/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002k/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002k/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002k/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002k/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002k/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002k/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002l/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002l/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002l/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002l/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002l/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002l/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002m/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002m/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002m/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002m/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002m/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002m/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002n/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002n/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002n/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002n/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002n/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002n/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002o/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002o/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002o/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002o/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002o/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002o/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002p/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002p/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002p/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002p/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002p/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002p/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002q/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002q/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002q/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002q/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002q/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002q/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0002r/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0002r/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0002r/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002r/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0002r/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0003a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0003a/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0003a/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0003a/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0003a/dump2.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0003a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0004a/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0004a/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004a/dump1.jsonld delete mode 100644 src/test/resources/rml-io/RMLTTC0004a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004b/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0004b/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0004b/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004b/dump1.n3 delete mode 100644 src/test/resources/rml-io/RMLTTC0004b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004c/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0004c/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0004c/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004c/dump1.nt delete mode 100644 src/test/resources/rml-io/RMLTTC0004c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004d/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0004d/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0004d/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004d/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004e/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0004e/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0004e/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004e/dump1.rdfjson delete mode 100644 src/test/resources/rml-io/RMLTTC0004e/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004f/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0004f/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0004f/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004f/dump1.rdfxml delete mode 100644 src/test/resources/rml-io/RMLTTC0004f/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004g/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0004g/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0004g/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0004g/dump1.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0004g/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0005a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0005a/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0005a/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0005a/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0005a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0005b/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0005b/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0005b/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0005b/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0005b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0006a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0006a/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0006a/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0006a/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0006a/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0006b/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0006b/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0006b/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0006b/dump1.nq.gz delete mode 100644 src/test/resources/rml-io/RMLTTC0006b/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0006c/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0006c/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0006c/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0006c/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0006d/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0006d/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0006d/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0006d/dump1.nq.tar.xz delete mode 100644 src/test/resources/rml-io/RMLTTC0006d/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0006e/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0006e/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0006e/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0006e/mapping.ttl delete mode 100644 src/test/resources/rml-io/RMLTTC0007a/Friends.json delete mode 100644 src/test/resources/rml-io/RMLTTC0007a/README.md delete mode 100644 src/test/resources/rml-io/RMLTTC0007a/default.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0007a/dump1.nq delete mode 100644 src/test/resources/rml-io/RMLTTC0007a/mapping.ttl delete mode 100644 src/test/resources/rml-io/config.js delete mode 100644 src/test/resources/rml-io/descriptions.csv delete mode 100644 src/test/resources/rml-io/dev.html delete mode 100644 src/test/resources/rml-io/docs/20250130/index.html delete mode 100644 src/test/resources/rml-io/docs/20250217/index.html delete mode 100644 src/test/resources/rml-io/docs/20250228/index.html delete mode 100644 src/test/resources/rml-io/docs/20250630/index.html delete mode 100644 src/test/resources/rml-io/docs/index.html delete mode 100755 src/test/resources/rml-io/list.sh delete mode 100755 src/test/resources/rml-io/make-metadata.py delete mode 100644 src/test/resources/rml-io/manifest.rml.ttl delete mode 100644 src/test/resources/rml-io/manifest.ttl delete mode 100644 src/test/resources/rml-io/metadata.csv delete mode 100644 src/test/resources/rml-io/section/abstract.md delete mode 100644 src/test/resources/rml-io/section/data-model.md delete mode 100644 src/test/resources/rml-io/section/introduction.md delete mode 100644 src/test/resources/rml-io/section/test-cases.md delete mode 100644 src/test/resources/rml-lv/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000a/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000b/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000c/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0000c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001a/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001c/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001d/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001d/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001d/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0001d/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002a/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002c/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0002c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003a/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003c/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0003c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004a/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004c/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004d/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004d/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004d/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0004d/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0005c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006a/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006a/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006b/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006c/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006c/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006c/people2.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006d/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006d/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006d/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006d/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006d/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006d/people2.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006e/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006e/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006e/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006e/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006e/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006e/people2.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006f/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006f/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006f/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006f/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0006f/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007a/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007a/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007b/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007c/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0007c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008b/output.nq delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008b/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008d/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008d/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0008d/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009a/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009a/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009a/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009b/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009b/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009b/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009b/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009c/README.md delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009c/mapping.ttl delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009c/people.csv delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009c/people.json delete mode 100644 src/test/resources/rml-lv/RMLLVTC0009c/people2.csv delete mode 100644 src/test/resources/rml-lv/config.js delete mode 100644 src/test/resources/rml-lv/descriptions.csv delete mode 100644 src/test/resources/rml-lv/dev.html delete mode 100644 src/test/resources/rml-lv/docs/20250130/index.html delete mode 100644 src/test/resources/rml-lv/docs/20250204/index.html delete mode 100644 src/test/resources/rml-lv/docs/20250216/index.html delete mode 100644 src/test/resources/rml-lv/docs/20250228/index.html delete mode 100644 src/test/resources/rml-lv/docs/20250508/index.html delete mode 100644 src/test/resources/rml-lv/docs/20250725/index.html delete mode 100644 src/test/resources/rml-lv/docs/20250805/index.html delete mode 100644 src/test/resources/rml-lv/docs/20251029/index.html delete mode 100644 src/test/resources/rml-lv/docs/index.html delete mode 100755 src/test/resources/rml-lv/list.sh delete mode 100755 src/test/resources/rml-lv/make-metadata.py delete mode 100644 src/test/resources/rml-lv/manifest.rml.ttl delete mode 100644 src/test/resources/rml-lv/manifest.ttl delete mode 100644 src/test/resources/rml-lv/metadata.csv delete mode 100644 src/test/resources/rml-lv/section/abstract.md delete mode 100644 src/test/resources/rml-lv/section/data-model.md delete mode 100644 src/test/resources/rml-lv/section/introduction.md delete mode 100644 src/test/resources/rml-lv/section/test-cases.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC001a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC001a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC001a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC001a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC001b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC001b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC001b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC001b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC001b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC002a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC002a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC002a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC002a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC002b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC002b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC002b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC002b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC002b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC003a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC003a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC003a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC003a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC003b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC003b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC003b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC003b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC003b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC004a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC004a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC004a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC004a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC004b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC004b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC004b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC004b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC004b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC005a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC005a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC005a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC005a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC005b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC005b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC005b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC005b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC005b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC006a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC006a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC006a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC006a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC006b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC006b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC006b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC006b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC006b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC007a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC007a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC007a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC007a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC007b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC007b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC007b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC007b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC007b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC008a/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC008a/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC008a/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC008a/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC008b/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC008b/data1.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC008b/data2.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC008b/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC008b/output.nt delete mode 100644 src/test/resources/rml-star/RMLSTARTC009/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC009/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC009/mapping.ttl delete mode 100644 src/test/resources/rml-star/RMLSTARTC010/README.md delete mode 100644 src/test/resources/rml-star/RMLSTARTC010/data.csv delete mode 100644 src/test/resources/rml-star/RMLSTARTC010/mapping.ttl delete mode 100644 src/test/resources/rml-star/config.js delete mode 100644 src/test/resources/rml-star/descriptions.csv delete mode 100644 src/test/resources/rml-star/dev.html delete mode 100644 src/test/resources/rml-star/docs/20250130/index.html delete mode 100644 src/test/resources/rml-star/docs/20251029/index.html delete mode 100644 src/test/resources/rml-star/docs/index.html delete mode 100644 src/test/resources/rml-star/invalid/RMLSTARTC009/data.csv delete mode 100644 src/test/resources/rml-star/invalid/RMLSTARTC009/mapping.ttl delete mode 100644 src/test/resources/rml-star/invalid/RMLSTARTC010/data.csv delete mode 100644 src/test/resources/rml-star/invalid/RMLSTARTC010/mapping.ttl delete mode 100755 src/test/resources/rml-star/list.sh delete mode 100755 src/test/resources/rml-star/make-metadata.py delete mode 100644 src/test/resources/rml-star/manifest.rml.ttl delete mode 100644 src/test/resources/rml-star/manifest.ttl delete mode 100644 src/test/resources/rml-star/metadata.csv delete mode 100644 src/test/resources/rml-star/section/abstract.md delete mode 100644 src/test/resources/rml-star/section/data-model.md delete mode 100644 src/test/resources/rml-star/section/introduction.md delete mode 100644 src/test/resources/rml-star/section/test-cases.md delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC001a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC001a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC001a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC001b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC001b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC001b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC001b/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC002a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC002a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC002a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC002b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC002b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC002b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC002b/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC003a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC003a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC003a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC003b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC003b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC003b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC003b/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC004a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC004a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC004a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC004b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC004b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC004b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC004b/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC005a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC005a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC005a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC005b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC005b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC005b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC005b/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC006a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC006a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC006a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC006b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC006b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC006b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC006b/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC007a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC007a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC007a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC007b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC007b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC007b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC007b/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC008a/data.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC008a/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC008a/output.nt delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC008b/data1.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC008b/data2.csv delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC008b/mapping.ttl delete mode 100644 src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt diff --git a/src/main/resources/shapes/rml-cc/generate_shape.py b/src/main/resources/shapes/rml-cc/generate_shape.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-cc/tests.py b/src/main/resources/shapes/rml-cc/tests.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-core/generate_shape.py b/src/main/resources/shapes/rml-core/generate_shape.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-core/mapping_validator.py b/src/main/resources/shapes/rml-core/mapping_validator.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-core/tests.py b/src/main/resources/shapes/rml-core/tests.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-fnml/generate_shape.py b/src/main/resources/shapes/rml-fnml/generate_shape.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-fnml/tests.py b/src/main/resources/shapes/rml-fnml/tests.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-io/generate_shape.py b/src/main/resources/shapes/rml-io/generate_shape.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-io/tests.py b/src/main/resources/shapes/rml-io/tests.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-lv/lv.ttl b/src/main/resources/shapes/rml-lv/lv.ttl index 31a23be..1d1e9fe 100644 --- a/src/main/resources/shapes/rml-lv/lv.ttl +++ b/src/main/resources/shapes/rml-lv/lv.ttl @@ -240,15 +240,32 @@ rmlsh:LogicalViewJoinShape a sh:NodeShape ; A field of the logical view join. """ ; sh:message """ - At least one rml:field property must be specified for a rml:LogicalViewJoin, with a resource as its value. + At least one rml:field property must be specified for a rml:LogicalViewJoin, with a leaf expression field as its value. """ ; sh:path rml:field ; sh:minCount 1 ; sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( - [ sh:node rmlsh:ExpressionFieldShape ] - [ sh:node rmlsh:IterableFieldShape ] - ) + sh:node rmlsh:LeafExpressionFieldShape ; + ] . + +rmlsh:LeafExpressionFieldShape a sh:NodeShape ; + rdfs:label "Leaf Expression Field" ; + rdfs:comment """ + A leaf expression field is an expression field without nested fields. + """ ; + sh:message """ + Node must have a valid rml:ExpressionField description. + """ ; + sh:node rmlsh:ExpressionFieldShape ; + sh:property [ + sh:description """ + A leaf expression field is an expression field without nested fields. + """ ; + sh:message """ + A leaf expression field has no nested fields. + """ ; + sh:path rml:field ; + sh:maxCount 0 ; ] . rmlsh:StructuralAnnotationShape a sh:NodeShape; diff --git a/src/main/resources/shapes/rml-lv/mapping_validator.py b/src/main/resources/shapes/rml-lv/mapping_validator.py old mode 100755 new mode 100644 diff --git a/src/main/resources/shapes/rml-lv/tests.py b/src/main/resources/shapes/rml-lv/tests.py old mode 100755 new mode 100644 index 8fe1fdd..295eca0 --- a/src/main/resources/shapes/rml-lv/tests.py +++ b/src/main/resources/shapes/rml-lv/tests.py @@ -53,7 +53,12 @@ def test_validation_rules(self, path: str) -> None: rules test cases. """ print(f'Testing validation with: {path}') - self._validate_rules(path) + if 'RMLLVTC0008a' in path or 'RMLLVTC0008b' in path or \ + 'RMLLVTC0008c' in path or 'RMLLVTC0008d' in path: + with self.assertRaises(Exception): + self._validate_rules(path) + else: + self._validate_rules(path) if __name__ == '__main__': diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/README.md deleted file mode 100644 index 6c1a501..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/README.md +++ /dev/null @@ -1,64 +0,0 @@ -## RMLTC-CC-0001-Alt - -**Title**: Generate a rdf:Alt as an object - -**Description**: Tests if a rdf:Alt is generated as an object - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Alt ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . - - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . - - _:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/data.json b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/data.json deleted file mode 100644 index 147b8e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/default.nq deleted file mode 100644 index 74e2d14..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/default.nq +++ /dev/null @@ -1,17 +0,0 @@ - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . - - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . - - _:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl deleted file mode 100644 index 11c108f..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Alt/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Alt ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/README.md deleted file mode 100644 index d5eacf3..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/README.md +++ /dev/null @@ -1,61 +0,0 @@ -## RMLTC-CC-0001-Bag - -**Title**: Generate a rdf:Bag as an object - -**Description**: Tests if a rdf:Bag is generated as an object - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b3 . - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/data.json b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/data.json deleted file mode 100644 index 147b8e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/default.nq deleted file mode 100644 index 7b134a9..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/default.nq +++ /dev/null @@ -1,15 +0,0 @@ -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b3 . - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl deleted file mode 100644 index cefcb53..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Bag/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-List/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-List/README.md deleted file mode 100644 index 25824e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-List/README.md +++ /dev/null @@ -1,70 +0,0 @@ -## RMLTC-CC-0001-List - -**Title**: Generate a rdf:List as an object - -**Description**: Tests if a rdf:List is generated as an object - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:n988e0f11d19c486fa3b3255f94c9b3bab1 . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 _:n988e0f11d19c486fa3b3255f94c9b3bab2 . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 "2" . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 _:n988e0f11d19c486fa3b3255f94c9b3bab3 . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 "3" . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab4 . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 "4" . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 _:n988e0f11d19c486fa3b3255f94c9b3bab5 . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 "5" . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 _:n988e0f11d19c486fa3b3255f94c9b3bab6 . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 "6" . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab7 . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 "7" . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 _:n988e0f11d19c486fa3b3255f94c9b3bab8 . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 "8" . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 _:n988e0f11d19c486fa3b3255f94c9b3bab9 . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 "9" . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-List/data.json b/src/test/resources/rml-cc/RMLTC-CC-0001-List/data.json deleted file mode 100644 index 147b8e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-List/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-List/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0001-List/default.nq deleted file mode 100644 index 0b4e8c1..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-List/default.nq +++ /dev/null @@ -1,23 +0,0 @@ - _:n988e0f11d19c486fa3b3255f94c9b3bab1 . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 _:n988e0f11d19c486fa3b3255f94c9b3bab2 . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 "2" . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 _:n988e0f11d19c486fa3b3255f94c9b3bab3 . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 "3" . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab4 . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 "4" . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 _:n988e0f11d19c486fa3b3255f94c9b3bab5 . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 "5" . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 _:n988e0f11d19c486fa3b3255f94c9b3bab6 . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 "6" . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab7 . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 "7" . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 _:n988e0f11d19c486fa3b3255f94c9b3bab8 . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 "8" . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 _:n988e0f11d19c486fa3b3255f94c9b3bab9 . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 "9" . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl deleted file mode 100644 index 0e837b7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-List/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/README.md b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/README.md deleted file mode 100644 index 8afa22d..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/README.md +++ /dev/null @@ -1,61 +0,0 @@ -## RMLTC-CC-0001-Seq - -**Title**: Generate a rdf:Seq as an object - -**Description**: Tests if a rdf:Seq is generated as an object - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Seq ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b3 . - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/data.json b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/data.json deleted file mode 100644 index 147b8e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/default.nq deleted file mode 100644 index e0bf7de..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/default.nq +++ /dev/null @@ -1,15 +0,0 @@ -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "5" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "2" . - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b3 . - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "4" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "3" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl deleted file mode 100644 index 03a1475..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0001-Seq/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Seq ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/README.md b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/README.md deleted file mode 100644 index 2af1fbd..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/README.md +++ /dev/null @@ -1,62 +0,0 @@ -## RMLTC-CC-0002-Bag - -**Title**: Generate a named rdf:Bag as an object - -**Description**: Tests if a named rdf:Bag is generated as an object - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - . - "7" . - "8" . - "2" . - . - . - "6" . - . - "9" . - "1" . - "3" . - "4" . - . - . - "5" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/data.json b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/data.json deleted file mode 100644 index 147b8e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/default.nq deleted file mode 100644 index 8b5f957..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/default.nq +++ /dev/null @@ -1,15 +0,0 @@ - . - "7" . - "8" . - "2" . - . - . - "6" . - . - "9" . - "1" . - "3" . - "4" . - . - . - "5" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl deleted file mode 100644 index 88fbb31..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-Bag/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-List/README.md b/src/test/resources/rml-cc/RMLTC-CC-0002-List/README.md deleted file mode 100644 index e8635f8..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-List/README.md +++ /dev/null @@ -1,68 +0,0 @@ -## RMLTC-CC-0002-List - -**Title**: Generate a named rdf:List as an object - -**Description**: Tests if a named rdf:List is generated as an object - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:nb73dd869d6bb47a5b865ee632fe27453b1 _:nb73dd869d6bb47a5b865ee632fe27453b2 . - . - "7" . -_:nb73dd869d6bb47a5b865ee632fe27453b5 "8" . -_:nb73dd869d6bb47a5b865ee632fe27453b3 _:nb73dd869d6bb47a5b865ee632fe27453b4 . -_:nb73dd869d6bb47a5b865ee632fe27453b6 . - . -_:nb73dd869d6bb47a5b865ee632fe27453b3 "5" . - _:nb73dd869d6bb47a5b865ee632fe27453b3 . -_:nb73dd869d6bb47a5b865ee632fe27453b4 "6" . -_:nb73dd869d6bb47a5b865ee632fe27453b4 . -_:nb73dd869d6bb47a5b865ee632fe27453b5 _:nb73dd869d6bb47a5b865ee632fe27453b6 . -_:nb73dd869d6bb47a5b865ee632fe27453b2 . -_:nb73dd869d6bb47a5b865ee632fe27453b1 "2" . -_:nb73dd869d6bb47a5b865ee632fe27453b2 "3" . - "4" . - _:nb73dd869d6bb47a5b865ee632fe27453b1 . - _:nb73dd869d6bb47a5b865ee632fe27453b5 . -_:nb73dd869d6bb47a5b865ee632fe27453b6 "9" . - . - "1" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-List/data.json b/src/test/resources/rml-cc/RMLTC-CC-0002-List/data.json deleted file mode 100644 index 147b8e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-List/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-List/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0002-List/default.nq deleted file mode 100644 index 9f03fd7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-List/default.nq +++ /dev/null @@ -1,21 +0,0 @@ -_:nb73dd869d6bb47a5b865ee632fe27453b1 _:nb73dd869d6bb47a5b865ee632fe27453b2 . - . - "7" . -_:nb73dd869d6bb47a5b865ee632fe27453b5 "8" . -_:nb73dd869d6bb47a5b865ee632fe27453b3 _:nb73dd869d6bb47a5b865ee632fe27453b4 . -_:nb73dd869d6bb47a5b865ee632fe27453b6 . - . -_:nb73dd869d6bb47a5b865ee632fe27453b3 "5" . - _:nb73dd869d6bb47a5b865ee632fe27453b3 . -_:nb73dd869d6bb47a5b865ee632fe27453b4 "6" . -_:nb73dd869d6bb47a5b865ee632fe27453b4 . -_:nb73dd869d6bb47a5b865ee632fe27453b5 _:nb73dd869d6bb47a5b865ee632fe27453b6 . -_:nb73dd869d6bb47a5b865ee632fe27453b2 . -_:nb73dd869d6bb47a5b865ee632fe27453b1 "2" . -_:nb73dd869d6bb47a5b865ee632fe27453b2 "3" . - "4" . - _:nb73dd869d6bb47a5b865ee632fe27453b1 . - _:nb73dd869d6bb47a5b865ee632fe27453b5 . -_:nb73dd869d6bb47a5b865ee632fe27453b6 "9" . - . - "1" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl deleted file mode 100644 index a97b431..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0002-List/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/README.md deleted file mode 100644 index 66fc396..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/README.md +++ /dev/null @@ -1,54 +0,0 @@ -## RMLTC-CC-0003-EB - -**Title**: Allow the generation of empty bags - -**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:nfecac3cfe48c4afa99539cc809138e96b2 . - _:nfecac3cfe48c4afa99539cc809138e96b1 . -_:nfecac3cfe48c4afa99539cc809138e96b1 . -_:nfecac3cfe48c4afa99539cc809138e96b1 "1" . - _:nfecac3cfe48c4afa99539cc809138e96b2 . -_:nfecac3cfe48c4afa99539cc809138e96b1 "2" . -_:nfecac3cfe48c4afa99539cc809138e96b1 "3" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/data.json b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/default.nq deleted file mode 100644 index 5575c4f..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/default.nq +++ /dev/null @@ -1,7 +0,0 @@ -_:nfecac3cfe48c4afa99539cc809138e96b2 . - _:nfecac3cfe48c4afa99539cc809138e96b1 . -_:nfecac3cfe48c4afa99539cc809138e96b1 . -_:nfecac3cfe48c4afa99539cc809138e96b1 "1" . - _:nfecac3cfe48c4afa99539cc809138e96b2 . -_:nfecac3cfe48c4afa99539cc809138e96b1 "2" . -_:nfecac3cfe48c4afa99539cc809138e96b1 "3" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl deleted file mode 100644 index 948c61f..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EB/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/README.md deleted file mode 100644 index 6968e66..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/README.md +++ /dev/null @@ -1,56 +0,0 @@ -## RMLTC-CC-0003-EL-BN - -**Title**: Allow the generation of empty lists identified by blank node identifiers. - -**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; rml:termType rml:BlankNode ; - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n302eecc856b44ed5b76965d9be2f5213b3 . - . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . - _:n302eecc856b44ed5b76965d9be2f5213b1 . -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/data.json b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/default.nq deleted file mode 100644 index 0879749..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/default.nq +++ /dev/null @@ -1,8 +0,0 @@ -_:n302eecc856b44ed5b76965d9be2f5213b3 . - . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . - _:n302eecc856b44ed5b76965d9be2f5213b1 . -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl deleted file mode 100644 index 07dce41..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-BN/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; rml:termType rml:BlankNode ; - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/README.md deleted file mode 100644 index a32feca..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/README.md +++ /dev/null @@ -1,56 +0,0 @@ -## RMLTC-CC-0003-EL-Named - -**Title**: Allow the generation of empty lists identified by IRIs. - -**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n302eecc856b44ed5b76965d9be2f5213b3 . - . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . - _:n302eecc856b44ed5b76965d9be2f5213b2 . - . - "1" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/data.json b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/default.nq deleted file mode 100644 index d357d49..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/default.nq +++ /dev/null @@ -1,8 +0,0 @@ -_:n302eecc856b44ed5b76965d9be2f5213b3 . - . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . - _:n302eecc856b44ed5b76965d9be2f5213b2 . - . - "1" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl deleted file mode 100644 index 066ecc7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL-Named/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/README.md deleted file mode 100644 index 0d764a8..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/README.md +++ /dev/null @@ -1,55 +0,0 @@ -## RMLTC-CC-0003-EL - -**Title**: Allow the generation of empty lists - -**Description**: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n302eecc856b44ed5b76965d9be2f5213b3 . - . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . - _:n302eecc856b44ed5b76965d9be2f5213b1 . -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/data.json b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/default.nq deleted file mode 100644 index 0879749..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/default.nq +++ /dev/null @@ -1,8 +0,0 @@ -_:n302eecc856b44ed5b76965d9be2f5213b3 . - . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . - _:n302eecc856b44ed5b76965d9be2f5213b1 . -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl deleted file mode 100644 index c4877f5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-EL/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:allowEmptyListAndContainer true ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/README.md deleted file mode 100644 index 1b565b8..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## RMLTC-CC-0003-NEB - -**Title**: Empty bags are not generated - -**Description**: Tests if empty containers are not generated (expected default behavior). - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:n2bd72de9c571444081890e41009d92d4b1 . -_:n2bd72de9c571444081890e41009d92d4b1 "3" . -_:n2bd72de9c571444081890e41009d92d4b1 . -_:n2bd72de9c571444081890e41009d92d4b1 "2" . -_:n2bd72de9c571444081890e41009d92d4b1 "1" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/data.json b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/default.nq deleted file mode 100644 index 3d4d463..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - _:n2bd72de9c571444081890e41009d92d4b1 . -_:n2bd72de9c571444081890e41009d92d4b1 "3" . -_:n2bd72de9c571444081890e41009d92d4b1 . -_:n2bd72de9c571444081890e41009d92d4b1 "2" . -_:n2bd72de9c571444081890e41009d92d4b1 "1" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl deleted file mode 100644 index cefcb53..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEB/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/README.md deleted file mode 100644 index 89ff517..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/README.md +++ /dev/null @@ -1,53 +0,0 @@ -## RMLTC-CC-0003-NEL - -**Title**: Empty lists are not generated - -**Description**: Tests if empty lists are not generated (expected default behavior). - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n434c2c54e09e4a259604ba1188ce038fb1 _:n434c2c54e09e4a259604ba1188ce038fb2 . -_:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb2 "2" . - _:n434c2c54e09e4a259604ba1188ce038fb1 . -_:n434c2c54e09e4a259604ba1188ce038fb2 _:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb1 "1" . -_:n434c2c54e09e4a259604ba1188ce038fb3 "3" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/data.json b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/default.nq deleted file mode 100644 index 5acbac2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/default.nq +++ /dev/null @@ -1,7 +0,0 @@ -_:n434c2c54e09e4a259604ba1188ce038fb1 _:n434c2c54e09e4a259604ba1188ce038fb2 . -_:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb2 "2" . - _:n434c2c54e09e4a259604ba1188ce038fb1 . -_:n434c2c54e09e4a259604ba1188ce038fb2 _:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb1 "1" . -_:n434c2c54e09e4a259604ba1188ce038fb3 "3" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl deleted file mode 100644 index 0e837b7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NEL/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/README.md b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/README.md deleted file mode 100644 index 2b7434b..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/README.md +++ /dev/null @@ -1,54 +0,0 @@ -## RMLTC-CC-0003-NELb - -**Title**: Empty lists are not generated II - -**Description**: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:allowEmptyListAndContainer false ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n434c2c54e09e4a259604ba1188ce038fb1 _:n434c2c54e09e4a259604ba1188ce038fb2 . -_:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb2 "2" . - _:n434c2c54e09e4a259604ba1188ce038fb1 . -_:n434c2c54e09e4a259604ba1188ce038fb2 _:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb1 "1" . -_:n434c2c54e09e4a259604ba1188ce038fb3 "3" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/data.json b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/default.nq deleted file mode 100644 index 5acbac2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/default.nq +++ /dev/null @@ -1,7 +0,0 @@ -_:n434c2c54e09e4a259604ba1188ce038fb1 _:n434c2c54e09e4a259604ba1188ce038fb2 . -_:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb2 "2" . - _:n434c2c54e09e4a259604ba1188ce038fb1 . -_:n434c2c54e09e4a259604ba1188ce038fb2 _:n434c2c54e09e4a259604ba1188ce038fb3 . -_:n434c2c54e09e4a259604ba1188ce038fb1 "1" . -_:n434c2c54e09e4a259604ba1188ce038fb3 "3" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl deleted file mode 100644 index bfeaa8a..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0003-NELb/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:allowEmptyListAndContainer false ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/README.md deleted file mode 100644 index a3ec666..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/README.md +++ /dev/null @@ -1,59 +0,0 @@ -## RMLTC-CC-0004-SM1 - -**Title**: GatherMap in subject map (list) - -**Description**: Tests if the use of a gather map in the subject map is supported. This test generates a list. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:createdBy ; - rml:object ex:JohnDoe ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n302eecc856b44ed5b76965d9be2f5213b1 . -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n1d393f12e993411498da676131f81ca4b1 . -_:n1d393f12e993411498da676131f81ca4b1 "4" . -_:n1d393f12e993411498da676131f81ca4b1 _:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b2 "5" . -_:n1d393f12e993411498da676131f81ca4b2 _:n1d393f12e993411498da676131f81ca4b3 . -_:n1d393f12e993411498da676131f81ca4b3 "6" . -_:n1d393f12e993411498da676131f81ca4b3 . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/data.json b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/data.json deleted file mode 100644 index 7e67671..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/data.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/default.nq deleted file mode 100644 index f2aca1c..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/default.nq +++ /dev/null @@ -1,14 +0,0 @@ -_:n302eecc856b44ed5b76965d9be2f5213b1 . -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n1d393f12e993411498da676131f81ca4b1 . -_:n1d393f12e993411498da676131f81ca4b1 "4" . -_:n1d393f12e993411498da676131f81ca4b1 _:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b2 "5" . -_:n1d393f12e993411498da676131f81ca4b2 _:n1d393f12e993411498da676131f81ca4b3 . -_:n1d393f12e993411498da676131f81ca4b3 "6" . -_:n1d393f12e993411498da676131f81ca4b3 . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl deleted file mode 100644 index 5e2d732..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM1/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:createdBy ; - rml:object ex:JohnDoe ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/README.md deleted file mode 100644 index eedb608..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/README.md +++ /dev/null @@ -1,52 +0,0 @@ -## RMLTC-CC-0004-SM2 - -**Title**: GatherMap in subject map (list) - -**Description**: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n1d393f12e993411498da676131f81ca4b1 "4" . -_:n1d393f12e993411498da676131f81ca4b1 _:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b2 "5" . -_:n1d393f12e993411498da676131f81ca4b2 _:n1d393f12e993411498da676131f81ca4b3 . -_:n1d393f12e993411498da676131f81ca4b3 "6" . -_:n1d393f12e993411498da676131f81ca4b3 . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/data.json b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/data.json deleted file mode 100644 index 7e67671..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/data.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/default.nq deleted file mode 100644 index bbde605..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/default.nq +++ /dev/null @@ -1,12 +0,0 @@ -_:n302eecc856b44ed5b76965d9be2f5213b1 "1" . -_:n302eecc856b44ed5b76965d9be2f5213b1 _:n302eecc856b44ed5b76965d9be2f5213b2 . -_:n302eecc856b44ed5b76965d9be2f5213b2 "2" . -_:n302eecc856b44ed5b76965d9be2f5213b2 _:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n302eecc856b44ed5b76965d9be2f5213b3 "3" . -_:n302eecc856b44ed5b76965d9be2f5213b3 . -_:n1d393f12e993411498da676131f81ca4b1 "4" . -_:n1d393f12e993411498da676131f81ca4b1 _:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b2 "5" . -_:n1d393f12e993411498da676131f81ca4b2 _:n1d393f12e993411498da676131f81ca4b3 . -_:n1d393f12e993411498da676131f81ca4b3 "6" . -_:n1d393f12e993411498da676131f81ca4b3 . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl deleted file mode 100644 index 3001e5f..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM2/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/README.md deleted file mode 100644 index e0e5244..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/README.md +++ /dev/null @@ -1,45 +0,0 @@ -## RMLTC-CC-0004-SM3 - -**Title**: GatherMap in subject map (list) - -**Description**: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 "1" . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 "3" . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 "2" . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/data.json b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/default.nq deleted file mode 100644 index 738b922..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/default.nq +++ /dev/null @@ -1,6 +0,0 @@ -_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 "1" . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 "3" . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 "2" . -_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl deleted file mode 100644 index 3001e5f..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM3/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/README.md deleted file mode 100644 index 84711d1..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/README.md +++ /dev/null @@ -1,54 +0,0 @@ -## RMLTC-CC-0004-SM4 - -**Title**: GatherMap in subject map (bag) - -**Description**: Tests if the use of a gather map in the subject map is supported. This test generates a bag. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:createdBy ; - rml:object ex:JohnDoe ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n1d393f12e993411498da676131f81ca4b1 "2" . -_:n1d393f12e993411498da676131f81ca4b2 "5" . -_:n1d393f12e993411498da676131f81ca4b1 "1" . -_:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b1 "3" . -_:n1d393f12e993411498da676131f81ca4b2 "4" . -_:n1d393f12e993411498da676131f81ca4b1 . -_:n1d393f12e993411498da676131f81ca4b1 . -_:n1d393f12e993411498da676131f81ca4b2 "6" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/data.json b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/data.json deleted file mode 100644 index 7e67671..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/data.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [ - "4", - "5", - "6" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/default.nq deleted file mode 100644 index 31ab141..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/default.nq +++ /dev/null @@ -1,10 +0,0 @@ -_:n1d393f12e993411498da676131f81ca4b1 "2" . -_:n1d393f12e993411498da676131f81ca4b2 "5" . -_:n1d393f12e993411498da676131f81ca4b1 "1" . -_:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b2 . -_:n1d393f12e993411498da676131f81ca4b1 "3" . -_:n1d393f12e993411498da676131f81ca4b2 "4" . -_:n1d393f12e993411498da676131f81ca4b1 . -_:n1d393f12e993411498da676131f81ca4b1 . -_:n1d393f12e993411498da676131f81ca4b2 "6" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl deleted file mode 100644 index bb8af2b..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM4/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:createdBy ; - rml:object ex:JohnDoe ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/README.md b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/README.md deleted file mode 100644 index 99fd621..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## RMLTC-CC-0004-SM5 - -**Title**: GatherMap in subject map (bag) - -**Description**: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt). - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:ne32066984b71404a953025d001cd3cdfb1 . -_:ne32066984b71404a953025d001cd3cdfb1 "2" . -_:ne32066984b71404a953025d001cd3cdfb1 "1" . -_:ne32066984b71404a953025d001cd3cdfb1 "3" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/data.json b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/data.json deleted file mode 100644 index f7975ac..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "2", - "3" - ] - }, - { - "id": "b", - "values": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/default.nq deleted file mode 100644 index 65c2c2c..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/default.nq +++ /dev/null @@ -1,4 +0,0 @@ -_:ne32066984b71404a953025d001cd3cdfb1 . -_:ne32066984b71404a953025d001cd3cdfb1 "2" . -_:ne32066984b71404a953025d001cd3cdfb1 "1" . -_:ne32066984b71404a953025d001cd3cdfb1 "3" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl deleted file mode 100644 index 83c9751..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0004-SM5/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/README.md deleted file mode 100644 index 95c4b89..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -## RMLTC-CC-0005-App1 - -**Title**: Append values of multiple term maps - -**Description**: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:n1ee4a5a2b1344422919d171ab2cd6c39b1 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b1 "1" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b1 _:n1ee4a5a2b1344422919d171ab2cd6c39b2 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b2 "2" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b2 _:n1ee4a5a2b1344422919d171ab2cd6c39b4 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b4 "a" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b4 _:n1ee4a5a2b1344422919d171ab2cd6c39b5 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b5 "b" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b5 . - _:n1ee4a5a2b1344422919d171ab2cd6c39b6 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b6 "3" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b6 _:n1ee4a5a2b1344422919d171ab2cd6c39b7 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b7 "4" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b7 _:n1ee4a5a2b1344422919d171ab2cd6c39b8 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b8 "c" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b8 . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/data.json b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/data.json deleted file mode 100644 index f0feba6..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ], - "v2": [ - "a", - "b" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ], - "v2": [ - "c" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/default.nq deleted file mode 100644 index 7fe03c5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/default.nq +++ /dev/null @@ -1,16 +0,0 @@ - _:n1ee4a5a2b1344422919d171ab2cd6c39b1 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b1 "1" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b1 _:n1ee4a5a2b1344422919d171ab2cd6c39b2 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b2 "2" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b2 _:n1ee4a5a2b1344422919d171ab2cd6c39b4 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b4 "a" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b4 _:n1ee4a5a2b1344422919d171ab2cd6c39b5 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b5 "b" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b5 . - _:n1ee4a5a2b1344422919d171ab2cd6c39b6 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b6 "3" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b6 _:n1ee4a5a2b1344422919d171ab2cd6c39b7 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b7 "4" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b7 _:n1ee4a5a2b1344422919d171ab2cd6c39b8 . -_:n1ee4a5a2b1344422919d171ab2cd6c39b8 "c" . -_:n1ee4a5a2b1344422919d171ab2cd6c39b8 . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl deleted file mode 100644 index e2789c9..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App1/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/README.md deleted file mode 100644 index 2800e43..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/README.md +++ /dev/null @@ -1,64 +0,0 @@ -## RMLTC-CC-0005-App2 - -**Title**: Append values of multiple term maps - -**Description**: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:n1d9b8ef217cb44f299a062d746116deab1 _:n1d9b8ef217cb44f299a062d746116deab2 . -_:n1d9b8ef217cb44f299a062d746116deab5 "b" . -_:n1d9b8ef217cb44f299a062d746116deab4 _:n1d9b8ef217cb44f299a062d746116deab5 . -_:n1d9b8ef217cb44f299a062d746116deab3 _:n1d9b8ef217cb44f299a062d746116deab4 . -_:n1d9b8ef217cb44f299a062d746116deab7 "5" . -_:n1d9b8ef217cb44f299a062d746116deab2 "2" . -_:n1d9b8ef217cb44f299a062d746116deab8 "6" . -_:n1d9b8ef217cb44f299a062d746116deab8 . -_:n1d9b8ef217cb44f299a062d746116deab3 "3" . -_:n1d9b8ef217cb44f299a062d746116deab4 "a" . -_:n1d9b8ef217cb44f299a062d746116deab5 . -_:n1d9b8ef217cb44f299a062d746116deab2 _:n1d9b8ef217cb44f299a062d746116deab3 . -_:n1d9b8ef217cb44f299a062d746116deab1 "1" . - _:n1d9b8ef217cb44f299a062d746116deab1 . - _:n1d9b8ef217cb44f299a062d746116deab6 . -_:n1d9b8ef217cb44f299a062d746116deab7 _:n1d9b8ef217cb44f299a062d746116deab8 . -_:n1d9b8ef217cb44f299a062d746116deab6 _:n1d9b8ef217cb44f299a062d746116deab7 . -_:n1d9b8ef217cb44f299a062d746116deab6 "4" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/data.json b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/data.json deleted file mode 100644 index 520fa6f..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2", - "3" - ], - "v2": [ - "a", - "b" - ] - }, - { - "id": "b", - "v1": [ - "4", - "5", - "6" - ], - "v2": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/default.nq deleted file mode 100644 index 90196c4..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/default.nq +++ /dev/null @@ -1,18 +0,0 @@ -_:n1d9b8ef217cb44f299a062d746116deab1 _:n1d9b8ef217cb44f299a062d746116deab2 . -_:n1d9b8ef217cb44f299a062d746116deab5 "b" . -_:n1d9b8ef217cb44f299a062d746116deab4 _:n1d9b8ef217cb44f299a062d746116deab5 . -_:n1d9b8ef217cb44f299a062d746116deab3 _:n1d9b8ef217cb44f299a062d746116deab4 . -_:n1d9b8ef217cb44f299a062d746116deab7 "5" . -_:n1d9b8ef217cb44f299a062d746116deab2 "2" . -_:n1d9b8ef217cb44f299a062d746116deab8 "6" . -_:n1d9b8ef217cb44f299a062d746116deab8 . -_:n1d9b8ef217cb44f299a062d746116deab3 "3" . -_:n1d9b8ef217cb44f299a062d746116deab4 "a" . -_:n1d9b8ef217cb44f299a062d746116deab5 . -_:n1d9b8ef217cb44f299a062d746116deab2 _:n1d9b8ef217cb44f299a062d746116deab3 . -_:n1d9b8ef217cb44f299a062d746116deab1 "1" . - _:n1d9b8ef217cb44f299a062d746116deab1 . - _:n1d9b8ef217cb44f299a062d746116deab6 . -_:n1d9b8ef217cb44f299a062d746116deab7 _:n1d9b8ef217cb44f299a062d746116deab8 . -_:n1d9b8ef217cb44f299a062d746116deab6 _:n1d9b8ef217cb44f299a062d746116deab7 . -_:n1d9b8ef217cb44f299a062d746116deab6 "4" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl deleted file mode 100644 index e2789c9..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-App2/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/README.md deleted file mode 100644 index b902b51..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/README.md +++ /dev/null @@ -1,82 +0,0 @@ -## RMLTC-CC-0005-Car1 - -**Title**: Cartesian product of values from multiple term maps of a gather map. - -**Description**: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - rml:strategy rml:cartesianProduct ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:nfc398e5692654ca98dfb3fb5432d277cb1 . -_:nfc398e5692654ca98dfb3fb5432d277cb1 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb1 _:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 "a" . - - _:nfc398e5692654ca98dfb3fb5432d277cb3 . -_:nfc398e5692654ca98dfb3fb5432d277cb3 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb3 _:nfc398e5692654ca98dfb3fb5432d277cb4 . -_:nfc398e5692654ca98dfb3fb5432d277cb4 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb4 . - - _:nfc398e5692654ca98dfb3fb5432d277cb5 . -_:nfc398e5692654ca98dfb3fb5432d277cb5 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb5 _:nfc398e5692654ca98dfb3fb5432d277cb6 . -_:nfc398e5692654ca98dfb3fb5432d277cb6 "a" . -_:nfc398e5692654ca98dfb3fb5432d277cb6 . - - _:nfc398e5692654ca98dfb3fb5432d277cb7 . -_:nfc398e5692654ca98dfb3fb5432d277cb7 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb7 _:nfc398e5692654ca98dfb3fb5432d277cb8 . -_:nfc398e5692654ca98dfb3fb5432d277cb8 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb8 . - - _:nfc398e5692654ca98dfb3fb5432d277cb9 . -_:nfc398e5692654ca98dfb3fb5432d277cb9 "3" . -_:nfc398e5692654ca98dfb3fb5432d277cb9 _:nfc398e5692654ca98dfb3fb5432d277cb10 . -_:nfc398e5692654ca98dfb3fb5432d277cb10 "c" . -_:nfc398e5692654ca98dfb3fb5432d277cb10 . - - _:nfc398e5692654ca98dfb3fb5432d277cb11 . -_:nfc398e5692654ca98dfb3fb5432d277cb11 "4" . -_:nfc398e5692654ca98dfb3fb5432d277cb11 _:nfc398e5692654ca98dfb3fb5432d277cb12 . -_:nfc398e5692654ca98dfb3fb5432d277cb12 "c" . -_:nfc398e5692654ca98dfb3fb5432d277cb12 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/data.json b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/data.json deleted file mode 100644 index f0feba6..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ], - "v2": [ - "a", - "b" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ], - "v2": [ - "c" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/default.nq deleted file mode 100644 index 08d0c5e..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/default.nq +++ /dev/null @@ -1,35 +0,0 @@ - _:nfc398e5692654ca98dfb3fb5432d277cb1 . -_:nfc398e5692654ca98dfb3fb5432d277cb1 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb1 _:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 "a" . - - _:nfc398e5692654ca98dfb3fb5432d277cb3 . -_:nfc398e5692654ca98dfb3fb5432d277cb3 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb3 _:nfc398e5692654ca98dfb3fb5432d277cb4 . -_:nfc398e5692654ca98dfb3fb5432d277cb4 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb4 . - - _:nfc398e5692654ca98dfb3fb5432d277cb5 . -_:nfc398e5692654ca98dfb3fb5432d277cb5 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb5 _:nfc398e5692654ca98dfb3fb5432d277cb6 . -_:nfc398e5692654ca98dfb3fb5432d277cb6 "a" . -_:nfc398e5692654ca98dfb3fb5432d277cb6 . - - _:nfc398e5692654ca98dfb3fb5432d277cb7 . -_:nfc398e5692654ca98dfb3fb5432d277cb7 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb7 _:nfc398e5692654ca98dfb3fb5432d277cb8 . -_:nfc398e5692654ca98dfb3fb5432d277cb8 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb8 . - - _:nfc398e5692654ca98dfb3fb5432d277cb9 . -_:nfc398e5692654ca98dfb3fb5432d277cb9 "3" . -_:nfc398e5692654ca98dfb3fb5432d277cb9 _:nfc398e5692654ca98dfb3fb5432d277cb10 . -_:nfc398e5692654ca98dfb3fb5432d277cb10 "c" . -_:nfc398e5692654ca98dfb3fb5432d277cb10 . - - _:nfc398e5692654ca98dfb3fb5432d277cb11 . -_:nfc398e5692654ca98dfb3fb5432d277cb11 "4" . -_:nfc398e5692654ca98dfb3fb5432d277cb11 _:nfc398e5692654ca98dfb3fb5432d277cb12 . -_:nfc398e5692654ca98dfb3fb5432d277cb12 "c" . -_:nfc398e5692654ca98dfb3fb5432d277cb12 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl deleted file mode 100644 index 6d6f2bd..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car1/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - rml:strategy rml:cartesianProduct ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/README.md deleted file mode 100644 index b9b80a2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/README.md +++ /dev/null @@ -1,70 +0,0 @@ -## RMLTC-CC-0005-Car2 - -**Title**: Cartesian product of values from multiple term maps of a gather map. - -**Description**: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - rml:strategy rml:cartesianProduct ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:nfc398e5692654ca98dfb3fb5432d277cb1 . -_:nfc398e5692654ca98dfb3fb5432d277cb1 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb1 _:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 "a" . - - _:nfc398e5692654ca98dfb3fb5432d277cb3 . -_:nfc398e5692654ca98dfb3fb5432d277cb3 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb3 _:nfc398e5692654ca98dfb3fb5432d277cb4 . -_:nfc398e5692654ca98dfb3fb5432d277cb4 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb4 . - - _:nfc398e5692654ca98dfb3fb5432d277cb5 . -_:nfc398e5692654ca98dfb3fb5432d277cb5 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb5 _:nfc398e5692654ca98dfb3fb5432d277cb6 . -_:nfc398e5692654ca98dfb3fb5432d277cb6 "a" . -_:nfc398e5692654ca98dfb3fb5432d277cb6 . - - _:nfc398e5692654ca98dfb3fb5432d277cb7 . -_:nfc398e5692654ca98dfb3fb5432d277cb7 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb7 _:nfc398e5692654ca98dfb3fb5432d277cb8 . -_:nfc398e5692654ca98dfb3fb5432d277cb8 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb8 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/data.json b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/data.json deleted file mode 100644 index 0f90f8b..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/data.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ], - "v2": [ - "a", - "b" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ], - "v2": [] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/default.nq deleted file mode 100644 index b13c08d..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/default.nq +++ /dev/null @@ -1,23 +0,0 @@ - _:nfc398e5692654ca98dfb3fb5432d277cb1 . -_:nfc398e5692654ca98dfb3fb5432d277cb1 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb1 _:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 . -_:nfc398e5692654ca98dfb3fb5432d277cb2 "a" . - - _:nfc398e5692654ca98dfb3fb5432d277cb3 . -_:nfc398e5692654ca98dfb3fb5432d277cb3 "1" . -_:nfc398e5692654ca98dfb3fb5432d277cb3 _:nfc398e5692654ca98dfb3fb5432d277cb4 . -_:nfc398e5692654ca98dfb3fb5432d277cb4 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb4 . - - _:nfc398e5692654ca98dfb3fb5432d277cb5 . -_:nfc398e5692654ca98dfb3fb5432d277cb5 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb5 _:nfc398e5692654ca98dfb3fb5432d277cb6 . -_:nfc398e5692654ca98dfb3fb5432d277cb6 "a" . -_:nfc398e5692654ca98dfb3fb5432d277cb6 . - - _:nfc398e5692654ca98dfb3fb5432d277cb7 . -_:nfc398e5692654ca98dfb3fb5432d277cb7 "2" . -_:nfc398e5692654ca98dfb3fb5432d277cb7 _:nfc398e5692654ca98dfb3fb5432d277cb8 . -_:nfc398e5692654ca98dfb3fb5432d277cb8 "b" . -_:nfc398e5692654ca98dfb3fb5432d277cb8 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl deleted file mode 100644 index 6d6f2bd..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0005-Car2/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - rml:strategy rml:cartesianProduct ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/README.md deleted file mode 100644 index 4fc561d..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/README.md +++ /dev/null @@ -1,63 +0,0 @@ -## RMLTC-CC-0006-IT0 - -**Title**: Gather values across iterations to create a collection. - -**Description**: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:n9d785cd672d3484cb5d9fd831e6dfc07b1 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b1 "1" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b1 _:n9d785cd672d3484cb5d9fd831e6dfc07b2 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b2 "2" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b2 . - - _:n9d785cd672d3484cb5d9fd831e6dfc07b5 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b5 "3" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b5 _:n9d785cd672d3484cb5d9fd831e6dfc07b6 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b6 "4" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b6 . - - _:n9d785cd672d3484cb5d9fd831e6dfc07b3 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b3 "5" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b3 _:n9d785cd672d3484cb5d9fd831e6dfc07b4 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b4 "6" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b4 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/data.json deleted file mode 100644 index a17afe2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ] - }, - { - "id": "a", - "v1": [ - "5", - "6" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/default.nq deleted file mode 100644 index 0a2aebe..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/default.nq +++ /dev/null @@ -1,17 +0,0 @@ - _:n9d785cd672d3484cb5d9fd831e6dfc07b1 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b1 "1" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b1 _:n9d785cd672d3484cb5d9fd831e6dfc07b2 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b2 "2" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b2 . - - _:n9d785cd672d3484cb5d9fd831e6dfc07b5 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b5 "3" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b5 _:n9d785cd672d3484cb5d9fd831e6dfc07b6 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b6 "4" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b6 . - - _:n9d785cd672d3484cb5d9fd831e6dfc07b3 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b3 "5" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b3 _:n9d785cd672d3484cb5d9fd831e6dfc07b4 . -_:n9d785cd672d3484cb5d9fd831e6dfc07b4 "6" . -_:n9d785cd672d3484cb5d9fd831e6dfc07b4 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl deleted file mode 100644 index 91bccaa..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT0/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/README.md deleted file mode 100644 index e5248c6..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/README.md +++ /dev/null @@ -1,63 +0,0 @@ -## RMLTC-CC-0006-IT1 - -**Title**: Gather values across iterations to create a collection. - -**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - . - "1" . - _:nab8f496caee443c5ac19ce3a109f4b22b1 . -_:nab8f496caee443c5ac19ce3a109f4b22b1 "2" . -_:nab8f496caee443c5ac19ce3a109f4b22b1 _:nab8f496caee443c5ac19ce3a109f4b22b2 . -_:nab8f496caee443c5ac19ce3a109f4b22b2 "5" . -_:nab8f496caee443c5ac19ce3a109f4b22b2 _:nab8f496caee443c5ac19ce3a109f4b22b3 . -_:nab8f496caee443c5ac19ce3a109f4b22b3 "6" . -_:nab8f496caee443c5ac19ce3a109f4b22b3 . - - . - "3" . - _:nab8f496caee443c5ac19ce3a109f4b22b4 . -_:nab8f496caee443c5ac19ce3a109f4b22b4 "4" . -_:nab8f496caee443c5ac19ce3a109f4b22b4 . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/data.json deleted file mode 100644 index a17afe2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ] - }, - { - "id": "a", - "v1": [ - "5", - "6" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/default.nq deleted file mode 100644 index 4050037..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/default.nq +++ /dev/null @@ -1,15 +0,0 @@ - . - "1" . - _:nab8f496caee443c5ac19ce3a109f4b22b1 . -_:nab8f496caee443c5ac19ce3a109f4b22b1 "2" . -_:nab8f496caee443c5ac19ce3a109f4b22b1 _:nab8f496caee443c5ac19ce3a109f4b22b2 . -_:nab8f496caee443c5ac19ce3a109f4b22b2 "5" . -_:nab8f496caee443c5ac19ce3a109f4b22b2 _:nab8f496caee443c5ac19ce3a109f4b22b3 . -_:nab8f496caee443c5ac19ce3a109f4b22b3 "6" . -_:nab8f496caee443c5ac19ce3a109f4b22b3 . - - . - "3" . - _:nab8f496caee443c5ac19ce3a109f4b22b4 . -_:nab8f496caee443c5ac19ce3a109f4b22b4 "4" . -_:nab8f496caee443c5ac19ce3a109f4b22b4 . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl deleted file mode 100644 index 6bb8841..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT1/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/README.md deleted file mode 100644 index a35f394..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/README.md +++ /dev/null @@ -1,73 +0,0 @@ -## RMLTC-CC-0006-IT2 - -**Title**: Gather values across iterations to create a collection. - -**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - . - "1" . - _:n0cbb21ce98464358963007f95dc35c0ab1 . -_:n0cbb21ce98464358963007f95dc35c0ab1 "2" . -_:n0cbb21ce98464358963007f95dc35c0ab1 _:n0cbb21ce98464358963007f95dc35c0ab2 . -_:n0cbb21ce98464358963007f95dc35c0ab2 "a" . -_:n0cbb21ce98464358963007f95dc35c0ab2 _:n0cbb21ce98464358963007f95dc35c0ab3 . -_:n0cbb21ce98464358963007f95dc35c0ab3 "b" . -_:n0cbb21ce98464358963007f95dc35c0ab3 _:n0cbb21ce98464358963007f95dc35c0ab4 . -_:n0cbb21ce98464358963007f95dc35c0ab4 "5" . -_:n0cbb21ce98464358963007f95dc35c0ab4 _:n0cbb21ce98464358963007f95dc35c0ab5 . -_:n0cbb21ce98464358963007f95dc35c0ab5 "6" . -_:n0cbb21ce98464358963007f95dc35c0ab5 _:n0cbb21ce98464358963007f95dc35c0ab6 . -_:n0cbb21ce98464358963007f95dc35c0ab6 "d" . -_:n0cbb21ce98464358963007f95dc35c0ab6 _:n0cbb21ce98464358963007f95dc35c0ab7 . -_:n0cbb21ce98464358963007f95dc35c0ab7 "e" . -_:n0cbb21ce98464358963007f95dc35c0ab7 . - - . - "3" . - _:n0cbb21ce98464358963007f95dc35c0ab8 . -_:n0cbb21ce98464358963007f95dc35c0ab8 "4" . -_:n0cbb21ce98464358963007f95dc35c0ab8 _:n0cbb21ce98464358963007f95dc35c0ab9 . -_:n0cbb21ce98464358963007f95dc35c0ab9 "c" . -_:n0cbb21ce98464358963007f95dc35c0ab9 . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/data.json deleted file mode 100644 index ab3d8c5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/data.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ], - "v2": [ - "a", - "b" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ], - "v2": [ - "c" - ] - }, - { - "id": "a", - "v1": [ - "5", - "6" - ], - "v2": [ - "d", - "e" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/default.nq deleted file mode 100644 index d66af6f..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/default.nq +++ /dev/null @@ -1,25 +0,0 @@ - . - "1" . - _:n0cbb21ce98464358963007f95dc35c0ab1 . -_:n0cbb21ce98464358963007f95dc35c0ab1 "2" . -_:n0cbb21ce98464358963007f95dc35c0ab1 _:n0cbb21ce98464358963007f95dc35c0ab2 . -_:n0cbb21ce98464358963007f95dc35c0ab2 "a" . -_:n0cbb21ce98464358963007f95dc35c0ab2 _:n0cbb21ce98464358963007f95dc35c0ab3 . -_:n0cbb21ce98464358963007f95dc35c0ab3 "b" . -_:n0cbb21ce98464358963007f95dc35c0ab3 _:n0cbb21ce98464358963007f95dc35c0ab4 . -_:n0cbb21ce98464358963007f95dc35c0ab4 "5" . -_:n0cbb21ce98464358963007f95dc35c0ab4 _:n0cbb21ce98464358963007f95dc35c0ab5 . -_:n0cbb21ce98464358963007f95dc35c0ab5 "6" . -_:n0cbb21ce98464358963007f95dc35c0ab5 _:n0cbb21ce98464358963007f95dc35c0ab6 . -_:n0cbb21ce98464358963007f95dc35c0ab6 "d" . -_:n0cbb21ce98464358963007f95dc35c0ab6 _:n0cbb21ce98464358963007f95dc35c0ab7 . -_:n0cbb21ce98464358963007f95dc35c0ab7 "e" . -_:n0cbb21ce98464358963007f95dc35c0ab7 . - - . - "3" . - _:n0cbb21ce98464358963007f95dc35c0ab8 . -_:n0cbb21ce98464358963007f95dc35c0ab8 "4" . -_:n0cbb21ce98464358963007f95dc35c0ab8 _:n0cbb21ce98464358963007f95dc35c0ab9 . -_:n0cbb21ce98464358963007f95dc35c0ab9 "c" . -_:n0cbb21ce98464358963007f95dc35c0ab9 . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl deleted file mode 100644 index 23251ff..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT2/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/README.md deleted file mode 100644 index ed86d92..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/README.md +++ /dev/null @@ -1,60 +0,0 @@ -## RMLTC-CC-0006-IT3 - -**Title**: Gather values across iterations to create a container. - -**Description**: When no template, constant, or reference is given to a gather map, then each iteration yields a different container. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:a . -_:a . -_:a "1" . -_:a "2" . - - _:b . -_:b . -_:b "3" . -_:b "4" . - - _:c . -_:c . -_:c "5" . -_:c "6" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/data.json deleted file mode 100644 index a17afe2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ] - }, - { - "id": "a", - "v1": [ - "5", - "6" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/default.nq deleted file mode 100644 index 4141428..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/default.nq +++ /dev/null @@ -1,14 +0,0 @@ - _:a . -_:a . -_:a "1" . -_:a "2" . - - _:b . -_:b . -_:b "3" . -_:b "4" . - - _:c . -_:c . -_:c "5" . -_:c "6" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/mapping.ttl deleted file mode 100644 index d88fe4d..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT3/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/README.md deleted file mode 100644 index f5a8d82..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/README.md +++ /dev/null @@ -1,58 +0,0 @@ -## RMLTC-CC-0006-IT4 - -**Title**: Gather values across iterations to create a container. - -**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - . - . - "1" . - "2" . - "5" . - "6" . - - . - . - "3" . - "4" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/data.json deleted file mode 100644 index a17afe2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ] - }, - { - "id": "a", - "v1": [ - "5", - "6" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/default.nq deleted file mode 100644 index 008e8e5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/default.nq +++ /dev/null @@ -1,11 +0,0 @@ - . - . - "1" . - "2" . - "5" . - "6" . - - . - . - "3" . - "4" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/mapping.ttl deleted file mode 100644 index 4adddc1..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT4/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/README.md b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/README.md deleted file mode 100644 index 6c3b43d..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/README.md +++ /dev/null @@ -1,63 +0,0 @@ -## RMLTC-CC-0006-IT5 - -**Title**: Gather values across iterations to create a container. - -**Description**: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - . - . - "1" . - "2" . - "a" . - "b" . - "5" . - "6" . - "d" . - "e" . - - . - . - "3" . - "4" . - "c" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/data.json b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/data.json deleted file mode 100644 index ab3d8c5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/data.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ], - "v2": [ - "a", - "b" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ], - "v2": [ - "c" - ] - }, - { - "id": "a", - "v1": [ - "5", - "6" - ], - "v2": [ - "d", - "e" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/default.nq deleted file mode 100644 index 19c6f4c..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/default.nq +++ /dev/null @@ -1,16 +0,0 @@ - . - . - "1" . - "2" . - "a" . - "b" . - "5" . - "6" . - "d" . - "e" . - - . - . - "3" . - "4" . - "c" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/mapping.ttl deleted file mode 100644 index 071a777..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0006-IT5/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:template "c/{$.id}" ; - rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/README.md b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/README.md deleted file mode 100644 index 7d4f7b5..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/README.md +++ /dev/null @@ -1,85 +0,0 @@ -## RMLTC-CC-0007-NES - -**Title**: Nested gather maps - -**Description**: Testing whether nested gather maps are created. The mapping should generate a list of bags. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( - [ - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] - [ - rml:gather ( [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] - ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:nab9af1206e584ab2afd457e8a605872cb1 . -_:nab9af1206e584ab2afd457e8a605872cb1 "1" . -_:nab9af1206e584ab2afd457e8a605872cb1 "2" . - -_:nab9af1206e584ab2afd457e8a605872cb2 . -_:nab9af1206e584ab2afd457e8a605872cb2 "a" . -_:nab9af1206e584ab2afd457e8a605872cb2 "b" . - -_:nab9af1206e584ab2afd457e8a605872cb5 . -_:nab9af1206e584ab2afd457e8a605872cb5 "3" . -_:nab9af1206e584ab2afd457e8a605872cb5 "4" . - -_:nab9af1206e584ab2afd457e8a605872cb6 . -_:nab9af1206e584ab2afd457e8a605872cb6 "c" . - - _:nab9af1206e584ab2afd457e8a605872cb3 . -_:nab9af1206e584ab2afd457e8a605872cb3 _:nab9af1206e584ab2afd457e8a605872cb1 . -_:nab9af1206e584ab2afd457e8a605872cb3 _:nab9af1206e584ab2afd457e8a605872cb4 . - -_:nab9af1206e584ab2afd457e8a605872cb4 _:nab9af1206e584ab2afd457e8a605872cb2 . -_:nab9af1206e584ab2afd457e8a605872cb4 . - - _:nab9af1206e584ab2afd457e8a605872cb7 . -_:nab9af1206e584ab2afd457e8a605872cb7 _:nab9af1206e584ab2afd457e8a605872cb5 . -_:nab9af1206e584ab2afd457e8a605872cb7 _:nab9af1206e584ab2afd457e8a605872cb8 . - -_:nab9af1206e584ab2afd457e8a605872cb8 _:nab9af1206e584ab2afd457e8a605872cb6 . -_:nab9af1206e584ab2afd457e8a605872cb8 . - - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/data.json b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/data.json deleted file mode 100644 index f0feba6..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "v1": [ - "1", - "2" - ], - "v2": [ - "a", - "b" - ] - }, - { - "id": "b", - "v1": [ - "3", - "4" - ], - "v2": [ - "c" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/default.nq deleted file mode 100644 index cdfac16..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/default.nq +++ /dev/null @@ -1,29 +0,0 @@ -_:nab9af1206e584ab2afd457e8a605872cb1 . -_:nab9af1206e584ab2afd457e8a605872cb1 "1" . -_:nab9af1206e584ab2afd457e8a605872cb1 "2" . - -_:nab9af1206e584ab2afd457e8a605872cb2 . -_:nab9af1206e584ab2afd457e8a605872cb2 "a" . -_:nab9af1206e584ab2afd457e8a605872cb2 "b" . - -_:nab9af1206e584ab2afd457e8a605872cb5 . -_:nab9af1206e584ab2afd457e8a605872cb5 "3" . -_:nab9af1206e584ab2afd457e8a605872cb5 "4" . - -_:nab9af1206e584ab2afd457e8a605872cb6 . -_:nab9af1206e584ab2afd457e8a605872cb6 "c" . - - _:nab9af1206e584ab2afd457e8a605872cb3 . -_:nab9af1206e584ab2afd457e8a605872cb3 _:nab9af1206e584ab2afd457e8a605872cb1 . -_:nab9af1206e584ab2afd457e8a605872cb3 _:nab9af1206e584ab2afd457e8a605872cb4 . - -_:nab9af1206e584ab2afd457e8a605872cb4 _:nab9af1206e584ab2afd457e8a605872cb2 . -_:nab9af1206e584ab2afd457e8a605872cb4 . - - _:nab9af1206e584ab2afd457e8a605872cb7 . -_:nab9af1206e584ab2afd457e8a605872cb7 _:nab9af1206e584ab2afd457e8a605872cb5 . -_:nab9af1206e584ab2afd457e8a605872cb7 _:nab9af1206e584ab2afd457e8a605872cb8 . - -_:nab9af1206e584ab2afd457e8a605872cb8 _:nab9af1206e584ab2afd457e8a605872cb6 . -_:nab9af1206e584ab2afd457e8a605872cb8 . - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl deleted file mode 100644 index 8423745..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0007-NES/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( - [ - rml:gather ( [ rml:reference "$.v1.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] - [ - rml:gather ( [ rml:reference "$.v2.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] - ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/README.md b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/README.md deleted file mode 100644 index 5f40015..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/README.md +++ /dev/null @@ -1,61 +0,0 @@ -## RMLTC-CC-0008-ROMa - -**Title**: Elements via reference object-map. - -**Description**: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json) - -**Mapping** -``` -@prefix ex: . -@prefix rml: . -@prefix rdf: . - -_:b273446 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "student.csv" . - - a rml:TriplesMap ; - rml:logicalSource [ a rml:LogicalSource ; - rml:referenceFormulation rml:CSV ; - rml:source _:b273446 ] ; - - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" ; rml:termType rml:BlankNode ; - rml:gather ( - [ - rml:parentTriplesMap ; - rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ; - ] - ) ; - rml:gatherAs rdf:List; - ] ; - rml:predicate ex:sameSportAs - ] ; - - rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] . - -``` - -**Output** -``` -_:genid1 . -_:genid1 _:genid2 . -_:genid2 . -_:genid2 . - _:genid1 . -_:genid3 . -_:genid3 _:genid4 . -_:genid4 . -_:genid4 . - _:genid3 . -_:genid5 . -_:genid5 . - _:genid5 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/default.nq deleted file mode 100644 index 347e6c8..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/default.nq +++ /dev/null @@ -1,13 +0,0 @@ -_:genid1 . -_:genid1 _:genid2 . -_:genid2 . -_:genid2 . - _:genid1 . -_:genid3 . -_:genid3 _:genid4 . -_:genid4 . -_:genid4 . - _:genid3 . -_:genid5 . -_:genid5 . - _:genid5 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl deleted file mode 100644 index fb097e8..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix rml: . -@prefix rdf: . - -_:b273446 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "student.csv" . - - a rml:TriplesMap ; - rml:logicalSource [ a rml:LogicalSource ; - rml:referenceFormulation rml:CSV ; - rml:source _:b273446 ] ; - - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" ; rml:termType rml:BlankNode ; - rml:gather ( - [ - rml:parentTriplesMap ; - rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ; - ] - ) ; - rml:gatherAs rdf:List; - ] ; - rml:predicate ex:sameSportAs - ] ; - - rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/student.csv b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/student.csv deleted file mode 100644 index 8a96794..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMa/student.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID,Name,Sport -10,Venus Williams,Tennis -20,Serena Williams,Tennis -30,Loena Hendrickx,Figure skating diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/README.md b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/README.md deleted file mode 100644 index 8b5690a..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## RMLTC-CC-0008-ROMb - -**Title**: Elements via reference object-map with default join condition - -**Description**: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json) - -**Mapping** -``` -@prefix ex: . -@prefix rml: . -@prefix rdf: . - -_:b273446 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "student.csv" . - - a rml:TriplesMap ; - rml:logicalSource [ a rml:LogicalSource ; - rml:referenceFormulation rml:CSV ; - rml:source _:b273446 ] ; - - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" ; rml:termType rml:BlankNode ; - rml:gather ( - [ - rml:parentTriplesMap ; - ] - ) ; - rml:gatherAs rdf:List; - ] ; - rml:predicate ex:sameSportAs - ] ; - - rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] . - - -``` - -**Output** -``` -_:genid1 . -_:genid1 . - _:genid1 . -_:genid2 . -_:genid2 . - _:genid2 . -_:genid3 . -_:genid3 . - _:genid3 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/default.nq deleted file mode 100644 index 8c6f63e..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/default.nq +++ /dev/null @@ -1,9 +0,0 @@ -_:genid1 . -_:genid1 . - _:genid1 . -_:genid2 . -_:genid2 . - _:genid2 . -_:genid3 . -_:genid3 . - _:genid3 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl deleted file mode 100644 index e6707b7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix rml: . -@prefix rdf: . - -_:b273446 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "student.csv" . - - a rml:TriplesMap ; - rml:logicalSource [ a rml:LogicalSource ; - rml:referenceFormulation rml:CSV ; - rml:source _:b273446 ] ; - - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "ID" ; rml:termType rml:BlankNode ; - rml:gather ( - [ - rml:parentTriplesMap ; - ] - ) ; - rml:gatherAs rdf:List; - ] ; - rml:predicate ex:sameSportAs - ] ; - - rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] . - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/student.csv b/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/student.csv deleted file mode 100644 index 8a96794..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0008-ROMb/student.csv +++ /dev/null @@ -1,4 +0,0 @@ -ID,Name,Sport -10,Venus Williams,Tennis -20,Serena Williams,Tennis -30,Loena Hendrickx,Figure skating diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/README.md b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/README.md deleted file mode 100644 index 733ae3e..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/README.md +++ /dev/null @@ -1,61 +0,0 @@ -## RMLTC-CC-0009-DUP-Bag - -**Title**: Gather duplicate values in an RDF Bag - -**Description**: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "2" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b3 . - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "2" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/data.json b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/data.json deleted file mode 100644 index cad6577..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "1", - "1" - ] - }, - { - "id": "b", - "values": [ - "2", - "2", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/default.nq deleted file mode 100644 index 572b5c8..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/default.nq +++ /dev/null @@ -1,15 +0,0 @@ -_:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "2" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "9" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b2 . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . - _:nc808fbd2e11a4baa939c61c8210b5909b3 . - _:nc808fbd2e11a4baa939c61c8210b5909b1 . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "2" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "7" . -_:nc808fbd2e11a4baa939c61c8210b5909b2 "6" . -_:nc808fbd2e11a4baa939c61c8210b5909b1 "1" . -_:nc808fbd2e11a4baa939c61c8210b5909b3 "8" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl deleted file mode 100644 index cefcb53..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-Bag/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:Bag ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/README.md b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/README.md deleted file mode 100644 index 4b44f01..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/README.md +++ /dev/null @@ -1,70 +0,0 @@ -## RMLTC-CC-0009-DUP-List - -**Title**: Gather duplicate values in an RDF List - -**Description**: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` - _:n988e0f11d19c486fa3b3255f94c9b3bab1 . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 _:n988e0f11d19c486fa3b3255f94c9b3bab2 . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 _:n988e0f11d19c486fa3b3255f94c9b3bab3 . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab4 . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 "2" . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 _:n988e0f11d19c486fa3b3255f94c9b3bab5 . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 "2" . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 _:n988e0f11d19c486fa3b3255f94c9b3bab6 . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 "6" . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab7 . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 "7" . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 _:n988e0f11d19c486fa3b3255f94c9b3bab8 . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 "8" . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 _:n988e0f11d19c486fa3b3255f94c9b3bab9 . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 "9" . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 . - -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/data.json b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/data.json deleted file mode 100644 index cad6577..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/data.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "a", - "values": [ - "1", - "1", - "1" - ] - }, - { - "id": "b", - "values": [ - "2", - "2", - "6" - ] - }, - { - "id": "c", - "values": [ - "7", - "8", - "9" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/default.nq deleted file mode 100644 index 9a73f63..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/default.nq +++ /dev/null @@ -1,23 +0,0 @@ - _:n988e0f11d19c486fa3b3255f94c9b3bab1 . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab1 _:n988e0f11d19c486fa3b3255f94c9b3bab2 . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab2 _:n988e0f11d19c486fa3b3255f94c9b3bab3 . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 "1" . -_:n988e0f11d19c486fa3b3255f94c9b3bab3 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab4 . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 "2" . -_:n988e0f11d19c486fa3b3255f94c9b3bab4 _:n988e0f11d19c486fa3b3255f94c9b3bab5 . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 "2" . -_:n988e0f11d19c486fa3b3255f94c9b3bab5 _:n988e0f11d19c486fa3b3255f94c9b3bab6 . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 "6" . -_:n988e0f11d19c486fa3b3255f94c9b3bab6 . - - _:n988e0f11d19c486fa3b3255f94c9b3bab7 . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 "7" . -_:n988e0f11d19c486fa3b3255f94c9b3bab7 _:n988e0f11d19c486fa3b3255f94c9b3bab8 . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 "8" . -_:n988e0f11d19c486fa3b3255f94c9b3bab8 _:n988e0f11d19c486fa3b3255f94c9b3bab9 . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 "9" . -_:n988e0f11d19c486fa3b3255f94c9b3bab9 . diff --git a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl deleted file mode 100644 index 0e837b7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0009-DUP-List/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/README.md b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/README.md deleted file mode 100644 index 870ad33..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## RMLTC-CC-0010-Lista - -**Title**: Combining graph maps and gather maps (graph map has a template and gather map does not) - -**Description**: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:graphMap [ rml:template "g/{$.graph}" ; ] ; - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:genid1 "1" . -_:genid1 . -_:genid2 "3" . -_:genid2 . - _:genid1 . - _:genid2 . - -_:genidx1 "2" . -_:genidx1 . - _:genidx1 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/data.json b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/data.json deleted file mode 100644 index f85e5b7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "graph": "1", - "values": [ - "1" - ] - }, - { - "id": "a", - "graph": "2", - "values": [ - "2" - ] - }, - { - "id": "a", - "graph": "1", - "values": [ - "3" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/default.nq deleted file mode 100644 index ac2b7e3..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/default.nq +++ /dev/null @@ -1,10 +0,0 @@ -_:genid1 "1" . -_:genid1 . -_:genid2 "3" . -_:genid2 . - _:genid1 . - _:genid2 . - -_:genidx1 "2" . -_:genidx1 . - _:genidx1 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/mapping.ttl deleted file mode 100644 index 6eeb8b9..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Lista/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:graphMap [ rml:template "g/{$.graph}" ; ] ; - rml:predicate ex:with ; - rml:objectMap [ - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/README.md b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/README.md deleted file mode 100644 index 0859ca2..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## RMLTC-CC-0010-Listb - -**Title**: Combining graph maps and gather maps (both graph map and gather map have a template) - -**Description**: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates. - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json](http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:graphMap [ rml:template "g/{$.graph}" ; ] ; - rml:predicate ex:with ; - rml:objectMap [ - rml:template "l/{$.id}" ; rml:termType rml:BlankNode ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . -``` - -**Output** -``` -_:genid1 "1" . -_:genid1 _:genid2 . -_:genid2 "3" . -_:genid2 . - _:genid1 . - -_:genidx1 "2" . -_:genidx1 . - _:genidx1 . -``` - diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/data.json b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/data.json deleted file mode 100644 index f85e5b7..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/data.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "id": "a", - "graph": "1", - "values": [ - "1" - ] - }, - { - "id": "a", - "graph": "2", - "values": [ - "2" - ] - }, - { - "id": "a", - "graph": "1", - "values": [ - "3" - ] - } -] \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/default.nq b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/default.nq deleted file mode 100644 index 027db1b..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/default.nq +++ /dev/null @@ -1,9 +0,0 @@ -_:genid1 "1" . -_:genid1 _:genid2 . -_:genid2 "3" . -_:genid2 . - _:genid1 . - -_:genidx1 "2" . -_:genidx1 . - _:genidx1 . \ No newline at end of file diff --git a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl b/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl deleted file mode 100644 index 0f74429..0000000 --- a/src/test/resources/rml-cc/RMLTC-CC-0010-Listb/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:source _:b738439 ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.*" ; - ] ; - - rml:subjectMap [ - rml:template "e/{$.id}" ; - ] ; - - rml:predicateObjectMap [ - rml:graphMap [ rml:template "g/{$.graph}" ; ] ; - rml:predicate ex:with ; - rml:objectMap [ - rml:template "l/{$.id}" ; rml:termType rml:BlankNode ; - rml:gather ( [ rml:reference "$.values.*" ; ] ) ; - rml:gatherAs rdf:List ; - ] ; - ] ; -. - -_:b738439 a rml:RelativePathSource ; - rml:root rml:MappingDirectory ; - rml:path "data.json" . \ No newline at end of file diff --git a/src/test/resources/rml-cc/config.js b/src/test/resources/rml-cc/config.js deleted file mode 100644 index dd32f38..0000000 --- a/src/test/resources/rml-cc/config.js +++ /dev/null @@ -1,72 +0,0 @@ -async function loadTurtle() { - //this is the function you call in 'preProcess', to load the highlighter - const worker = await new Promise(resolve => { - require(["core/worker"], ({ worker }) => resolve(worker)); - }); - const action = "highlight-load-lang"; - const langURL = - "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; - const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded - const lang = "turtle"; // this is the class you use to identify the language - worker.postMessage({ action, langURL, propName, lang }); - return new Promise(resolve => { - worker.addEventListener("message", function listener({ data }) { - const { action: responseAction, lang: responseLang } = data; - if (responseAction === action && responseLang === lang) { - worker.removeEventListener("message", listener); - resolve(); - } - }); - }); -} - -var respecConfig = { - // check https://respec.org/docs/ for the meaning of these keys - preProcess: [loadTurtle], - authors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - edDraftURI: "https://w3id.org/rml/cc/test-cases/", - editors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - formerEditors: [ - ], - github: "https://github.com/kg-construct/rml-cc", - license: "w3c-software-doc", - localBiblio: { - "RML-Core": { - title: "RML-Core", - href: "https://w3id.org/rml/core/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "07 August 2024", - }, - "RML-IO": { - title: "RML-IO", - href: "https://w3id.org/rml/io/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "12 March 2024", - }, - }, - otherLinks: [], - shortName: "RML-CC-Testcases", - specStatus: "CG-DRAFT", - // W3C config - copyrightStart: "2024", - doJsonLd: true, - group: "kg-construct", -}; diff --git a/src/test/resources/rml-cc/descriptions.csv b/src/test/resources/rml-cc/descriptions.csv deleted file mode 100644 index df4bf68..0000000 --- a/src/test/resources/rml-cc/descriptions.csv +++ /dev/null @@ -1,36 +0,0 @@ -ID,title,purpose,part of spec,data format,ref. formulation,error expected?,input file 1,input file 2,input file 3,comment -RMLTC-CC-0001-List,Generate a rdf:List as an object,Tests if a rdf:List is generated as an object,,JSON,JSON,no,data.json,,, -RMLTC-CC-0001-Bag,Generate a rdf:Bag as an object,Tests if a rdf:Bag is generated as an object,,JSON,JSON,no,data.json,,, -RMLTC-CC-0001-Seq,Generate a rdf:Seq as an object,Tests if a rdf:Seq is generated as an object,,JSON,JSON,no,data.json,,, -RMLTC-CC-0001-Alt,Generate a rdf:Alt as an object,Tests if a rdf:Alt is generated as an object,,JSON,JSON,no,data.json,,, -RMLTC-CC-0002-List,Generate a named rdf:List as an object,Tests if a named rdf:List is generated as an object,,JSON,JSON,no,data.json,,, -RMLTC-CC-0002-Bag,Generate a named rdf:Bag as an object,Tests if a named rdf:Bag is generated as an object,,JSON,JSON,no,data.json,,,"If it works for bags, then it should work for sequences and alternatives." -RMLTC-CC-0003-EL,Allow the generation of empty lists,Tests if the use of rml:allowEmptyListAndContainer yields an empty list.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0003-EL-BN,Allow the generation of empty lists identified by blank node identifiers.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0003-EL-Named,Allow the generation of empty lists identified by IRIs.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0003-NEL,Empty lists are not generated,Tests if empty lists are not generated (expected default behavior).,,JSON,JSON,no,data.json,,, -RMLTC-CC-0003-NELb,Empty lists are not generated II,Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0003-EB,Allow the generation of empty bags,Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.,,JSON,JSON,no,data.json,,,"If it works for bags, then it should work for sequences and alternatives." -RMLTC-CC-0003-NEB,Empty bags are not generated,Tests if empty containers are not generated (expected default behavior).,,JSON,JSON,no,data.json,,, -RMLTC-CC-0004-SM1,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test generates a list.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0004-SM2,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0004-SM3,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists. ,,JSON,JSON,no,data.json,,, -RMLTC-CC-0004-SM4,GatherMap in subject map (bag),Tests if the use of a gather map in the subject map is supported. This test generates a bag.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0004-SM5,GatherMap in subject map (bag),"Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).",,JSON,JSON,no,data.json,,, -RMLTC-CC-0005-App1,Append values of multiple term maps,Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0005-App2,Append values of multiple term maps,"Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0005-Car1,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0005-Car2,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0006-IT0,Gather values across iterations to create a collection.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0006-IT1,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0006-IT2,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0006-IT3,Gather values across iterations to create a container.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different container.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0006-IT4,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0006-IT5,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0007-NES,Nested gather maps,Testing whether nested gather maps are created. The mapping should generate a list of bags.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0008-ROMa,Elements via reference object-map.,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.,,CSV,CSV,no,student.csv,,, -RMLTC-CC-0008-ROMb,Elements via reference object-map with default join condition,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.,,CSV,CSV,no,student.csv,,, -RMLTC-CC-0009-DUP-Bag,Gather duplicate values in an RDF Bag,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0009-DUP-List,Gather duplicate values in an RDF List,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.,,JSON,JSON,no,data.json,,, -RMLTC-CC-0010-Lista,Combining graph maps and gather maps (graph map has a template and gather map does not),"Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.",,JSON,JSON,no,data.json,,, -RMLTC-CC-0010-Listb,Combining graph maps and gather maps (both graph map and gather map have a template),"Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.",,JSON,JSON,no,data.json,,, \ No newline at end of file diff --git a/src/test/resources/rml-cc/dev.html b/src/test/resources/rml-cc/dev.html deleted file mode 100644 index 375747e..0000000 --- a/src/test/resources/rml-cc/dev.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - RML-CC: Test Cases - - - - - - - - - - -
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - diff --git a/src/test/resources/rml-cc/docs/20250130/index.html b/src/test/resources/rml-cc/docs/20250130/index.html deleted file mode 100644 index 27f834b..0000000 --- a/src/test/resources/rml-cc/docs/20250130/index.html +++ /dev/null @@ -1,2158 +0,0 @@ - - - - - - -RML-CC: Test Cases - - - - - - - - - - - - - - -
- -

RML-CC: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-CC-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/cc/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-cc - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-CC test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC-CC-0001-Alt

-

Title: Generate a rdf:Alt as an object

-

Description: Tests if a rdf:Alt is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Alt ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-
-
-

5. RMLTC-CC-0001-Bag

-

Title: Generate a rdf:Bag as an object

-

Description: Tests if a rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

6. RMLTC-CC-0001-List

-

Title: Generate a rdf:List as an object

-

Description: Tests if a rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

7. RMLTC-CC-0001-Seq

-

Title: Generate a rdf:Seq as an object

-

Description: Tests if a rdf:Seq is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Seq ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

8. RMLTC-CC-0002-Bag

-

Title: Generate a named rdf:Bag as an object

-

Description: Tests if a named rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-
-
-

9. RMLTC-CC-0002-List

-

Title: Generate a named rdf:List as an object

-

Description: Tests if a named rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

10. RMLTC-CC-0003-EB

-

Title: Allow the generation of empty bags

-

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

11. RMLTC-CC-0003-EL

-

Title: Allow the generation of empty lists

-

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

12. RMLTC-CC-0003-NEB

-

Title: Empty bags are not generated

-

Description: Tests if empty containers are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-
-
-

13. RMLTC-CC-0003-NEL

-

Title: Empty lists are not generated

-

Description: Tests if empty lists are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

14. RMLTC-CC-0003-NELb

-

Title: Empty lists are not generated II

-

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer false ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

15. RMLTC-CC-0004-SM1

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

16. RMLTC-CC-0004-SM2

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

17. RMLTC-CC-0004-SM3

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

18. RMLTC-CC-0004-SM4

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-
-

19. RMLTC-CC-0004-SM5

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

20. RMLTC-CC-0005-App1

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

21. RMLTC-CC-0005-App2

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
-_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-
-
-

22. RMLTC-CC-0005-Car1

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

23. RMLTC-CC-0005-Car2

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

24. RMLTC-CC-0006-IT0

-

Title: Gather values accross iterations.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection or container.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

25. RMLTC-CC-0006-IT1

-

Title: Gather values accross iterations.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

26. RMLTC-CC-0006-IT2

-

Title: Gather values accross iterations.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

27. RMLTC-CC-0007-NES

-

Title: Nested gather maps

-

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather (
-                [
-                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-                [
-                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-            ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
-
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
-
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
-
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-
-

28. RMLTC-CC-0008-ROMa

-

Title:

-

Description:

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [ 
-        rml:objectMap [
-                rml:reference "ID" ; rml:termType rml:BlankNode ;
-                rml:gather ( 
-                    [ 
-                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
-                    ] 
-                ) ;
-                rml:gatherAs rdf:List;
-            ] ;    
-        rml:predicate ex:sameSportAs 
-    ] ;
-
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
-
-
-

29. RMLTC-CC-0008-ROMb

-

Title:

-

Description:

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [
-        rml:objectMap [
-            rml:reference "ID" ; rml:termType rml:BlankNode ;
-            rml:gather ( 
-                [ 
-                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                ] 
-            ) ;
-            rml:gatherAs rdf:List;
-        ] ;
-        rml:predicate ex:sameSportAs 
-    ] ;
-        
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
-
-
-

30. RMLTC-CC-0009-DUP-Bag

-

Title:

-

Description:

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

31. RMLTC-CC-0009-DUP-List

-

Title:

-

Description:

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

32. RMLTC-CC-0010-Lista

-

Title:

-

Description:

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
-

33. RMLTC-CC-0010-Listb

-

Title:

-

Description:

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
- - - - - diff --git a/src/test/resources/rml-cc/docs/20250206/index.html b/src/test/resources/rml-cc/docs/20250206/index.html deleted file mode 100644 index abe1c49..0000000 --- a/src/test/resources/rml-cc/docs/20250206/index.html +++ /dev/null @@ -1,2158 +0,0 @@ - - - - - - -RML-CC: Test Cases - - - - - - - - - - - - - - -
- -

RML-CC: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-CC-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/cc/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-cc - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-CC test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC-CC-0001-Alt

-

Title: Generate a rdf:Alt as an object

-

Description: Tests if a rdf:Alt is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Alt ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-
-
-

5. RMLTC-CC-0001-Bag

-

Title: Generate a rdf:Bag as an object

-

Description: Tests if a rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

6. RMLTC-CC-0001-List

-

Title: Generate a rdf:List as an object

-

Description: Tests if a rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

7. RMLTC-CC-0001-Seq

-

Title: Generate a rdf:Seq as an object

-

Description: Tests if a rdf:Seq is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Seq ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

8. RMLTC-CC-0002-Bag

-

Title: Generate a named rdf:Bag as an object

-

Description: Tests if a named rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-
-
-

9. RMLTC-CC-0002-List

-

Title: Generate a named rdf:List as an object

-

Description: Tests if a named rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

10. RMLTC-CC-0003-EB

-

Title: Allow the generation of empty bags

-

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

11. RMLTC-CC-0003-EL

-

Title: Allow the generation of empty lists

-

Description: Tests if the use of rml:allowTemptyListAndContainer yields an empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

12. RMLTC-CC-0003-NEB

-

Title: Empty bags are not generated

-

Description: Tests if empty containers are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-
-
-

13. RMLTC-CC-0003-NEL

-

Title: Empty lists are not generated

-

Description: Tests if empty lists are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

14. RMLTC-CC-0003-NELb

-

Title: Empty lists are not generated II

-

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer false ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

15. RMLTC-CC-0004-SM1

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

16. RMLTC-CC-0004-SM2

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

17. RMLTC-CC-0004-SM3

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

18. RMLTC-CC-0004-SM4

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-
-

19. RMLTC-CC-0004-SM5

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

20. RMLTC-CC-0005-App1

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

21. RMLTC-CC-0005-App2

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
-_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-
-
-

22. RMLTC-CC-0005-Car1

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

23. RMLTC-CC-0005-Car2

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

24. RMLTC-CC-0006-IT0

-

Title: Gather values accross iterations.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection or container.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

25. RMLTC-CC-0006-IT1

-

Title: Gather values accross iterations.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

26. RMLTC-CC-0006-IT2

-

Title: Gather values accross iterations.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

27. RMLTC-CC-0007-NES

-

Title: Nested gather maps

-

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather (
-                [
-                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-                [
-                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-            ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
-
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
-
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
-
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-
-

28. RMLTC-CC-0008-ROMa

-

Title: Elements via reference object-map.

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [ 
-        rml:objectMap [
-                rml:reference "ID" ; rml:termType rml:BlankNode ;
-                rml:gather ( 
-                    [ 
-                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
-                    ] 
-                ) ;
-                rml:gatherAs rdf:List;
-            ] ;    
-        rml:predicate ex:sameSportAs 
-    ] ;
-
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
-
-
-

29. RMLTC-CC-0008-ROMb

-

Title: Elements via reference object-map with default join condition

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [
-        rml:objectMap [
-            rml:reference "ID" ; rml:termType rml:BlankNode ;
-            rml:gather ( 
-                [ 
-                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                ] 
-            ) ;
-            rml:gatherAs rdf:List;
-        ] ;
-        rml:predicate ex:sameSportAs 
-    ] ;
-        
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
-
-
-

30. RMLTC-CC-0009-DUP-Bag

-

Title: Gather duplicate values in an RDF Bag

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

31. RMLTC-CC-0009-DUP-List

-

Title: Gather duplicate values in an RDF List

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

32. RMLTC-CC-0010-Lista

-

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
-

33. RMLTC-CC-0010-Listb

-

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-cc/docs/20250225/index.html b/src/test/resources/rml-cc/docs/20250225/index.html deleted file mode 100644 index cfe40fd..0000000 --- a/src/test/resources/rml-cc/docs/20250225/index.html +++ /dev/null @@ -1,2472 +0,0 @@ - - - - - - -RML-CC: Test Cases - - - - - - - - - - - - - - - - - - -

Abstract

This document describes the [RML] vocabulary and approach to generating RDF containers and collections [RDF11-Concepts].

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- -

1. Introduction

-

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-CC test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC-CC-0001-Alt

-

Title: Generate a rdf:Alt as an object

-

Description: Tests if a rdf:Alt is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Alt ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-
-
-

5. RMLTC-CC-0001-Bag

-

Title: Generate a rdf:Bag as an object

-

Description: Tests if a rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

6. RMLTC-CC-0001-List

-

Title: Generate a rdf:List as an object

-

Description: Tests if a rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

7. RMLTC-CC-0001-Seq

-

Title: Generate a rdf:Seq as an object

-

Description: Tests if a rdf:Seq is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Seq ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

8. RMLTC-CC-0002-Bag

-

Title: Generate a named rdf:Bag as an object

-

Description: Tests if a named rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-
-
-

9. RMLTC-CC-0002-List

-

Title: Generate a named rdf:List as an object

-

Description: Tests if a named rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

10. RMLTC-CC-0003-EB

-

Title: Allow the generation of empty bags

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

11. RMLTC-CC-0003-EL

-

Title: Allow the generation of empty lists

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

12. RMLTC-CC-0003-EL-BN

-

Title: Allow the generation of empty lists identified by blank node identifiers.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

13. RMLTC-CC-0003-EL-Named

-

Title: Allow the generation of empty lists identified by IRIs.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

14. RMLTC-CC-0003-NEB

-

Title: Empty bags are not generated

-

Description: Tests if empty containers are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-
-
-

15. RMLTC-CC-0003-NEL

-

Title: Empty lists are not generated

-

Description: Tests if empty lists are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

16. RMLTC-CC-0003-NELb

-

Title: Empty lists are not generated II

-

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer false ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

17. RMLTC-CC-0004-SM1

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

18. RMLTC-CC-0004-SM2

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

19. RMLTC-CC-0004-SM3

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

20. RMLTC-CC-0004-SM4

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-
-

21. RMLTC-CC-0004-SM5

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

22. RMLTC-CC-0005-App1

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

23. RMLTC-CC-0005-App2

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
-_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-
-
-

24. RMLTC-CC-0005-Car1

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

25. RMLTC-CC-0005-Car2

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

26. RMLTC-CC-0006-IT0

-

Title: Gather values across iterations to create a collection.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

27. RMLTC-CC-0006-IT1

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

28. RMLTC-CC-0006-IT2

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

29. RMLTC-CC-0006-IT3

-

Title: Gather values across iterations to create a container.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
-
-
-

30. RMLTC-CC-0006-IT4

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-
-

31. RMLTC-CC-0006-IT5

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
-
-
-

32. RMLTC-CC-0007-NES

-

Title: Nested gather maps

-

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather (
-                [
-                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-                [
-                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-            ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
-
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
-
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
-
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-
-

33. RMLTC-CC-0008-ROMa

-

Title: Elements via reference object-map.

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [ 
-        rml:objectMap [
-                rml:reference "ID" ; rml:termType rml:BlankNode ;
-                rml:gather ( 
-                    [ 
-                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
-                    ] 
-                ) ;
-                rml:gatherAs rdf:List;
-            ] ;    
-        rml:predicate ex:sameSportAs 
-    ] ;
-
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
-
-
-

34. RMLTC-CC-0008-ROMb

-

Title: Elements via reference object-map with default join condition

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [
-        rml:objectMap [
-            rml:reference "ID" ; rml:termType rml:BlankNode ;
-            rml:gather ( 
-                [ 
-                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                ] 
-            ) ;
-            rml:gatherAs rdf:List;
-        ] ;
-        rml:predicate ex:sameSportAs 
-    ] ;
-        
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
-
-
-

35. RMLTC-CC-0009-DUP-Bag

-

Title: Gather duplicate values in an RDF Bag

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

36. RMLTC-CC-0009-DUP-List

-

Title: Gather duplicate values in an RDF List

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

37. RMLTC-CC-0010-Lista

-

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
-

38. RMLTC-CC-0010-Listb

-

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-@base        <http://example.com/>.
-
-<#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
- - - - -

A. References

A.1 Informative references

- -
[RDF11-Concepts]
- RDF 1.1 Concepts and Abstract Syntax. W3C. 25 February 2014. W3C Recommendation. URL: https://www.w3.org/TR/rdf11-concepts/ -
[RML]
- RDF Mapping Language. https://rml.io. 06 October 2020. Unofficial draft. URL: https://rml.io/specs/rml/ -
-
\ No newline at end of file diff --git a/src/test/resources/rml-cc/docs/20250915/index.html b/src/test/resources/rml-cc/docs/20250915/index.html deleted file mode 100644 index 2ad784e..0000000 --- a/src/test/resources/rml-cc/docs/20250915/index.html +++ /dev/null @@ -1,2544 +0,0 @@ - - - - - - -RML-CC: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- -

1. Introduction

-

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-CC test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC-CC-0001-Alt

-

Title: Generate a rdf:Alt as an object

-

Description: Tests if a rdf:Alt is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Alt ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-
-
-

5. RMLTC-CC-0001-Bag

-

Title: Generate a rdf:Bag as an object

-

Description: Tests if a rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

6. RMLTC-CC-0001-List

-

Title: Generate a rdf:List as an object

-

Description: Tests if a rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

7. RMLTC-CC-0001-Seq

-

Title: Generate a rdf:Seq as an object

-

Description: Tests if a rdf:Seq is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Seq ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

8. RMLTC-CC-0002-Bag

-

Title: Generate a named rdf:Bag as an object

-

Description: Tests if a named rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-
-
-

9. RMLTC-CC-0002-List

-

Title: Generate a named rdf:List as an object

-

Description: Tests if a named rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

10. RMLTC-CC-0003-EB

-

Title: Allow the generation of empty bags

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

11. RMLTC-CC-0003-EL

-

Title: Allow the generation of empty lists

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

12. RMLTC-CC-0003-EL-BN

-

Title: Allow the generation of empty lists identified by blank node identifiers.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

13. RMLTC-CC-0003-EL-Named

-

Title: Allow the generation of empty lists identified by IRIs.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

14. RMLTC-CC-0003-NEB

-

Title: Empty bags are not generated

-

Description: Tests if empty containers are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-
-
-

15. RMLTC-CC-0003-NEL

-

Title: Empty lists are not generated

-

Description: Tests if empty lists are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

16. RMLTC-CC-0003-NELb

-

Title: Empty lists are not generated II

-

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer false ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

17. RMLTC-CC-0004-SM1

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

18. RMLTC-CC-0004-SM2

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

19. RMLTC-CC-0004-SM3

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

20. RMLTC-CC-0004-SM4

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-
-

21. RMLTC-CC-0004-SM5

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

22. RMLTC-CC-0005-App1

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

23. RMLTC-CC-0005-App2

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
-_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-
-
-

24. RMLTC-CC-0005-Car1

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

25. RMLTC-CC-0005-Car2

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

26. RMLTC-CC-0006-IT0

-

Title: Gather values across iterations to create a collection.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

27. RMLTC-CC-0006-IT1

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

28. RMLTC-CC-0006-IT2

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

29. RMLTC-CC-0006-IT3

-

Title: Gather values across iterations to create a container.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
-
-
-

30. RMLTC-CC-0006-IT4

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-
-

31. RMLTC-CC-0006-IT5

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
-
-
-

32. RMLTC-CC-0007-NES

-

Title: Nested gather maps

-

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather (
-                [
-                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-                [
-                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-            ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
-
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
-
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
-
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-
-

33. RMLTC-CC-0008-ROMa

-

Title: Elements via reference object-map.

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [ 
-        rml:objectMap [
-                rml:reference "ID" ; rml:termType rml:BlankNode ;
-                rml:gather ( 
-                    [ 
-                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
-                    ] 
-                ) ;
-                rml:gatherAs rdf:List;
-            ] ;    
-        rml:predicate ex:sameSportAs 
-    ] ;
-
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
-
-
-

34. RMLTC-CC-0008-ROMb

-

Title: Elements via reference object-map with default join condition

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [
-        rml:objectMap [
-            rml:reference "ID" ; rml:termType rml:BlankNode ;
-            rml:gather ( 
-                [ 
-                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                ] 
-            ) ;
-            rml:gatherAs rdf:List;
-        ] ;
-        rml:predicate ex:sameSportAs 
-    ] ;
-        
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
-
-
-

35. RMLTC-CC-0009-DUP-Bag

-

Title: Gather duplicate values in an RDF Bag

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

36. RMLTC-CC-0009-DUP-List

-

Title: Gather duplicate values in an RDF List

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

37. RMLTC-CC-0010-Lista

-

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
-

38. RMLTC-CC-0010-Listb

-

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-cc/docs/index.html b/src/test/resources/rml-cc/docs/index.html deleted file mode 100644 index 2ad784e..0000000 --- a/src/test/resources/rml-cc/docs/index.html +++ /dev/null @@ -1,2544 +0,0 @@ - - - - - - -RML-CC: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- -

1. Introduction

-

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-CC test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC-CC-0001-Alt

-

Title: Generate a rdf:Alt as an object

-

Description: Tests if a rdf:Alt is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Alt ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-
-
-

5. RMLTC-CC-0001-Bag

-

Title: Generate a rdf:Bag as an object

-

Description: Tests if a rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

6. RMLTC-CC-0001-List

-

Title: Generate a rdf:List as an object

-

Description: Tests if a rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

7. RMLTC-CC-0001-Seq

-

Title: Generate a rdf:Seq as an object

-

Description: Tests if a rdf:Seq is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Seq ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

8. RMLTC-CC-0002-Bag

-

Title: Generate a named rdf:Bag as an object

-

Description: Tests if a named rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-
-
-

9. RMLTC-CC-0002-List

-

Title: Generate a named rdf:List as an object

-

Description: Tests if a named rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

10. RMLTC-CC-0003-EB

-

Title: Allow the generation of empty bags

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

11. RMLTC-CC-0003-EL

-

Title: Allow the generation of empty lists

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

12. RMLTC-CC-0003-EL-BN

-

Title: Allow the generation of empty lists identified by blank node identifiers.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

13. RMLTC-CC-0003-EL-Named

-

Title: Allow the generation of empty lists identified by IRIs.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

14. RMLTC-CC-0003-NEB

-

Title: Empty bags are not generated

-

Description: Tests if empty containers are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-
-
-

15. RMLTC-CC-0003-NEL

-

Title: Empty lists are not generated

-

Description: Tests if empty lists are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

16. RMLTC-CC-0003-NELb

-

Title: Empty lists are not generated II

-

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer false ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

17. RMLTC-CC-0004-SM1

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

18. RMLTC-CC-0004-SM2

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

19. RMLTC-CC-0004-SM3

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

20. RMLTC-CC-0004-SM4

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-
-

21. RMLTC-CC-0004-SM5

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

22. RMLTC-CC-0005-App1

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

23. RMLTC-CC-0005-App2

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
-_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-
-
-

24. RMLTC-CC-0005-Car1

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

25. RMLTC-CC-0005-Car2

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

26. RMLTC-CC-0006-IT0

-

Title: Gather values across iterations to create a collection.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

27. RMLTC-CC-0006-IT1

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

28. RMLTC-CC-0006-IT2

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

29. RMLTC-CC-0006-IT3

-

Title: Gather values across iterations to create a container.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
-
-
-

30. RMLTC-CC-0006-IT4

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-
-

31. RMLTC-CC-0006-IT5

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
-
-
-

32. RMLTC-CC-0007-NES

-

Title: Nested gather maps

-

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather (
-                [
-                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-                [
-                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-            ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
-
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
-
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
-
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-
-

33. RMLTC-CC-0008-ROMa

-

Title: Elements via reference object-map.

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [ 
-        rml:objectMap [
-                rml:reference "ID" ; rml:termType rml:BlankNode ;
-                rml:gather ( 
-                    [ 
-                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
-                    ] 
-                ) ;
-                rml:gatherAs rdf:List;
-            ] ;    
-        rml:predicate ex:sameSportAs 
-    ] ;
-
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
-
-
-

34. RMLTC-CC-0008-ROMb

-

Title: Elements via reference object-map with default join condition

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [
-        rml:objectMap [
-            rml:reference "ID" ; rml:termType rml:BlankNode ;
-            rml:gather ( 
-                [ 
-                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                ] 
-            ) ;
-            rml:gatherAs rdf:List;
-        ] ;
-        rml:predicate ex:sameSportAs 
-    ] ;
-        
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
-
-
-

35. RMLTC-CC-0009-DUP-Bag

-

Title: Gather duplicate values in an RDF Bag

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

36. RMLTC-CC-0009-DUP-List

-

Title: Gather duplicate values in an RDF List

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

37. RMLTC-CC-0010-Lista

-

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
-

38. RMLTC-CC-0010-Listb

-

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-cc/list.sh b/src/test/resources/rml-cc/list.sh deleted file mode 100755 index 12c3203..0000000 --- a/src/test/resources/rml-cc/list.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -for i in RML*; do - echo "
" -done diff --git a/src/test/resources/rml-cc/make-metadata.py b/src/test/resources/rml-cc/make-metadata.py deleted file mode 100755 index a2c4636..0000000 --- a/src/test/resources/rml-cc/make-metadata.py +++ /dev/null @@ -1,209 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import glob -import csv - -def get_title_description(testcase: str): - with open ('descriptions.csv') as csvfile: - reader = csv.reader(csvfile) - for row in reader: - if row[0] == testcase: - return row[1], row[2] - -def main(spec: str): - with open ('metadata.csv', 'w', newline='') as csvfile: - writer = csv.writer(csvfile) - writer.writerow(['ID', 'title', 'description', 'specification', - 'mapping', 'input_format1', 'input_format2', - 'input_format3', 'output_format1', 'output_format2', - 'output_format3', 'input1', 'input2', 'input3', - 'output1', 'output2', 'output3', 'error']) - for testcase in glob.glob('RML*'): - title, description = get_title_description(testcase) - error = 'false' - input1 = '' - input2 = '' - input3 = '' - input_format1 = '' - input_format2 = '' - input_format3 = '' - output1 = '' - output2 = '' - output3 = '' - output_format1 = '' - output_format2 = '' - output_format3 = '' - - # Input file - if os.path.exists(os.path.join(testcase, 'Friends.json')): - input1 = 'Friends.json' - input_format1 = 'application/json' - elif os.path.exists(os.path.join(testcase, 'Friends-UTF16.json')): - input1 = 'Friends-UTF16.json' - input_format1 = 'application/json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.gz')): - input1 = 'Friends.json.gz' - input_format1 = 'application/gzip+json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.zip')): - input1 = 'Friends.json.zip' - input_format1 = 'application/gzip+json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.xz')): - input1 = 'Friends.json.tar.xz' - input_format1 = 'application/tarxz+json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.gz')): - input1 = 'Friends.json.tar.gz' - input_format1 = 'application/targz+json' - elif os.path.exists(os.path.join(testcase, 'Friends-NULL.csv')): - input1 = 'Friends-NULL.csv' - input_format1 = 'text/csv' - elif os.path.exists(os.path.join(testcase, 'Friends-NULL2.csv')): - input1 = 'Friends-NULL2.csv' - input_format1 = 'text/csv' - elif os.path.exists(os.path.join(testcase, 'Friends.nt')): - input1 = 'Friends.nt' - input_format1 = 'application/n-triples' - elif os.path.exists(os.path.join(testcase, 'Friends.csv')): - input1 = 'Friends.csv' - input_format1 = 'text/csv' - elif os.path.exists(os.path.join(testcase, 'Friends.json')): - input1 = 'Friends.json' - input_format1 = 'application/json' - elif os.path.exists(os.path.join(testcase, 'Friends.xml')): - input1 = 'Friends.xml' - input_format1 = 'text/xml' - else: - input1 = f'http://w3id.org/rml/resources/rml-io/{testcase}/Friends.json' - input_format1 = 'application/json' - - # Mapping file - if os.path.exists(os.path.join(testcase, 'mapping.ttl')): - mapping_file = 'mapping.ttl' - else: - raise ValueError('Mapping file missing!') - - # Output files - if os.path.exists(os.path.join(testcase, 'default.nq')): - output1 = 'default.nq' - output_format1 = 'application/n-quads' - else: - raise NotImplementedError('output1 is not known, but required') - - if os.path.exists(os.path.join(testcase, 'dump1.nq')): - output2 = 'dump1.nq' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nt')): - output2 = 'dump1.nt' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.n3')): - output2 = 'dump1.n3' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.jsonld')): - output2 = 'dump1.jsonld' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.rdfjson')): - output2 = 'dump1.rdfjson' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.rdfxml')): - output2 = 'dump1.rdfxml' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.ttl')): - output2 = 'dump1.ttl' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.gz')): - output2 = 'dump1.nq.gz' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.zip')): - output2 = 'dump1.nq.zip' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.xz')): - output2 = 'dump1.nq.tar.xz' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.gz')): - output2 = 'dump1.nq.tar.gz' - output_format2 = 'application/n-quads' - - if os.path.exists(os.path.join(testcase, 'dump2.nq')): - output3 = 'dump2.nq' - output_format3 = 'application/n-quads' - - writer.writerow([testcase, title, description, spec, mapping_file, - input_format1, input_format2, input_format3, - output_format1, output_format2, output_format3, - input1, input2, input3, output1, output2, - output3, error]) - lines = [] - # Title and description - lines.append(f'## {testcase}\n\n') - lines.append(f'**Title**: {title}\n\n') - lines.append(f'**Description**: {description}\n\n') - if error == 'true': - error_html = 'Yes' - else: - error_html = 'No' - lines.append(f'**Error expected?** {error_html}\n\n') - - # Input - inputCount = '' - - for index, i in enumerate([input1, input2, input3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - input_html = f'**Input{inputCount}**\n `{i}`\n\n' - - lines.append(input_html) - inputCount = f' {index + 1}' - - # Mapping - with open(os.path.join(testcase, mapping_file)) as f: - mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' - lines.append(mapping_html) - - # Output - outputCount = '' - if output2 or output3: - outputCount = ' 1' - - for index, i in enumerate([output1, output2, output3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - output_html = f'**Output{outputCount}**\n `{i}`\n\n' - - lines.append(output_html) - outputCount = f' {index + 2}' - - - with open(os.path.join(testcase, 'README.md'), 'w') as f: - f.writelines(lines) - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('Usage: ./make-metadata.py ') - sys.exit(1) - main(sys.argv[1]) diff --git a/src/test/resources/rml-cc/manifest.rml.ttl b/src/test/resources/rml-cc/manifest.rml.ttl deleted file mode 100644 index 0dd7857..0000000 --- a/src/test/resources/rml-cc/manifest.rml.ttl +++ /dev/null @@ -1,267 +0,0 @@ -@prefix xsd: . -@prefix dcterms: . -@prefix rml: . -@prefix rmltest: . -@prefix test: . -@base . - -# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/cc/test/ - -_:source - rml:source [ - a rml:RelativePathSource ; - rml:path "metadata.csv" ; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; -. - -<#TriplesMapTestcase> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:reference "ID"; - rml:class test:TestCase; - ]; - - rml:predicateObjectMap [ - rml:predicate dcterms:identifier; - rml:objectMap [ - rml:reference "ID"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:hasError; - rml:objectMap [ - rml:reference "error"; - rml:datatype xsd:boolean; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:mappingDocument; - rml:objectMap [ - rml:reference "mapping"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; -. - -<#TriplesMapInput1> - a rml:TriplesMap; - - rml:logicalSource _:source ; - - rml:subjectMap [ - rml:template "{ID}/input/{input1}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format1"; - ]; - ]; -. - -<#TriplesMapInput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input2}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format2"; - ]; - ]; -. - -<#TriplesMapInput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input3}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format3"; - ]; - ]; -. - -<#TriplesMapOutput1> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output1}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format1"; - ]; - ]; -. - -<#TriplesMapOutput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output2}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format2"; - ]; - ]; -. - -<#TriplesMapOutput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output3}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format3"; - ]; - ]; -. - diff --git a/src/test/resources/rml-cc/manifest.ttl b/src/test/resources/rml-cc/manifest.ttl deleted file mode 100644 index bd827a7..0000000 --- a/src/test/resources/rml-cc/manifest.ttl +++ /dev/null @@ -1,420 +0,0 @@ - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0006-IT0" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0008-ROMb" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0010-Lista" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0006-IT1" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0002-List" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0001-Bag" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0003-EL-Named" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0005-App1" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0004-SM1" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0003-NEL" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0003-NELb" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0010-Listb" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0006-IT2" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0009-DUP-Bag" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0001-Seq" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0002-Bag" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0001-List" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0005-App2" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0001-Alt" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0004-SM2" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0007-NES" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0009-DUP-List" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0003-EL" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0006-IT3" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0003-NEB" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0005-Car1" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0004-SM3" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0006-IT4" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0005-Car2" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0003-EB" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0004-SM4" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0006-IT5" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json" . - "application/json" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0008-ROMa" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json" . - "application/json" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0003-EL-BN" . - . - "default.nq" . - "application/n-quads" . - . - . - "mapping.ttl" . - "false"^^ . - . - "RMLTC-CC-0004-SM5" . - . - "http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json" . - "application/json" . - . diff --git a/src/test/resources/rml-cc/metadata.csv b/src/test/resources/rml-cc/metadata.csv deleted file mode 100644 index 919ffd5..0000000 --- a/src/test/resources/rml-cc/metadata.csv +++ /dev/null @@ -1,36 +0,0 @@ -ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error -RMLTC-CC-0001-Alt,Generate a rdf:Alt as an object,Tests if a rdf:Alt is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json,,,default.nq,,,false -RMLTC-CC-0001-Bag,Generate a rdf:Bag as an object,Tests if a rdf:Bag is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json,,,default.nq,,,false -RMLTC-CC-0001-List,Generate a rdf:List as an object,Tests if a rdf:List is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json,,,default.nq,,,false -RMLTC-CC-0001-Seq,Generate a rdf:Seq as an object,Tests if a rdf:Seq is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json,,,default.nq,,,false -RMLTC-CC-0002-Bag,Generate a named rdf:Bag as an object,Tests if a named rdf:Bag is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json,,,default.nq,,,false -RMLTC-CC-0002-List,Generate a named rdf:List as an object,Tests if a named rdf:List is generated as an object,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json,,,default.nq,,,false -RMLTC-CC-0003-EB,Allow the generation of empty bags,Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json,,,default.nq,,,false -RMLTC-CC-0003-EL,Allow the generation of empty lists,Tests if the use of rml:allowEmptyListAndContainer yields an empty list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json,,,default.nq,,,false -RMLTC-CC-0003-EL-BN,Allow the generation of empty lists identified by blank node identifiers.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json,,,default.nq,,,false -RMLTC-CC-0003-EL-Named,Allow the generation of empty lists identified by IRIs.,Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json,,,default.nq,,,false -RMLTC-CC-0003-NEB,Empty bags are not generated,Tests if empty containers are not generated (expected default behavior).,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json,,,default.nq,,,false -RMLTC-CC-0003-NEL,Empty lists are not generated,Tests if empty lists are not generated (expected default behavior).,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json,,,default.nq,,,false -RMLTC-CC-0003-NELb,Empty lists are not generated II,Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json,,,default.nq,,,false -RMLTC-CC-0004-SM1,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test generates a list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json,,,default.nq,,,false -RMLTC-CC-0004-SM2,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json,,,default.nq,,,false -RMLTC-CC-0004-SM3,GatherMap in subject map (list),Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists. ,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json,,,default.nq,,,false -RMLTC-CC-0004-SM4,GatherMap in subject map (bag),Tests if the use of a gather map in the subject map is supported. This test generates a bag.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json,,,default.nq,,,false -RMLTC-CC-0004-SM5,GatherMap in subject map (bag),"Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json,,,default.nq,,,false -RMLTC-CC-0005-App1,Append values of multiple term maps,Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json,,,default.nq,,,false -RMLTC-CC-0005-App2,Append values of multiple term maps,"Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json,,,default.nq,,,false -RMLTC-CC-0005-Car1,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json,,,default.nq,,,false -RMLTC-CC-0005-Car2,Cartesian product of values from multiple term maps of a gather map.,Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json,,,default.nq,,,false -RMLTC-CC-0006-IT0,Gather values across iterations to create a collection.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json,,,default.nq,,,false -RMLTC-CC-0006-IT1,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json,,,default.nq,,,false -RMLTC-CC-0006-IT2,Gather values across iterations to create a collection.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json,,,default.nq,,,false -RMLTC-CC-0006-IT3,Gather values across iterations to create a container.,"When no template, constant, or reference is given to a gather map, then each iteration yields a different container.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json,,,default.nq,,,false -RMLTC-CC-0006-IT4,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json,,,default.nq,,,false -RMLTC-CC-0006-IT5,Gather values across iterations to create a container.,"When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json,,,default.nq,,,false -RMLTC-CC-0007-NES,Nested gather maps,Testing whether nested gather maps are created. The mapping should generate a list of bags.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json,,,default.nq,,,false -RMLTC-CC-0008-ROMa,Elements via reference object-map.,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json,,,default.nq,,,false -RMLTC-CC-0008-ROMb,Elements via reference object-map with default join condition,Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json,,,default.nq,,,false -RMLTC-CC-0009-DUP-Bag,Gather duplicate values in an RDF Bag,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json,,,default.nq,,,false -RMLTC-CC-0009-DUP-List,Gather duplicate values in an RDF List,Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.,http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json,,,default.nq,,,false -RMLTC-CC-0010-Lista,Combining graph maps and gather maps (graph map has a template and gather map does not),"Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json,,,default.nq,,,false -RMLTC-CC-0010-Listb,Combining graph maps and gather maps (both graph map and gather map have a template),"Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.",http://w3id.org/rml/cc/spec,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json,,,default.nq,,,false diff --git a/src/test/resources/rml-cc/publish.js b/src/test/resources/rml-cc/publish.js deleted file mode 100644 index a747165..0000000 --- a/src/test/resources/rml-cc/publish.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Created by bjdmeest on 10/06/2016. - * Modified by Dylan Van Assche on 12/02/2021. - */ - -var fs = require('fs'); -var path = require('path'); - -var dateString = (new Date()).toISOString().split('T')[0].replace(/-/g, ''); - -try { - if (!fs.existsSync (path.resolve(__dirname, 'docs'))) { - fs.mkdirSync (path.resolve(__dirname, 'docs')); - } - fs.mkdirSync (path.resolve(__dirname, 'docs', dateString)); -} catch (e) { - -} - -var files = fs.readdirSync (path.resolve(__dirname, 'docs')); -var dirs = []; -for (var i = 0; i < files.length; i++) { - if (fs.lstatSync (path.resolve(__dirname, 'docs', files[i])).isDirectory()) { - dirs.push(files[i]); - } -} - -dirs.sort(); -dirs.reverse(); - -if (dirs[0] === "resources") { - dirs.splice (0, 1); -} - -if (dirs[0] === dateString) { - dirs.splice (0, 1); -} - -// First version, set previous version to this one -if (dirs.length == 0) { - dirs.push (dateString) -} - -var html = fs.readFileSync ('./rendered.html', 'utf8'); -html = html.replace (/%thisDate%/g, dateString); -html = html.replace (/%prevDate%/g, dirs[0]); -fs.writeFileSync (path.resolve (__dirname, 'docs', 'index.html'), html); -html = html.replace (/\.\/resources/g, '../resources'); -fs.writeFileSync (path.resolve(__dirname, 'docs', dateString, 'index.html'), html); - -// Copy assets -// fs.copyFileSync('Supergirl.xml', path.resolve(__dirname, 'docs', dateString, 'Supergirl.xml')) -// fs.copyFileSync('Supergirl.xml', path.resolve(__dirname, 'docs', 'Supergirl.xml')) -// fs.copyFileSync('Leverage.csv', path.resolve(__dirname, 'docs', dateString, 'Leverage.csv')) -// fs.copyFileSync('Leverage.csv', path.resolve(__dirname, 'docs', 'Leverage.csv')) -// fs.copyFileSync('Friends.json', path.resolve(__dirname, 'docs', dateString, 'Friends.json')) -// fs.copyFileSync('Friends.json', path.resolve(__dirname, 'docs', 'Friends.json')) -// fs.copyFileSync('DBPedia.csv', path.resolve(__dirname, 'docs', dateString, 'DBPedia.csv')) -// fs.copyFileSync('DBPedia.csv', path.resolve(__dirname, 'docs', 'DBPedia.csv')) diff --git a/src/test/resources/rml-cc/rendered.html b/src/test/resources/rml-cc/rendered.html deleted file mode 100644 index 2ad784e..0000000 --- a/src/test/resources/rml-cc/rendered.html +++ /dev/null @@ -1,2544 +0,0 @@ - - - - - - -RML-CC: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- -

1. Introduction

-

This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-CC test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC-CC-0001-Alt

-

Title: Generate a rdf:Alt as an object

-

Description: Tests if a rdf:Alt is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Alt/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Alt ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-
-
-

5. RMLTC-CC-0001-Bag

-

Title: Generate a rdf:Bag as an object

-

Description: Tests if a rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

6. RMLTC-CC-0001-List

-

Title: Generate a rdf:List as an object

-

Description: Tests if a rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

7. RMLTC-CC-0001-Seq

-

Title: Generate a rdf:Seq as an object

-

Description: Tests if a rdf:Seq is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0001-Seq/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Seq ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

8. RMLTC-CC-0002-Bag

-

Title: Generate a named rdf:Bag as an object

-

Description: Tests if a named rdf:Bag is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-
-
-

9. RMLTC-CC-0002-List

-

Title: Generate a named rdf:List as an object

-

Description: Tests if a named rdf:List is generated as an object

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0002-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b2 .
-<http://example.com/base/e/c> <http://example.com/ns#with> <http://example.com/base/c/c> .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b4 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-_:nb73dd869d6bb47a5b865ee632fe27453b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b3 .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nb73dd869d6bb47a5b865ee632fe27453b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b6 .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nb73dd869d6bb47a5b865ee632fe27453b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nb73dd869d6bb47a5b865ee632fe27453b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b1 .
-<http://example.com/base/c/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nb73dd869d6bb47a5b865ee632fe27453b5 .
-_:nb73dd869d6bb47a5b865ee632fe27453b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

10. RMLTC-CC-0003-EB

-

Title: Allow the generation of empty bags

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nfecac3cfe48c4afa99539cc809138e96b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b1 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfecac3cfe48c4afa99539cc809138e96b2 .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nfecac3cfe48c4afa99539cc809138e96b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

11. RMLTC-CC-0003-EL

-

Title: Allow the generation of empty lists

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

12. RMLTC-CC-0003-EL-BN

-

Title: Allow the generation of empty lists identified by blank node identifiers.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a blank node identifier generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-BN/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n302eecc856b44ed5b76965d9be2f5213b1 .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

13. RMLTC-CC-0003-EL-Named

-

Title: Allow the generation of empty lists identified by IRIs.

-

Description: Tests if the use of rml:allowEmptyListAndContainer yields an empty list. The lists are identified by a IRI generated in the mapping.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-EL-Named/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:allowEmptyListAndContainer true ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-
-
-

14. RMLTC-CC-0003-NEB

-

Title: Empty bags are not generated

-

Description: Tests if empty containers are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEB/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n2bd72de9c571444081890e41009d92d4b1 .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n2bd72de9c571444081890e41009d92d4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-
-
-

15. RMLTC-CC-0003-NEL

-

Title: Empty lists are not generated

-

Description: Tests if empty lists are not generated (expected default behavior).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NEL/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

16. RMLTC-CC-0003-NELb

-

Title: Empty lists are not generated II

-

Description: Tests if empty lists are not generated (expected default behavior). This test cases uses the predicate rml:allowEmptyListAndContainer.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0003-NELb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:allowEmptyListAndContainer false ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb2 .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n434c2c54e09e4a259604ba1188ce038fb1 .
-_:n434c2c54e09e4a259604ba1188ce038fb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n434c2c54e09e4a259604ba1188ce038fb3 .
-_:n434c2c54e09e4a259604ba1188ce038fb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n434c2c54e09e4a259604ba1188ce038fb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-
-
-

17. RMLTC-CC-0004-SM1

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

18. RMLTC-CC-0004-SM2

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It still needs to generate triples as the lists consists of at least one cons-pair.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n302eecc856b44ed5b76965d9be2f5213b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b2 .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n302eecc856b44ed5b76965d9be2f5213b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n302eecc856b44ed5b76965d9be2f5213b3 .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n302eecc856b44ed5b76965d9be2f5213b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b2 .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d393f12e993411498da676131f81ca4b3 .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d393f12e993411498da676131f81ca4b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

19. RMLTC-CC-0004-SM3

-

Title: GatherMap in subject map (list)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. Only one list needs to be generated as the other has no values and we only retain non-empty lists.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:List ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb2 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n648f8cf4c58149e8a0feea26fb2a5b5bb3 .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n648f8cf4c58149e8a0feea26fb2a5b5bb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

20. RMLTC-CC-0004-SM4

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test generates a bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:createdBy ;
-        rml:object ex:JohnDoe ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "5" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "4" .
-_:n1d393f12e993411498da676131f81ca4b1 <http://example.com/ns#createdBy> <http://example.com/ns#JohnDoe> .
-_:n1d393f12e993411498da676131f81ca4b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:n1d393f12e993411498da676131f81ca4b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-
-
-

21. RMLTC-CC-0004-SM5

-

Title: GatherMap in subject map (bag)

-

Description: Tests if the use of a gather map in the subject map is supported. This test has no predicate-object maps and no class declarations in the subject map. It should generate a non-empty bag and an empty bag. The reason being that a container has at least one triple ; it's type (bag, seq, or alt).

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0004-SM5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-        rml:gatherAs rdf:Bag ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:ne32066984b71404a953025d001cd3cdfb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "3" .
-
-
-

22. RMLTC-CC-0005-App1

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b1 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b2 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b4 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b5 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1ee4a5a2b1344422919d171ab2cd6c39b6 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b7 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1ee4a5a2b1344422919d171ab2cd6c39b8 .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n1ee4a5a2b1344422919d171ab2cd6c39b8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

23. RMLTC-CC-0005-App2

-

Title: Append values of multiple term maps

-

Description: Tests appending of values from multiple term maps in an iteration. In this example, one of the arrays is empty and the expected behavior is to concatinate a list with the empty list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-App2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab2 .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab5 .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab4 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n1d9b8ef217cb44f299a062d746116deab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n1d9b8ef217cb44f299a062d746116deab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n1d9b8ef217cb44f299a062d746116deab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:n1d9b8ef217cb44f299a062d746116deab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab3 .
-_:n1d9b8ef217cb44f299a062d746116deab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab1 .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n1d9b8ef217cb44f299a062d746116deab6 .
-_:n1d9b8ef217cb44f299a062d746116deab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab8 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n1d9b8ef217cb44f299a062d746116deab7 .
-_:n1d9b8ef217cb44f299a062d746116deab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-
-
-

24. RMLTC-CC-0005-Car1

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where all sets of values are non-empty.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb9 .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:nfc398e5692654ca98dfb3fb5432d277cb9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb10 .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb10 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb11 .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nfc398e5692654ca98dfb3fb5432d277cb11 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb12 .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:nfc398e5692654ca98dfb3fb5432d277cb12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

25. RMLTC-CC-0005-Car2

-

Title: Cartesian product of values from multiple term maps of a gather map.

-

Description: Tests generating the Cartesian product of values from multiple term maps in a gather map. This test covers the case where one of the sets is empty. The Cartesian product of a set with an empty set is empty. This entry should thus not yield a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0005-Car2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-            rml:strategy rml:cartesianProduct ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb1 .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb2 .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-_:nfc398e5692654ca98dfb3fb5432d277cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb3 .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:nfc398e5692654ca98dfb3fb5432d277cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb4 .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb5 .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb6 .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:nfc398e5692654ca98dfb3fb5432d277cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nfc398e5692654ca98dfb3fb5432d277cb7 .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nfc398e5692654ca98dfb3fb5432d277cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nfc398e5692654ca98dfb3fb5432d277cb8 .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:nfc398e5692654ca98dfb3fb5432d277cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

26. RMLTC-CC-0006-IT0

-

Title: Gather values across iterations to create a collection.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different collection.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT0/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b1 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b2 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b5 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b6 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:n9d785cd672d3484cb5d9fd831e6dfc07b3 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n9d785cd672d3484cb5d9fd831e6dfc07b4 .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n9d785cd672d3484cb5d9fd831e6dfc07b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

27. RMLTC-CC-0006-IT1

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT1/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b1 .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:nab8f496caee443c5ac19ce3a109f4b22b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b2 .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:nab8f496caee443c5ac19ce3a109f4b22b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b3 .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:nab8f496caee443c5ac19ce3a109f4b22b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab8f496caee443c5ac19ce3a109f4b22b4 .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:nab8f496caee443c5ac19ce3a109f4b22b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

28. RMLTC-CC-0006-IT2

-

Title: Gather values across iterations to create a collection.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the list. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT2/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab1 .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n0cbb21ce98464358963007f95dc35c0ab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab2 .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
-_:n0cbb21ce98464358963007f95dc35c0ab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab3 .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
-_:n0cbb21ce98464358963007f95dc35c0ab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab4 .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "5" .
-_:n0cbb21ce98464358963007f95dc35c0ab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab5 .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n0cbb21ce98464358963007f95dc35c0ab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab6 .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
-_:n0cbb21ce98464358963007f95dc35c0ab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab7 .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "e" .
-_:n0cbb21ce98464358963007f95dc35c0ab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab8 .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "4" .
-_:n0cbb21ce98464358963007f95dc35c0ab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n0cbb21ce98464358963007f95dc35c0ab9 .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
-_:n0cbb21ce98464358963007f95dc35c0ab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

29. RMLTC-CC-0006-IT3

-

Title: Gather values across iterations to create a container.

-

Description: When no template, constant, or reference is given to a gather map, then each iteration yields a different container.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT3/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:a .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:b .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:c .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "5" .
-_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "6" .
-
-
-

30. RMLTC-CC-0006-IT4

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers one term map in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT4/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "6" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-
-

31. RMLTC-CC-0006-IT5

-

Title: Gather values across iterations to create a container.

-

Description: When using a template, constant, or reference for a gather map, this tests determines whether the values are correctly appended to the container. The natural order of the term maps inside the gather map as well as the iteration are respected. This test covers two term maps in the gather map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0006-IT5/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "c/{$.id}" ;
-            rml:gather ( [ rml:reference "$.v1.*" ; ] [ rml:reference "$.v2.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> <http://example.com/base/c/a> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "a" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_4> "b" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_5> "5" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_6> "6" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_7> "d" .
-<http://example.com/base/c/a> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_8> "e" .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> <http://example.com/base/c/b> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-<http://example.com/base/c/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "c" .
-
-
-

32. RMLTC-CC-0007-NES

-

Title: Nested gather maps

-

Description: Testing whether nested gather maps are created. The mapping should generate a list of bags.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0007-NES/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather (
-                [
-                    rml:gather ( [ rml:reference "$.v1.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-                [
-                    rml:gather ( [ rml:reference "$.v2.*" ; ] ) ;
-                    rml:gatherAs rdf:Bag ;
-                ]
-            ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-_:nab9af1206e584ab2afd457e8a605872cb1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "a" .
-_:nab9af1206e584ab2afd457e8a605872cb2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "b" .
-
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "3" .
-_:nab9af1206e584ab2afd457e8a605872cb5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "4" .
-
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nab9af1206e584ab2afd457e8a605872cb6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "c" .
-
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb3 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb1 .
-_:nab9af1206e584ab2afd457e8a605872cb3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb4 .
-
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb2 .
-_:nab9af1206e584ab2afd457e8a605872cb4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nab9af1206e584ab2afd457e8a605872cb7 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb5 .
-_:nab9af1206e584ab2afd457e8a605872cb7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:nab9af1206e584ab2afd457e8a605872cb8 .
-
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:nab9af1206e584ab2afd457e8a605872cb6 .
-_:nab9af1206e584ab2afd457e8a605872cb8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-
-

33. RMLTC-CC-0008-ROMa

-

Title: Elements via reference object-map.

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMa/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [ 
-        rml:objectMap [
-                rml:reference "ID" ; rml:termType rml:BlankNode ;
-                rml:gather ( 
-                    [ 
-                        rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                        rml:joinCondition [ rml:child "Sport" ; rml:parent "Sport" ] ;
-                    ] 
-                ) ;
-                rml:gatherAs rdf:List;
-            ] ;    
-        rml:predicate ex:sameSportAs 
-    ] ;
-
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid1 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid3 .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid5 .
-
-
-

34. RMLTC-CC-0008-ROMb

-

Title: Elements via reference object-map with default join condition

-

Description: Testing whether gather maps generate an RDF list whose members are generated by a referencing object-map with a default join condition.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0008-ROMb/Friends.json

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-
-_:b273446 a rml:RelativePathSource ;
-    rml:path "student.csv" .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap ;
-    rml:logicalSource [ a rml:LogicalSource ;
-            rml:referenceFormulation rml:CSV ;
-            rml:source _:b273446 ] ;
-            
-    rml:predicateObjectMap [
-        rml:objectMap [
-            rml:reference "ID" ; rml:termType rml:BlankNode ;
-            rml:gather ( 
-                [ 
-                    rml:parentTriplesMap <http://example.com/base/TriplesMap1> ;
-                ] 
-            ) ;
-            rml:gatherAs rdf:List;
-        ] ;
-        rml:predicate ex:sameSportAs 
-    ] ;
-        
-    rml:subjectMap [ rml:template "http://example.com/Student/{ID}/{Name}" ] .
-
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/30/Loena%20Hendrickx> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> _:genid1 .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/20/Serena%20Williams> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> _:genid2 .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://example.com/Student/10/Venus%20Williams> .
-_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> _:genid3 .
-
-
-

35. RMLTC-CC-0009-DUP-Bag

-

Title: Gather duplicate values in an RDF Bag

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create an RDF Bag.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-Bag/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:Bag ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "9" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "1" .
-<http://example.com/base/e/b> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b2 .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" .
-<http://example.com/base/e/c> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b3 .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:nc808fbd2e11a4baa939c61c8210b5909b1 .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "2" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "7" .
-_:nc808fbd2e11a4baa939c61c8210b5909b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "6" .
-_:nc808fbd2e11a4baa939c61c8210b5909b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_3> "1" .
-_:nc808fbd2e11a4baa939c61c8210b5909b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "8" .
-
-
-

36. RMLTC-CC-0009-DUP-List

-

Title: Gather duplicate values in an RDF List

-

Description: Testing the expected behavior of multi-valued expression maps containing duplicate values when these expression maps are used in a gather map to create a list.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0009-DUP-List/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
<http://example.com/base/e/a> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab1 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab2 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab3 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/b> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab4 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab5 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab6 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "6" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-<http://example.com/base/e/c> <http://example.com/ns#with> _:n988e0f11d19c486fa3b3255f94c9b3bab7 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "7" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab8 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "8" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab8 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:n988e0f11d19c486fa3b3255f94c9b3bab9 .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "9" .
-_:n988e0f11d19c486fa3b3255f94c9b3bab9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
-
-
-

37. RMLTC-CC-0010-Lista

-

Title: Combining graph maps and gather maps (graph map has a template and gather map does not)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, a blank node for each list is expected.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Lista/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid2 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
-

38. RMLTC-CC-0010-Listb

-

Title: Combining graph maps and gather maps (both graph map and gather map have a template)

-

Description: Tests the behavior of combining graph- and gather maps. In this example, lists are concatinated in some named graphs via blank node identifiers constructed with templates.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTC-CC-0010-Listb/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/>.
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
-@prefix ex:  <http://example.com/ns#>.
-
-<http://example.com/base#TM> a rml:TriplesMap;
-    rml:logicalSource [
-        rml:source _:b738439 ;
-        rml:referenceFormulation rml:JSONPath ;
-        rml:iterator "$.*" ;
-    ] ;
-
-    rml:subjectMap [
-        rml:template "e/{$.id}" ;
-    ] ;
-
-    rml:predicateObjectMap [
-        rml:graphMap [ rml:template "g/{$.graph}" ; ] ;
-        rml:predicate ex:with ;
-        rml:objectMap [
-            rml:template "l/{$.id}" ; rml:termType rml:BlankNode ;
-            rml:gather ( [ rml:reference "$.values.*" ; ] ) ;
-            rml:gatherAs rdf:List ;
-        ] ;
-    ] ;
-.
-
-_:b738439 a rml:RelativePathSource ;
-    rml:path "data.json" .
-
-

Output

-
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "1" <http://example.com/base/g/1> .
-_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "3" <http://example.com/base/g/1> .
-_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/1> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genid1 <http://example.com/base/g/1> .
-
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "2" <http://example.com/base/g/2> .
-_:genidx1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://example.com/base/g/2> .
-<http://example.com/base/e/a> <http://example.com/ns#with> _:genidx1 <http://example.com/base/g/2> .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-cc/section/abstract.md b/src/test/resources/rml-cc/section/abstract.md deleted file mode 100644 index 7b13b04..0000000 --- a/src/test/resources/rml-cc/section/abstract.md +++ /dev/null @@ -1 +0,0 @@ -This document defines the RML-CC test cases to the determine the RML-CC specification conformance of tools. diff --git a/src/test/resources/rml-cc/section/data-model.md b/src/test/resources/rml-cc/section/data-model.md deleted file mode 100644 index f4c3ad6..0000000 --- a/src/test/resources/rml-cc/section/data-model.md +++ /dev/null @@ -1,12 +0,0 @@ -# Data model - -The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). -Each `test:Testcase` as the following properties: - -- `dcterms:identifier`: unique ID of the test case. -- `rmltest:hasError`: if an error of the RML Processor is expected or not. -- `rmltest:input`: One or more input data of the test case. -- `rmltest:output`: One or more output data of the test case. -- `rmltest:inputFormat`: the input data format. -- `rmltest:outputFormat`: the output data format. -- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-cc/section/introduction.md b/src/test/resources/rml-cc/section/introduction.md deleted file mode 100644 index 55ab17e..0000000 --- a/src/test/resources/rml-cc/section/introduction.md +++ /dev/null @@ -1,4 +0,0 @@ -# Introduction - -This document defines the RML-CC test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-CC specification. diff --git a/src/test/resources/rml-cc/section/test-cases.md b/src/test/resources/rml-cc/section/test-cases.md deleted file mode 100644 index 7d81b94..0000000 --- a/src/test/resources/rml-cc/section/test-cases.md +++ /dev/null @@ -1,10 +0,0 @@ -# Test cases - -This section describes the RML-CC test cases. These descriptions are also available as RDF. -The files are available on [GitHub](https://github.com/kg-construct/rml-cc/tree/main/test-cases) in the folder `test-cases`. -Each test case is contained in a single folder, containing three types of files: - - - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. - - One file with the RML rules, called `mapping.ttl`, in the Turtle format. - - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. - diff --git a/src/test/resources/rml-core-gm/RMLTC0001/mapping.ttl b/src/test/resources/rml-core-gm/RMLTC0001/mapping.ttl deleted file mode 100644 index ed81291..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0001/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students/{ID}" ; - rml:class foaf:Person ; - ] . diff --git a/src/test/resources/rml-core-gm/RMLTC0001/output.nq b/src/test/resources/rml-core-gm/RMLTC0001/output.nq deleted file mode 100644 index f0f00d6..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0001/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - "Venus" . \ No newline at end of file diff --git a/src/test/resources/rml-core-gm/RMLTC0001/student.json b/src/test/resources/rml-core-gm/RMLTC0001/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0001/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core-gm/RMLTC0002/mapping.ttl b/src/test/resources/rml-core-gm/RMLTC0002/mapping.ttl deleted file mode 100644 index 7accac6..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0002/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name ; - rml:graph rml:defaultGraph ; - ]; - rml:subjectMap [ - rml:template "students/{ID}" ; - rml:class foaf:Person ; - rml:graph rml:defaultGraph ; - ] . diff --git a/src/test/resources/rml-core-gm/RMLTC0002/output.nq b/src/test/resources/rml-core-gm/RMLTC0002/output.nq deleted file mode 100644 index f0f00d6..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0002/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - "Venus" . \ No newline at end of file diff --git a/src/test/resources/rml-core-gm/RMLTC0002/student.json b/src/test/resources/rml-core-gm/RMLTC0002/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0002/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core-gm/RMLTC0003/mapping.ttl b/src/test/resources/rml-core-gm/RMLTC0003/mapping.ttl deleted file mode 100644 index c447396..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0003/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name ; - ]; - rml:subjectMap [ - rml:template "students/{ID}" ; - rml:class foaf:Person ; - rml:graphMap [ rml:template "g/{ID}" ; ] ; - ] . diff --git a/src/test/resources/rml-core-gm/RMLTC0003/output.nq b/src/test/resources/rml-core-gm/RMLTC0003/output.nq deleted file mode 100644 index e8880a5..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0003/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - . \ No newline at end of file diff --git a/src/test/resources/rml-core-gm/RMLTC0003/student.json b/src/test/resources/rml-core-gm/RMLTC0003/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0003/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core-gm/RMLTC0004/mapping.ttl b/src/test/resources/rml-core-gm/RMLTC0004/mapping.ttl deleted file mode 100644 index d687d0c..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0004/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name ; - rml:graph rml:defaultGraph ; - ]; - rml:subjectMap [ - rml:template "students/{ID}" ; - rml:class foaf:Person ; - rml:graphMap [ rml:template "g/{ID}" ; ] ; - ] . diff --git a/src/test/resources/rml-core-gm/RMLTC0004/output.nq b/src/test/resources/rml-core-gm/RMLTC0004/output.nq deleted file mode 100644 index 325669f..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0004/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - "Venus" . \ No newline at end of file diff --git a/src/test/resources/rml-core-gm/RMLTC0004/student.json b/src/test/resources/rml-core-gm/RMLTC0004/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0004/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core-gm/RMLTC0005/mapping.ttl b/src/test/resources/rml-core-gm/RMLTC0005/mapping.ttl deleted file mode 100644 index 69b7a6f..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0005/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "Name" - ]; - rml:predicate foaf:name ; - rml:graphMap [ rml:template "h/{ID}" ; ] ; - ]; - rml:subjectMap [ - rml:template "students/{ID}" ; - rml:class foaf:Person ; - rml:graphMap [ rml:template "g/{ID}" ; ] ; - ] . diff --git a/src/test/resources/rml-core-gm/RMLTC0005/output.nq b/src/test/resources/rml-core-gm/RMLTC0005/output.nq deleted file mode 100644 index 90d3ca9..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0005/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - "Venus" . diff --git a/src/test/resources/rml-core-gm/RMLTC0005/student.json b/src/test/resources/rml-core-gm/RMLTC0005/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core-gm/RMLTC0005/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/README.md b/src/test/resources/rml-core/README.md deleted file mode 100644 index 831a6c7..0000000 --- a/src/test/resources/rml-core/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# RML Core test cases - -Manifest of test cases can be generated as followed: - -1. Add the testcase description in `descriptions.csv` or fetch it from the Google spreadsheet. -2. Execute the `make-metadata.py` script: `python3 make-metadata.py http://w3id.org/rml/core/` -3. Generate the manifest with RMLMapper: `java -jar rmlmapper.jar -m manifest.rml.ttl -o manifest.ttl -s turtle` - - diff --git a/src/test/resources/rml-core/RMLTC0000-JSON/README.md b/src/test/resources/rml-core/RMLTC0000-JSON/README.md deleted file mode 100644 index b8bc801..0000000 --- a/src/test/resources/rml-core/RMLTC0000-JSON/README.md +++ /dev/null @@ -1,50 +0,0 @@ -## RMLTC0000-JSON - -**Title**: "one table, one column, zero rows" - -**Description**: "Tests if an empty table produces an empty RDF graph" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Name}" - ] . - -``` - -**Output** -``` -# empty database - -``` - diff --git a/src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl deleted file mode 100644 index 41da352..0000000 --- a/src/test/resources/rml-core/RMLTC0000-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0000-JSON/output.nq b/src/test/resources/rml-core/RMLTC0000-JSON/output.nq deleted file mode 100644 index ca0b991..0000000 --- a/src/test/resources/rml-core/RMLTC0000-JSON/output.nq +++ /dev/null @@ -1 +0,0 @@ -# empty database diff --git a/src/test/resources/rml-core/RMLTC0000-JSON/student.json b/src/test/resources/rml-core/RMLTC0000-JSON/student.json deleted file mode 100644 index 81bf2f6..0000000 --- a/src/test/resources/rml-core/RMLTC0000-JSON/student.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "students": [] -} diff --git a/src/test/resources/rml-core/RMLTC0001a-JSON/README.md b/src/test/resources/rml-core/RMLTC0001a-JSON/README.md deleted file mode 100644 index a818198..0000000 --- a/src/test/resources/rml-core/RMLTC0001a-JSON/README.md +++ /dev/null @@ -1,53 +0,0 @@ -## RMLTC0001a-JSON - -**Title**: "One column mapping, subject URI generation by using rml:template" - -**Description**: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap . - - rml:template "http://example.com/{$.Name}" . - -``` - -**Output** -``` - "Venus" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl deleted file mode 100644 index 0a0f009..0000000 --- a/src/test/resources/rml-core/RMLTC0001a-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap . - - rml:template "http://example.com/{$.Name}" . diff --git a/src/test/resources/rml-core/RMLTC0001a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0001a-JSON/output.nq deleted file mode 100644 index 73f40dd..0000000 --- a/src/test/resources/rml-core/RMLTC0001a-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001a-JSON/student.json b/src/test/resources/rml-core/RMLTC0001a-JSON/student.json deleted file mode 100644 index b3ae4c4..0000000 --- a/src/test/resources/rml-core/RMLTC0001a-JSON/student.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "students": [{ - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0001b-JSON/README.md b/src/test/resources/rml-core/RMLTC0001b-JSON/README.md deleted file mode 100644 index a239110..0000000 --- a/src/test/resources/rml-core/RMLTC0001b-JSON/README.md +++ /dev/null @@ -1,54 +0,0 @@ -## RMLTC0001b-JSON - -**Title**: "One column mapping, generation of a BlankNode subject by using rml:termType" - -**Description**: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{$.Name}"; - rml:termType rml:BlankNode - ] . - -``` - -**Output** -``` -_:Venus "Venus" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl deleted file mode 100644 index 5d0a567..0000000 --- a/src/test/resources/rml-core/RMLTC0001b-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{$.Name}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0001b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0001b-JSON/output.nq deleted file mode 100644 index 082a16c..0000000 --- a/src/test/resources/rml-core/RMLTC0001b-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:Venus "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0001b-JSON/student.json b/src/test/resources/rml-core/RMLTC0001b-JSON/student.json deleted file mode 100644 index b3ae4c4..0000000 --- a/src/test/resources/rml-core/RMLTC0001b-JSON/student.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "students": [{ - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0002a-JSON/README.md b/src/test/resources/rml-core/RMLTC0002a-JSON/README.md deleted file mode 100644 index fc9f848..0000000 --- a/src/test/resources/rml-core/RMLTC0002a-JSON/README.md +++ /dev/null @@ -1,63 +0,0 @@ -## RMLTC0002a-JSON - -**Title**: "Two columns mapping, generation of a subject URI by the concatenation of two column values" - -**Description**: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{$.ID}/{$.Name}" - ] . - -``` - -**Output** -``` - "Venus" . - "10"^^ . - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl deleted file mode 100644 index 7cee3d8..0000000 --- a/src/test/resources/rml-core/RMLTC0002a-JSON/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{$.ID}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0002a-JSON/output.nq deleted file mode 100644 index cf274fb..0000000 --- a/src/test/resources/rml-core/RMLTC0002a-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus" . - "10"^^ . - . - diff --git a/src/test/resources/rml-core/RMLTC0002a-JSON/student.json b/src/test/resources/rml-core/RMLTC0002a-JSON/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core/RMLTC0002a-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0002b-JSON/README.md b/src/test/resources/rml-core/RMLTC0002b-JSON/README.md deleted file mode 100644 index 09891e2..0000000 --- a/src/test/resources/rml-core/RMLTC0002b-JSON/README.md +++ /dev/null @@ -1,55 +0,0 @@ -## RMLTC0002b-JSON - -**Title**: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType" - -**Description**: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{$.ID}"; - rml:termType rml:BlankNode - ] . - -``` - -**Output** -``` -_:students10 "Venus" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl deleted file mode 100644 index fb76dbc..0000000 --- a/src/test/resources/rml-core/RMLTC0002b-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "students{$.ID}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0002b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0002b-JSON/output.nq deleted file mode 100644 index be918d0..0000000 --- a/src/test/resources/rml-core/RMLTC0002b-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ -_:students10 "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0002b-JSON/student.json b/src/test/resources/rml-core/RMLTC0002b-JSON/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core/RMLTC0002b-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0002e-JSON/README.md b/src/test/resources/rml-core/RMLTC0002e-JSON/README.md deleted file mode 100644 index 0324c94..0000000 --- a/src/test/resources/rml-core/RMLTC0002e-JSON/README.md +++ /dev/null @@ -1,47 +0,0 @@ -## RMLTC0002e-JSON - -**Title**: "Two columns mapping, an undefined rml:path" - -**Description**: "Tests the presence of an undefined rml:path" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student2.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.ID}/{$.Name}" - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl deleted file mode 100644 index 5fff6df..0000000 --- a/src/test/resources/rml-core/RMLTC0002e-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student2.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.ID}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002e-JSON/student.json b/src/test/resources/rml-core/RMLTC0002e-JSON/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core/RMLTC0002e-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0002g-JSON/README.md b/src/test/resources/rml-core/RMLTC0002g-JSON/README.md deleted file mode 100644 index 512f5cb..0000000 --- a/src/test/resources/rml-core/RMLTC0002g-JSON/README.md +++ /dev/null @@ -1,47 +0,0 @@ -## RMLTC0002g-JSON - -**Title**: "Two columns mapping, invalid JSONPath" - -**Description**: "Test the presence of an invalid JSONPath" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student2.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.ID}/{$.Name}" - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl deleted file mode 100644 index f13174c..0000000 --- a/src/test/resources/rml-core/RMLTC0002g-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student2.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.IDs" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.ID}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0002g-JSON/student.json b/src/test/resources/rml-core/RMLTC0002g-JSON/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core/RMLTC0002g-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0003c-JSON/README.md b/src/test/resources/rml-core/RMLTC0003c-JSON/README.md deleted file mode 100644 index 722070b..0000000 --- a/src/test/resources/rml-core/RMLTC0003c-JSON/README.md +++ /dev/null @@ -1,55 +0,0 @@ -## RMLTC0003c-JSON - -**Title**: "Three columns mapping, by using a rml:template to produce literal" - -**Description**: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.FirstName} {$.LastName}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{$.ID}" - ] . - -``` - -**Output** -``` - "Venus Williams" . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl deleted file mode 100644 index 0b42150..0000000 --- a/src/test/resources/rml-core/RMLTC0003c-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.FirstName} {$.LastName}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student{$.ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0003c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0003c-JSON/output.nq deleted file mode 100644 index 180f90c..0000000 --- a/src/test/resources/rml-core/RMLTC0003c-JSON/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus Williams" . diff --git a/src/test/resources/rml-core/RMLTC0003c-JSON/student.json b/src/test/resources/rml-core/RMLTC0003c-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0003c-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0004a-JSON/README.md b/src/test/resources/rml-core/RMLTC0004a-JSON/README.md deleted file mode 100644 index 9930094..0000000 --- a/src/test/resources/rml-core/RMLTC0004a-JSON/README.md +++ /dev/null @@ -1,79 +0,0 @@ -## RMLTC0004a-JSON - -**Title**: "Two column mapping, from one row table to two different triples" - -**Description**: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "Student": "Venus", - "Sport":"Tennis" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Student" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{$.Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Sport" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{$.Sport}" - ] . - -``` - -**Output** -``` - "Venus" . - . - "Tennis" . - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl deleted file mode 100644 index ff87cbc..0000000 --- a/src/test/resources/rml-core/RMLTC0004a-JSON/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Student" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student; - rml:template "http://example.com/{$.Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Sport" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Sport; - rml:template "http://example.com/{$.Sport}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0004a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0004a-JSON/output.nq deleted file mode 100644 index 164ca8b..0000000 --- a/src/test/resources/rml-core/RMLTC0004a-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - . - "Tennis" . - . - diff --git a/src/test/resources/rml-core/RMLTC0004a-JSON/student_sport.json b/src/test/resources/rml-core/RMLTC0004a-JSON/student_sport.json deleted file mode 100644 index 5e537b3..0000000 --- a/src/test/resources/rml-core/RMLTC0004a-JSON/student_sport.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "Student": "Venus", - "Sport":"Tennis" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0004b-JSON/README.md b/src/test/resources/rml-core/RMLTC0004b-JSON/README.md deleted file mode 100644 index 447cd83..0000000 --- a/src/test/resources/rml-core/RMLTC0004b-JSON/README.md +++ /dev/null @@ -1,47 +0,0 @@ -## RMLTC0004b-JSON - -**Title**: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap" - -**Description**: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Name}"; - rml:termType rml:Literal - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl deleted file mode 100644 index 36480e5..0000000 --- a/src/test/resources/rml-core/RMLTC0004b-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Name}"; - rml:termType rml:Literal - ] . diff --git a/src/test/resources/rml-core/RMLTC0004b-JSON/student.json b/src/test/resources/rml-core/RMLTC0004b-JSON/student.json deleted file mode 100644 index b3ae4c4..0000000 --- a/src/test/resources/rml-core/RMLTC0004b-JSON/student.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "students": [{ - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0005a-JSON/README.md b/src/test/resources/rml-core/RMLTC0005a-JSON/README.md deleted file mode 100644 index a796f16..0000000 --- a/src/test/resources/rml-core/RMLTC0005a-JSON/README.md +++ /dev/null @@ -1,72 +0,0 @@ -## RMLTC0005a-JSON - -**Title**: "Typing of resources" - -**Description**: "Tests the typing of resources" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - { - "fname": "Bob", - "lname": "Smith", - "amount": "30.0E0" - }, - { - "fname": "Sue", - "lname": "Jones", - "amount": "20.0E0" - }, - { - "fname": "Bob", - "lname": "Smith", - "amount": "30.0E0" - } - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "ious.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{$.fname};{$.lname}" - ] . - -``` - -**Output** -``` - . - "30.0E0" . - . - "20.0E0" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0005a-JSON/ious.json b/src/test/resources/rml-core/RMLTC0005a-JSON/ious.json deleted file mode 100644 index b30b9ff..0000000 --- a/src/test/resources/rml-core/RMLTC0005a-JSON/ious.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "persons": [ - { - "fname": "Bob", - "lname": "Smith", - "amount": "30.0E0" - }, - { - "fname": "Sue", - "lname": "Jones", - "amount": "20.0E0" - }, - { - "fname": "Bob", - "lname": "Smith", - "amount": "30.0E0" - } - ] -} diff --git a/src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl deleted file mode 100644 index d692582..0000000 --- a/src/test/resources/rml-core/RMLTC0005a-JSON/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "ious.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{$.fname};{$.lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0005a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0005a-JSON/output.nq deleted file mode 100644 index 64e91da..0000000 --- a/src/test/resources/rml-core/RMLTC0005a-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "30.0E0" . - . - "20.0E0" . - diff --git a/src/test/resources/rml-core/RMLTC0006a-JSON/README.md b/src/test/resources/rml-core/RMLTC0006a-JSON/README.md deleted file mode 100644 index c901da5..0000000 --- a/src/test/resources/rml-core/RMLTC0006a-JSON/README.md +++ /dev/null @@ -1,58 +0,0 @@ -## RMLTC0006a-JSON - -**Title**: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap" - -**Description**: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . - -``` - -**Output** -``` - "Bad Student" . -``` - diff --git a/src/test/resources/rml-core/RMLTC0006a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0006a-JSON/mapping.ttl deleted file mode 100644 index 3196ff7..0000000 --- a/src/test/resources/rml-core/RMLTC0006a-JSON/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:constant "Bad Student" - ]; - rml:predicateMap [ - rml:constant ex:description - ] - ]; - rml:subjectMap [ - rml:constant ex:BadStudent; - rml:graphMap [ - rml:constant - ] - ] . diff --git a/src/test/resources/rml-core/RMLTC0006a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0006a-JSON/output.nq deleted file mode 100644 index 4e6fd3e..0000000 --- a/src/test/resources/rml-core/RMLTC0006a-JSON/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Bad Student" . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0006a-JSON/student.json b/src/test/resources/rml-core/RMLTC0006a-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0006a-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007a-JSON/README.md b/src/test/resources/rml-core/RMLTC0007a-JSON/README.md deleted file mode 100644 index 54b13a3..0000000 --- a/src/test/resources/rml-core/RMLTC0007a-JSON/README.md +++ /dev/null @@ -1,54 +0,0 @@ -## RMLTC0007a-JSON - -**Title**: "Typing resources by relying on rdf:type predicate" - -**Description**: "Tests the typing resources by relying on rdf:type predicate" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . - -``` - -**Output** -``` - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl deleted file mode 100644 index ac7b148..0000000 --- a/src/test/resources/rml-core/RMLTC0007a-JSON/mapping.ttl +++ /dev/null @@ -1,20 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007a-JSON/output.nq deleted file mode 100644 index 76f87f8..0000000 --- a/src/test/resources/rml-core/RMLTC0007a-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - . - diff --git a/src/test/resources/rml-core/RMLTC0007a-JSON/student.json b/src/test/resources/rml-core/RMLTC0007a-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0007a-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007b-JSON/README.md b/src/test/resources/rml-core/RMLTC0007b-JSON/README.md deleted file mode 100644 index e4e921e..0000000 --- a/src/test/resources/rml-core/RMLTC0007b-JSON/README.md +++ /dev/null @@ -1,62 +0,0 @@ -## RMLTC0007b-JSON - -**Title**: "Assigning triples to Named Graphs" - -**Description**: "Tests the generation of triples to a named graph" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . - -``` - -**Output** -``` - "Venus" . - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl deleted file mode 100644 index d904352..0000000 --- a/src/test/resources/rml-core/RMLTC0007b-JSON/mapping.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007b-JSON/output.nq deleted file mode 100644 index 5c4eb26..0000000 --- a/src/test/resources/rml-core/RMLTC0007b-JSON/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007b-JSON/student.json b/src/test/resources/rml-core/RMLTC0007b-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0007b-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007c-JSON/README.md b/src/test/resources/rml-core/RMLTC0007c-JSON/README.md deleted file mode 100644 index 7d4dab8..0000000 --- a/src/test/resources/rml-core/RMLTC0007c-JSON/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLTC0007c-JSON - -**Title**: "One row mapping, using rml:class" - -**Description**: "Tests subjectmap with more than one class IRIs, rml:class" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . - -``` - -**Output** -``` - "Venus" . - "10"^^ . - . - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl deleted file mode 100644 index 6576410..0000000 --- a/src/test/resources/rml-core/RMLTC0007c-JSON/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class ex:Student, foaf:Person; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007c-JSON/output.nq deleted file mode 100644 index ae78ddf..0000000 --- a/src/test/resources/rml-core/RMLTC0007c-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007c-JSON/student.json b/src/test/resources/rml-core/RMLTC0007c-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0007c-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007d-JSON/README.md b/src/test/resources/rml-core/RMLTC0007d-JSON/README.md deleted file mode 100644 index 9404294..0000000 --- a/src/test/resources/rml-core/RMLTC0007d-JSON/README.md +++ /dev/null @@ -1,71 +0,0 @@ -## RMLTC0007d-JSON - -**Title**: "One column mapping, specifying an rml:predicateObjectMap with rdf:type" - -**Description**: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . - -``` - -**Output** -``` - "Venus" . - "10"^^ . - . - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl deleted file mode 100644 index fe8e475..0000000 --- a/src/test/resources/rml-core/RMLTC0007d-JSON/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:object ex:Student; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007d-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007d-JSON/output.nq deleted file mode 100644 index 2232abd..0000000 --- a/src/test/resources/rml-core/RMLTC0007d-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Venus" . - "10"^^ . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0007d-JSON/student.json b/src/test/resources/rml-core/RMLTC0007d-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0007d-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007e-JSON/README.md b/src/test/resources/rml-core/RMLTC0007e-JSON/README.md deleted file mode 100644 index d4a1458..0000000 --- a/src/test/resources/rml-core/RMLTC0007e-JSON/README.md +++ /dev/null @@ -1,64 +0,0 @@ -## RMLTC0007e-JSON - -**Title**: "One column mapping, using rml:graphMap and rml:class" - -**Description**: "Tests subjectmap with rml:graphMap and rml:class" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . - -``` - -**Output** -``` - "10"^^ . - "Venus" . - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl deleted file mode 100644 index 19e307c..0000000 --- a/src/test/resources/rml-core/RMLTC0007e-JSON/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007e-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007e-JSON/output.nq deleted file mode 100644 index c5ea4c4..0000000 --- a/src/test/resources/rml-core/RMLTC0007e-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "10"^^ . - "Venus" . - . - diff --git a/src/test/resources/rml-core/RMLTC0007e-JSON/student.json b/src/test/resources/rml-core/RMLTC0007e-JSON/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core/RMLTC0007e-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007f-JSON/README.md b/src/test/resources/rml-core/RMLTC0007f-JSON/README.md deleted file mode 100644 index f9cff3b..0000000 --- a/src/test/resources/rml-core/RMLTC0007f-JSON/README.md +++ /dev/null @@ -1,68 +0,0 @@ -## RMLTC0007f-JSON - -**Title**: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type" - -**Description**: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . - -``` - -**Output** -``` - . - "Venus" . - "10"^^ . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl deleted file mode 100644 index 8dd905c..0000000 --- a/src/test/resources/rml-core/RMLTC0007f-JSON/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph ex:PersonGraph; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007f-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007f-JSON/output.nq deleted file mode 100644 index fb6a536..0000000 --- a/src/test/resources/rml-core/RMLTC0007f-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - . - "Venus" . - "10"^^ . - diff --git a/src/test/resources/rml-core/RMLTC0007f-JSON/student.json b/src/test/resources/rml-core/RMLTC0007f-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0007f-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007g-JSON/README.md b/src/test/resources/rml-core/RMLTC0007g-JSON/README.md deleted file mode 100644 index bc7e645..0000000 --- a/src/test/resources/rml-core/RMLTC0007g-JSON/README.md +++ /dev/null @@ -1,56 +0,0 @@ -## RMLTC0007g-JSON - -**Title**: "Assigning triples to the default graph" - -**Description**: "Tests the generation of triples to the default graph" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . - -``` - -**Output** -``` - "Venus" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl deleted file mode 100644 index bfacef7..0000000 --- a/src/test/resources/rml-core/RMLTC0007g-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graph rml:defaultGraph; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007g-JSON/output.nq b/src/test/resources/rml-core/RMLTC0007g-JSON/output.nq deleted file mode 100644 index 6c29bcc..0000000 --- a/src/test/resources/rml-core/RMLTC0007g-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus" . - diff --git a/src/test/resources/rml-core/RMLTC0007g-JSON/student.json b/src/test/resources/rml-core/RMLTC0007g-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0007g-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0007h-JSON/README.md b/src/test/resources/rml-core/RMLTC0007h-JSON/README.md deleted file mode 100644 index acb6395..0000000 --- a/src/test/resources/rml-core/RMLTC0007h-JSON/README.md +++ /dev/null @@ -1,52 +0,0 @@ -## RMLTC0007h-JSON - -**Title**: "Assigning triples to a non-IRI named graph" - -**Description**: "Tests the generation of triples to a non-IRI named graph, which is an error" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "$.ID"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl deleted file mode 100644 index c79dd6e..0000000 --- a/src/test/resources/rml-core/RMLTC0007h-JSON/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:graphMap [ - rml:reference "$.ID"; - rml:termType rml:Literal - ]; - rml:template "http://example.com/Student/{$.ID}/{$.FirstName}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0007h-JSON/student.json b/src/test/resources/rml-core/RMLTC0007h-JSON/student.json deleted file mode 100644 index dcdd938..0000000 --- a/src/test/resources/rml-core/RMLTC0007h-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "FirstName":"Venus", - "LastName":"Williams" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0008a-JSON/README.md b/src/test/resources/rml-core/RMLTC0008a-JSON/README.md deleted file mode 100644 index a084146..0000000 --- a/src/test/resources/rml-core/RMLTC0008a-JSON/README.md +++ /dev/null @@ -1,76 +0,0 @@ -## RMLTC0008a-JSON - -**Title**: "Generation of triples to a target graph by using rml:graphMap and rml:template" - -**Description**: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.Sport" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}" - ]; - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . - -``` - -**Output** -``` - . - "Venus Williams" . - "10" . - "Tennis" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl deleted file mode 100644 index c12600c..0000000 --- a/src/test/resources/rml-core/RMLTC0008a-JSON/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.Sport" - ]; - rml:predicate ex:Sport - ]; - rml:subjectMap [ - rml:graphMap [ - rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}" - ]; - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0008a-JSON/output.nq deleted file mode 100644 index 2856ef2..0000000 --- a/src/test/resources/rml-core/RMLTC0008a-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "Venus Williams" . - "10" . - "Tennis" . - diff --git a/src/test/resources/rml-core/RMLTC0008a-JSON/student.json b/src/test/resources/rml-core/RMLTC0008a-JSON/student.json deleted file mode 100644 index cd7526f..0000000 --- a/src/test/resources/rml-core/RMLTC0008a-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0008b-JSON/README.md b/src/test/resources/rml-core/RMLTC0008b-JSON/README.md deleted file mode 100644 index 8e3e8ed..0000000 --- a/src/test/resources/rml-core/RMLTC0008b-JSON/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLTC0008b-JSON - -**Title**: "Generation of triples referencing object map" - -**Description**: "Tests the mapping specification referencing object map without join" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }] -} - -``` - -**Mapping** -``` -@prefix activity: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . - - a rml:RefObjectMap; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Sport}" - ] . - -``` - -**Output** -``` - . - "Venus Williams" . - "10"^^ . - . - . - - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl deleted file mode 100644 index 9aba67e..0000000 --- a/src/test/resources/rml-core/RMLTC0008b-JSON/mapping.ttl +++ /dev/null @@ -1,55 +0,0 @@ -@prefix activity: . -@prefix ex: . -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:Sport - ], [ - rml:object foaf:Person; - rml:predicate rdf:type - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ], [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . - - a rml:RefObjectMap; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object activity:Sport; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Sport}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0008b-JSON/output.nq deleted file mode 100644 index a2678fa..0000000 --- a/src/test/resources/rml-core/RMLTC0008b-JSON/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - "Venus Williams" . - "10"^^ . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0008b-JSON/student.json b/src/test/resources/rml-core/RMLTC0008b-JSON/student.json deleted file mode 100644 index cd7526f..0000000 --- a/src/test/resources/rml-core/RMLTC0008b-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0008c-JSON/README.md b/src/test/resources/rml-core/RMLTC0008c-JSON/README.md deleted file mode 100644 index fd07d45..0000000 --- a/src/test/resources/rml-core/RMLTC0008c-JSON/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## RMLTC0008c-JSON - -**Title**: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap" - -**Description**: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . - -``` - -**Output** -``` - "Venus Williams" . - "Venus Williams" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl deleted file mode 100644 index a610a24..0000000 --- a/src/test/resources/rml-core/RMLTC0008c-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:name, foaf:name - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0008c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0008c-JSON/output.nq deleted file mode 100644 index d36f700..0000000 --- a/src/test/resources/rml-core/RMLTC0008c-JSON/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Venus Williams" . - "Venus Williams" . - diff --git a/src/test/resources/rml-core/RMLTC0008c-JSON/student.json b/src/test/resources/rml-core/RMLTC0008c-JSON/student.json deleted file mode 100644 index cd7526f..0000000 --- a/src/test/resources/rml-core/RMLTC0008c-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0009a-JSON/README.md b/src/test/resources/rml-core/RMLTC0009a-JSON/README.md deleted file mode 100644 index 6bb9aef..0000000 --- a/src/test/resources/rml-core/RMLTC0009a-JSON/README.md +++ /dev/null @@ -1,105 +0,0 @@ -## RMLTC0009a-JSON - -**Title**: "Generation of triples from foreign key relations" - -**Description**: "Test foreign key relationships among logical tables" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students" : [ - { - "ID": 10, - "Sport": 100, - "Name": "Venus Williams" - }, - { - "ID": 20, - "Name": "Demi Moore" - } - ] -} - -``` - -**Input 1** -``` -{ - "sports": [ - { - "ID": 100, - "Name": "Tennis" - } - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "$.Sport"; - rml:parent "$.ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{$.ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.sports[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{$.ID}" - ] . - -``` - -**Output** -``` - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl deleted file mode 100644 index 596bd13..0000000 --- a/src/test/resources/rml-core/RMLTC0009a-JSON/mapping.ttl +++ /dev/null @@ -1,50 +0,0 @@ -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "$.Sport"; - rml:parent "$.ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/student_{$.ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.sports[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/resource/sport_{$.ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0009a-JSON/output.nq deleted file mode 100644 index b0b89f8..0000000 --- a/src/test/resources/rml-core/RMLTC0009a-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Venus Williams" . - "Demi Moore" . - "Tennis" . - . diff --git a/src/test/resources/rml-core/RMLTC0009a-JSON/sport.json b/src/test/resources/rml-core/RMLTC0009a-JSON/sport.json deleted file mode 100644 index 98b8970..0000000 --- a/src/test/resources/rml-core/RMLTC0009a-JSON/sport.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "sports": [ - { - "ID": 100, - "Name": "Tennis" - } - ] -} diff --git a/src/test/resources/rml-core/RMLTC0009a-JSON/student.json b/src/test/resources/rml-core/RMLTC0009a-JSON/student.json deleted file mode 100644 index a99528c..0000000 --- a/src/test/resources/rml-core/RMLTC0009a-JSON/student.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "students" : [ - { - "ID": 10, - "Sport": 100, - "Name": "Venus Williams" - }, - { - "ID": 20, - "Name": "Demi Moore" - } - ] -} diff --git a/src/test/resources/rml-core/RMLTC0009b-JSON/README.md b/src/test/resources/rml-core/RMLTC0009b-JSON/README.md deleted file mode 100644 index 051d9bb..0000000 --- a/src/test/resources/rml-core/RMLTC0009b-JSON/README.md +++ /dev/null @@ -1,115 +0,0 @@ -## RMLTC0009b-JSON - -**Title**: "Generation of triples to multiple graphs" - -**Description**: "Test that results from distinct parts of the mapping can be directed to different target graphs." - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students" : [ - { - "ID": 10, - "Sport": 100, - "Name": "Venus Williams" - }, - { - "ID": 20, - "Name": "Demi Moore" - } - ] -} - -``` - -**Input 1** -``` -{ - "sports": [ - { - "ID": 100, - "Name": "Tennis" - } - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "$.Sport"; - rml:parent "$.ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{$.ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.sports[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{$.ID}" - ] . - -``` - -**Output** -``` - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl deleted file mode 100644 index 4a12b17..0000000 --- a/src/test/resources/rml-core/RMLTC0009b-JSON/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix foaf: . -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:graph ; - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:graph ; - rml:objectMap [ a rml:RefObjectMap; - rml:joinCondition [ - rml:child "$.Sport"; - rml:parent "$.ID" - ]; - rml:parentTriplesMap - ]; - rml:predicate - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/student_{$.ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.sports[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:class ; - rml:graph ; - rml:template "http://example.com/resource/sport_{$.ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0009b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0009b-JSON/output.nq deleted file mode 100644 index aef6b08..0000000 --- a/src/test/resources/rml-core/RMLTC0009b-JSON/output.nq +++ /dev/null @@ -1,8 +0,0 @@ - . - "Venus Williams" . - . - "Demi Moore" . - . - "Tennis" . - . - . diff --git a/src/test/resources/rml-core/RMLTC0009b-JSON/sport.json b/src/test/resources/rml-core/RMLTC0009b-JSON/sport.json deleted file mode 100644 index 98b8970..0000000 --- a/src/test/resources/rml-core/RMLTC0009b-JSON/sport.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "sports": [ - { - "ID": 100, - "Name": "Tennis" - } - ] -} diff --git a/src/test/resources/rml-core/RMLTC0009b-JSON/student.json b/src/test/resources/rml-core/RMLTC0009b-JSON/student.json deleted file mode 100644 index a99528c..0000000 --- a/src/test/resources/rml-core/RMLTC0009b-JSON/student.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "students" : [ - { - "ID": 10, - "Sport": 100, - "Name": "Venus Williams" - }, - { - "ID": 20, - "Name": "Demi Moore" - } - ] -} diff --git a/src/test/resources/rml-core/RMLTC0010a-JSON/README.md b/src/test/resources/rml-core/RMLTC0010a-JSON/README.md deleted file mode 100644 index f465982..0000000 --- a/src/test/resources/rml-core/RMLTC0010a-JSON/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLTC0010a-JSON - -**Title**: "Template with table column with blank space" - -**Description**: "Tests a template with blank space in column value" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "countries": [{ - "Country Code": 1, - "Name":"Bolivia, Plurinational State of", - "ISO 3166": "BO" - }, { - "Country Code": 2, - "Name":"Ireland", - "ISO 3166": "IE" - }, { - "Country Code": 3, - "Name":"Saint Martin (French part)", - "ISO 3166": "MF" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}" - ] . - -``` - -**Output** -``` - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0010a-JSON/country_info.json b/src/test/resources/rml-core/RMLTC0010a-JSON/country_info.json deleted file mode 100644 index 4e8d578..0000000 --- a/src/test/resources/rml-core/RMLTC0010a-JSON/country_info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "countries": [{ - "Country Code": 1, - "Name":"Bolivia, Plurinational State of", - "ISO 3166": "BO" - }, { - "Country Code": 2, - "Name":"Ireland", - "ISO 3166": "IE" - }, { - "Country Code": 3, - "Name":"Saint Martin (French part)", - "ISO 3166": "MF" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl deleted file mode 100644 index 370edb7..0000000 --- a/src/test/resources/rml-core/RMLTC0010a-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0010a-JSON/output.nq deleted file mode 100644 index 29911d6..0000000 --- a/src/test/resources/rml-core/RMLTC0010a-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010b-JSON/README.md b/src/test/resources/rml-core/RMLTC0010b-JSON/README.md deleted file mode 100644 index a91ee54..0000000 --- a/src/test/resources/rml-core/RMLTC0010b-JSON/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLTC0010b-JSON - -**Title**: "Template with table columns with special chars" - -**Description**: "Tests a template with special chars in column value" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "countries": [{ - "Country Code": 1, - "Name":"Bolivia, Plurinational State of", - "ISO 3166": "BO" - }, { - "Country Code": 2, - "Name":"Ireland", - "ISO 3166": "IE" - }, { - "Country Code": 3, - "Name":"Saint Martin (French part)", - "ISO 3166": "MF" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" - ] . - -``` - -**Output** -``` - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0010b-JSON/country_info.json b/src/test/resources/rml-core/RMLTC0010b-JSON/country_info.json deleted file mode 100644 index 4e8d578..0000000 --- a/src/test/resources/rml-core/RMLTC0010b-JSON/country_info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "countries": [{ - "Country Code": 1, - "Name":"Bolivia, Plurinational State of", - "ISO 3166": "BO" - }, { - "Country Code": 2, - "Name":"Ireland", - "ISO 3166": "IE" - }, { - "Country Code": 3, - "Name":"Saint Martin (French part)", - "ISO 3166": "MF" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl deleted file mode 100644 index 1f9f4db..0000000 --- a/src/test/resources/rml-core/RMLTC0010b-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:name - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0010b-JSON/output.nq deleted file mode 100644 index c92a08b..0000000 --- a/src/test/resources/rml-core/RMLTC0010b-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Bolivia, Plurinational State of" . - "Ireland" . - "Saint Martin (French part)" . - diff --git a/src/test/resources/rml-core/RMLTC0010c-JSON/README.md b/src/test/resources/rml-core/RMLTC0010c-JSON/README.md deleted file mode 100644 index 6229857..0000000 --- a/src/test/resources/rml-core/RMLTC0010c-JSON/README.md +++ /dev/null @@ -1,66 +0,0 @@ -## RMLTC0010c-JSON - -**Title**: "Template with table columns with special chars and backslashes" - -**Description**: "Tests a template with special chars in reference value and backslash escapes in string templates" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "countries": [{ - "Country Code": 1, - "Name":"Bolivia, Plurinational State of", - "ISO 3166": "BO" - }, { - "Country Code": 2, - "Name":"Ireland", - "ISO 3166": "IE" - }, { - "Country Code": 3, - "Name":"Saint Martin (French part)", - "ISO 3166": "MF" - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.json" - ] - ]; - rml:predicateObjectMap [ - rml:predicate ex:code; - rml:objectMap [ - rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}"; - rml:termType rml:Literal - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" - ] . - -``` - -**Output** -``` - "{{{ BO }}}" . - "{{{ IE }}}" . - "{{{ MF }}}" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0010c-JSON/country_info.json b/src/test/resources/rml-core/RMLTC0010c-JSON/country_info.json deleted file mode 100644 index 4e8d578..0000000 --- a/src/test/resources/rml-core/RMLTC0010c-JSON/country_info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "countries": [{ - "Country Code": 1, - "Name":"Bolivia, Plurinational State of", - "ISO 3166": "BO" - }, { - "Country Code": 2, - "Name":"Ireland", - "ISO 3166": "IE" - }, { - "Country Code": 3, - "Name":"Saint Martin (French part)", - "ISO 3166": "MF" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl deleted file mode 100644 index fb1afc8..0000000 --- a/src/test/resources/rml-core/RMLTC0010c-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_info.json" - ] - ]; - rml:predicateObjectMap [ - rml:predicate ex:code; - rml:objectMap [ - rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}"; - rml:termType rml:Literal - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.['Country Code']}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0010c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0010c-JSON/output.nq deleted file mode 100644 index 5c7e108..0000000 --- a/src/test/resources/rml-core/RMLTC0010c-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "{{{ BO }}}" . - "{{{ IE }}}" . - "{{{ MF }}}" . - diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/README.md b/src/test/resources/rml-core/RMLTC0011b-JSON/README.md deleted file mode 100644 index 8df6890..0000000 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/README.md +++ /dev/null @@ -1,143 +0,0 @@ -## RMLTC0011b-JSON - -**Title**: "M to M relation, by using an additional Triples Map" - -**Description**: "Tests, M to M relations, by using an additional Triples Map" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [ - {"ID":10, "FirstName":"Venus", "LastName":"Williams"}, - {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"}, - {"ID":12, "FirstName":"David", "LastName":"Villa"} - ] -} - -``` - -**Input 1** -``` -{ - "sports": [ - {"ID":110, "Description":"Tennis"}, - {"ID":111, "Description":"Football"}, - {"ID":112, "Description":"Formula1"} - ] -} - -``` - -**Input 2** -``` -{ - "links": [ - {"ID_Student":10, "ID_Sport":110}, - {"ID_Student":11, "ID_Sport":111}, - {"ID_Student":11, "ID_Sport":112}, - {"ID_Student":12, "ID_Sport":111} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.links[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://example.com/sport/{$.ID_Sport}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{$.ID_Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "$.LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{$.ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.sports[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Description" - ]; - rml:predicate ex:description - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/sport/{$.ID}" - ] . - -``` - -**Output** -``` - "Williams" . - "Venus" . - "Villa" . - "David" . - "Alonso" . - "Fernando" . - "Tennis" . - "110"^^ . - "Football" . - "111"^^ . - "Formula1" . - "112"^^ . - . - . - . - . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl deleted file mode 100644 index 29ba838..0000000 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/mapping.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.links[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student_sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "http://example.com/sport/{$.ID_Sport}" - ]; - rml:predicate ex:plays - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{$.ID_Student}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate ex:firstName - ], [ - rml:objectMap [ - rml:reference "$.LastName" - ]; - rml:predicate ex:lastName - ]; - rml:subjectMap [ - rml:template "http://example.com/student/{$.ID}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.sports[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "sport.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Description" - ]; - rml:predicate ex:description - ], [ - rml:objectMap [ - rml:reference "$.ID" - ]; - rml:predicate ex:id - ]; - rml:subjectMap [ - rml:template "http://example.com/sport/{$.ID}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0011b-JSON/output.nq deleted file mode 100644 index 6a82565..0000000 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/output.nq +++ /dev/null @@ -1,17 +0,0 @@ - "Williams" . - "Venus" . - "Villa" . - "David" . - "Alonso" . - "Fernando" . - "Tennis" . - "110"^^ . - "Football" . - "111"^^ . - "Formula1" . - "112"^^ . - . - . - . - . - diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/sport.json b/src/test/resources/rml-core/RMLTC0011b-JSON/sport.json deleted file mode 100644 index 7d4615b..0000000 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/sport.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sports": [ - {"ID":110, "Description":"Tennis"}, - {"ID":111, "Description":"Football"}, - {"ID":112, "Description":"Formula1"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/student.json b/src/test/resources/rml-core/RMLTC0011b-JSON/student.json deleted file mode 100644 index 6077184..0000000 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [ - {"ID":10, "FirstName":"Venus", "LastName":"Williams"}, - {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"}, - {"ID":12, "FirstName":"David", "LastName":"Villa"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0011b-JSON/student_sport.json b/src/test/resources/rml-core/RMLTC0011b-JSON/student_sport.json deleted file mode 100644 index 19c6012..0000000 --- a/src/test/resources/rml-core/RMLTC0011b-JSON/student_sport.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "links": [ - {"ID_Student":10, "ID_Sport":110}, - {"ID_Student":11, "ID_Sport":111}, - {"ID_Student":11, "ID_Sport":112}, - {"ID_Student":12, "ID_Sport":111} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0012a-JSON/README.md b/src/test/resources/rml-core/RMLTC0012a-JSON/README.md deleted file mode 100644 index 95239e9..0000000 --- a/src/test/resources/rml-core/RMLTC0012a-JSON/README.md +++ /dev/null @@ -1,66 +0,0 @@ -## RMLTC0012a-JSON - -**Title**: "Blank node referencing multiple columns" - -**Description**: "Tests that blank nodes can be generated by referencing multiple columns" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}{$.lname}{$.amount}"; - rml:termType rml:BlankNode - ] . - -``` - -**Output** -``` -_:BobSmith30 "30"^^ . -_:BobSmith30 "Bob Smith" . -_:SueJones20 "20"^^ . -_:SueJones20 "Sue Jones" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl deleted file mode 100644 index 7caeb4c..0000000 --- a/src/test/resources/rml-core/RMLTC0012a-JSON/mapping.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}{$.lname}{$.amount}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0012a-JSON/output.nq deleted file mode 100644 index 62818b4..0000000 --- a/src/test/resources/rml-core/RMLTC0012a-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith30 "30"^^ . -_:BobSmith30 "Bob Smith" . -_:SueJones20 "20"^^ . -_:SueJones20 "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012a-JSON/persons.json b/src/test/resources/rml-core/RMLTC0012a-JSON/persons.json deleted file mode 100644 index 513e989..0000000 --- a/src/test/resources/rml-core/RMLTC0012a-JSON/persons.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0012b-JSON/README.md b/src/test/resources/rml-core/RMLTC0012b-JSON/README.md deleted file mode 100644 index 8f51b22..0000000 --- a/src/test/resources/rml-core/RMLTC0012b-JSON/README.md +++ /dev/null @@ -1,93 +0,0 @@ -## RMLTC0012b-JSON - -**Title**: "Duplicate tuples generate same blank node" - -**Description**: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent." - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "lives": [ - {"fname":"Bob","lname":"Smith","city":"London"}, - {"fname":"Sue","lname":"Jones","city":"Madrid"}, - {"fname":"Bob","lname":"Smith","city":"London"} - ] -} - -``` - -**Input 1** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{$.fname}{$.lname}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.lives[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "lives.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.city" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{$.fname}{$.lname}"; - rml:termType rml:BlankNode - ] . - -``` - -**Output** -``` -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0012b-JSON/lives.json b/src/test/resources/rml-core/RMLTC0012b-JSON/lives.json deleted file mode 100644 index 6ffc360..0000000 --- a/src/test/resources/rml-core/RMLTC0012b-JSON/lives.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "lives": [ - {"fname":"Bob","lname":"Smith","city":"London"}, - {"fname":"Sue","lname":"Jones","city":"Madrid"}, - {"fname":"Bob","lname":"Smith","city":"London"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl deleted file mode 100644 index 82aa3b3..0000000 --- a/src/test/resources/rml-core/RMLTC0012b-JSON/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:template "{$.fname}{$.lname}"; - rml:termType rml:BlankNode - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.lives[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "lives.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.city" - ]; - rml:predicate ex:city - ]; - rml:subjectMap [ - rml:template "{$.fname}{$.lname}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0012b-JSON/output.nq deleted file mode 100644 index 0d556bb..0000000 --- a/src/test/resources/rml-core/RMLTC0012b-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ -_:BobSmith "London" . -_:BobSmith "Bob Smith" . -_:SueJones "Madrid" . -_:SueJones "Sue Jones" . - diff --git a/src/test/resources/rml-core/RMLTC0012b-JSON/persons.json b/src/test/resources/rml-core/RMLTC0012b-JSON/persons.json deleted file mode 100644 index 513e989..0000000 --- a/src/test/resources/rml-core/RMLTC0012b-JSON/persons.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0012c-JSON/README.md b/src/test/resources/rml-core/RMLTC0012c-JSON/README.md deleted file mode 100644 index c65174c..0000000 --- a/src/test/resources/rml-core/RMLTC0012c-JSON/README.md +++ /dev/null @@ -1,52 +0,0 @@ -## RMLTC0012c-JSON - -**Title**: "TriplesMap without subjectMap" - -**Description**: "Tests a RML with missing information, TriplesMap without subjectMap." - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl deleted file mode 100644 index c458a4a..0000000 --- a/src/test/resources/rml-core/RMLTC0012c-JSON/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ] . diff --git a/src/test/resources/rml-core/RMLTC0012c-JSON/persons.json b/src/test/resources/rml-core/RMLTC0012c-JSON/persons.json deleted file mode 100644 index 513e989..0000000 --- a/src/test/resources/rml-core/RMLTC0012c-JSON/persons.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0012d-JSON/README.md b/src/test/resources/rml-core/RMLTC0012d-JSON/README.md deleted file mode 100644 index 3b3dfa9..0000000 --- a/src/test/resources/rml-core/RMLTC0012d-JSON/README.md +++ /dev/null @@ -1,59 +0,0 @@ -## RMLTC0012d-JSON - -**Title**: "TriplesMap with two subjectMap" - -**Description**: "Tests a RML with wrong information, TriplesMap with two subjectMap." - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}_{$.lname}_{$.amount}"; - rml:termType rml:BlankNode - ], [ - rml:template "{$.amount}_{$.fname}_{$.lname}"; - rml:termType rml:BlankNode - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl deleted file mode 100644 index a8baa08..0000000 --- a/src/test/resources/rml-core/RMLTC0012d-JSON/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:template "{$.fname} {$.lname}"; - rml:termType rml:Literal - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}_{$.lname}_{$.amount}"; - rml:termType rml:BlankNode - ], [ - rml:template "{$.amount}_{$.fname}_{$.lname}"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0012d-JSON/persons.json b/src/test/resources/rml-core/RMLTC0012d-JSON/persons.json deleted file mode 100644 index 513e989..0000000 --- a/src/test/resources/rml-core/RMLTC0012d-JSON/persons.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20}, - {"fname":"Bob","lname":"Smith","amount":30} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0013a-JSON/README.md b/src/test/resources/rml-core/RMLTC0013a-JSON/README.md deleted file mode 100644 index 8a42b80..0000000 --- a/src/test/resources/rml-core/RMLTC0013a-JSON/README.md +++ /dev/null @@ -1,53 +0,0 @@ -## RMLTC0013a-JSON - -**Title**: "Null value in JSON file" - -**Description**: "Tests if null values in JSON files are handled correctly." - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"ID":"1","Name":"Alice","DateOfBirth":null}, - {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.DateOfBirth" - ]; - rml:predicate ex:BirthDay - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}" - ] . - -``` - -**Output** -``` - "September, 2010" . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl deleted file mode 100644 index c1bd8dd..0000000 --- a/src/test/resources/rml-core/RMLTC0013a-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.DateOfBirth" - ]; - rml:predicate ex:BirthDay - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0013a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0013a-JSON/output.nq deleted file mode 100644 index e143b3e..0000000 --- a/src/test/resources/rml-core/RMLTC0013a-JSON/output.nq +++ /dev/null @@ -1 +0,0 @@ - "September, 2010" . diff --git a/src/test/resources/rml-core/RMLTC0013a-JSON/persons.json b/src/test/resources/rml-core/RMLTC0013a-JSON/persons.json deleted file mode 100644 index d7472e1..0000000 --- a/src/test/resources/rml-core/RMLTC0013a-JSON/persons.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "persons": [ - {"ID":"1","Name":"Alice","DateOfBirth":null}, - {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0015a-JSON/README.md b/src/test/resources/rml-core/RMLTC0015a-JSON/README.md deleted file mode 100644 index 8981212..0000000 --- a/src/test/resources/rml-core/RMLTC0015a-JSON/README.md +++ /dev/null @@ -1,79 +0,0 @@ -## RMLTC0015a-JSON - -**Title**: "Generation of language tags from a table with language information" - -**Description**: "Generation of language tags from a table with language information" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "countries": [ - {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"}, - {"Code": "IE", "Name": "Irlanda"} - ] -} - -``` - -**Mapping** -``` -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "en"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_es.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "es"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . - -``` - -**Output** -``` - "Bolivia, Plurinational State of"@en . - "Estado Plurinacional de Bolivia"@es . - "Ireland"@en . - "Irlanda"@es . - - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0015a-JSON/country_en.json b/src/test/resources/rml-core/RMLTC0015a-JSON/country_en.json deleted file mode 100644 index 84a0551..0000000 --- a/src/test/resources/rml-core/RMLTC0015a-JSON/country_en.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "countries": [ - {"Code": "BO", "Name": "Bolivia, Plurinational State of"}, - {"Code": "IE", "Name": "Ireland"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0015a-JSON/country_es.json b/src/test/resources/rml-core/RMLTC0015a-JSON/country_es.json deleted file mode 100644 index b861adf..0000000 --- a/src/test/resources/rml-core/RMLTC0015a-JSON/country_es.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "countries": [ - {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"}, - {"Code": "IE", "Name": "Irlanda"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl deleted file mode 100644 index 4c3a503..0000000 --- a/src/test/resources/rml-core/RMLTC0015a-JSON/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "en"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_es.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "es"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0015a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0015a-JSON/output.nq deleted file mode 100644 index a80dd6a..0000000 --- a/src/test/resources/rml-core/RMLTC0015a-JSON/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Bolivia, Plurinational State of"@en . - "Estado Plurinacional de Bolivia"@es . - "Ireland"@en . - "Irlanda"@es . - - diff --git a/src/test/resources/rml-core/RMLTC0015b-JSON/README.md b/src/test/resources/rml-core/RMLTC0015b-JSON/README.md deleted file mode 100644 index 006c0db..0000000 --- a/src/test/resources/rml-core/RMLTC0015b-JSON/README.md +++ /dev/null @@ -1,68 +0,0 @@ -## RMLTC0015b-JSON - -**Title**: "Generation of language tags from a table with language information, and a term map with invalid rml:language value" - -**Description**: "Tests a term map with an invalid rml:language value, which is an error" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "countries": [ - {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"}, - {"Code": "IE", "Name": "Irlanda"} - ] -} - -``` - -**Mapping** -``` -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-english"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-spanish"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0015b-JSON/country_en.json b/src/test/resources/rml-core/RMLTC0015b-JSON/country_en.json deleted file mode 100644 index 84a0551..0000000 --- a/src/test/resources/rml-core/RMLTC0015b-JSON/country_en.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "countries": [ - {"Code": "BO", "Name": "Bolivia, Plurinational State of"}, - {"Code": "IE", "Name": "Ireland"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0015b-JSON/country_es.json b/src/test/resources/rml-core/RMLTC0015b-JSON/country_es.json deleted file mode 100644 index b861adf..0000000 --- a/src/test/resources/rml-core/RMLTC0015b-JSON/country_es.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "countries": [ - {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"}, - {"Code": "IE", "Name": "Irlanda"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl deleted file mode 100644 index 6f485f7..0000000 --- a/src/test/resources/rml-core/RMLTC0015b-JSON/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rdfs: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-english"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.countries[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "country_en.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:language "a-spanish"; - rml:reference "$.Name" - ]; - rml:predicate rdfs:label - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Code}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0019a-JSON/README.md b/src/test/resources/rml-core/RMLTC0019a-JSON/README.md deleted file mode 100644 index eb11b85..0000000 --- a/src/test/resources/rml-core/RMLTC0019a-JSON/README.md +++ /dev/null @@ -1,62 +0,0 @@ -## RMLTC0019a-JSON - -**Title**: "Generation of triples by using IRI value in columns" - -**Description**: "Test the generation of triples by using IRI value in attributes" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - { - "ID": 10, - "FirstName": "http://example.com/ns#Jhon", - "LastName": "Smith" - }, - { - "ID": 20, - "FirstName": "Carlos", - "LastName": "Mendoza" - } - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "$.FirstName" - ] . - -``` - -**Output** -``` - "http://example.com/ns#Jhon" . - "Carlos" . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl deleted file mode 100644 index 2870ff6..0000000 --- a/src/test/resources/rml-core/RMLTC0019a-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "$.FirstName" - ] . diff --git a/src/test/resources/rml-core/RMLTC0019a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0019a-JSON/output.nq deleted file mode 100644 index 4a97fdf..0000000 --- a/src/test/resources/rml-core/RMLTC0019a-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "http://example.com/ns#Jhon" . - "Carlos" . diff --git a/src/test/resources/rml-core/RMLTC0019a-JSON/persons.json b/src/test/resources/rml-core/RMLTC0019a-JSON/persons.json deleted file mode 100644 index 0142050..0000000 --- a/src/test/resources/rml-core/RMLTC0019a-JSON/persons.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "persons": [ - { - "ID": 10, - "FirstName": "http://example.com/ns#Jhon", - "LastName": "Smith" - }, - { - "ID": 20, - "FirstName": "Carlos", - "LastName": "Mendoza" - } - ] -} diff --git a/src/test/resources/rml-core/RMLTC0019b-JSON/README.md b/src/test/resources/rml-core/RMLTC0019b-JSON/README.md deleted file mode 100644 index 768c29d..0000000 --- a/src/test/resources/rml-core/RMLTC0019b-JSON/README.md +++ /dev/null @@ -1,50 +0,0 @@ -## RMLTC0019b-JSON - -**Title**: "Generation of triples by using IRI value in columns, with data error" - -**Description**: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "persons": [ - { - "ID": 30, - "FirstName": "Juan Daniel", - "LastName": "Crespo" - } - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "$.FirstName" - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl deleted file mode 100644 index 2870ff6..0000000 --- a/src/test/resources/rml-core/RMLTC0019b-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.FirstName" - ]; - rml:predicate foaf:name - ]; - rml:subjectMap [ - rml:reference "$.FirstName" - ] . diff --git a/src/test/resources/rml-core/RMLTC0019b-JSON/persons.json b/src/test/resources/rml-core/RMLTC0019b-JSON/persons.json deleted file mode 100644 index 87c4f14..0000000 --- a/src/test/resources/rml-core/RMLTC0019b-JSON/persons.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "persons": [ - { - "ID": 30, - "FirstName": "Juan Daniel", - "LastName": "Crespo" - } - ] -} diff --git a/src/test/resources/rml-core/RMLTC0020a-JSON/README.md b/src/test/resources/rml-core/RMLTC0020a-JSON/README.md deleted file mode 100644 index bfbd4be..0000000 --- a/src/test/resources/rml-core/RMLTC0020a-JSON/README.md +++ /dev/null @@ -1,60 +0,0 @@ -## RMLTC0020a-JSON - -**Title**: "Generation of triples by using IRI value in columns" - -**Description**: "Test the generation of triples by using IRI value in attributes" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [ - {"Name": "http://example.com/company/Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "path/../Danny"}, - {"Name": "Emily Smith"} - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "{$.Name}"; - rml:termType rml:IRI - ] . - -``` - -**Output** -``` - . - . - . - . - . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl deleted file mode 100644 index 0d2892f..0000000 --- a/src/test/resources/rml-core/RMLTC0020a-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "{$.Name}"; - rml:termType rml:IRI - ] . diff --git a/src/test/resources/rml-core/RMLTC0020a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0020a-JSON/output.nq deleted file mode 100644 index d2b4b5f..0000000 --- a/src/test/resources/rml-core/RMLTC0020a-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0020a-JSON/student.json b/src/test/resources/rml-core/RMLTC0020a-JSON/student.json deleted file mode 100644 index 3b14e8f..0000000 --- a/src/test/resources/rml-core/RMLTC0020a-JSON/student.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "students": [ - {"Name": "http://example.com/company/Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "path/../Danny"}, - {"Name": "Emily Smith"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0021a-JSON/README.md b/src/test/resources/rml-core/RMLTC0021a-JSON/README.md deleted file mode 100644 index ac2bc65..0000000 --- a/src/test/resources/rml-core/RMLTC0021a-JSON/README.md +++ /dev/null @@ -1,75 +0,0 @@ -## RMLTC0021a-JSON - -**Title**: "Generation of triples referencing object map" - -**Description**: "Tests the mapping specification referencing object map with same logical source and join condition" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }, { - "ID": 20, - "Name":"Serena Williams", - "Sport": "Tennis" - }, { - "ID": 30, - "Name":"Loena Hendrickx", - "Sport": "Figure skating" - }] -} - -``` - -**Mapping** -``` -@prefix activity: . -@prefix ex: . -@prefix rdf: . -@prefix rml: . - - a rml:RefObjectMap; - rml:joinCondition [ - rml:child "$.Sport"; - rml:parent "$.Sport" - ]; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . - -``` - -**Output** -``` - . - . - . - . - . - - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl deleted file mode 100644 index f7a7d85..0000000 --- a/src/test/resources/rml-core/RMLTC0021a-JSON/mapping.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix activity: . -@prefix ex: . -@prefix rdf: . -@prefix rml: . - - a rml:RefObjectMap; - rml:joinCondition [ - rml:child "$.Sport"; - rml:parent "$.Sport" - ]; - rml:parentTriplesMap . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap ; - rml:predicate ex:sameSportAs - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.ID}/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0021a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0021a-JSON/output.nq deleted file mode 100644 index 4488c58..0000000 --- a/src/test/resources/rml-core/RMLTC0021a-JSON/output.nq +++ /dev/null @@ -1,7 +0,0 @@ - . - . - . - . - . - - diff --git a/src/test/resources/rml-core/RMLTC0021a-JSON/student.json b/src/test/resources/rml-core/RMLTC0021a-JSON/student.json deleted file mode 100644 index a1d5027..0000000 --- a/src/test/resources/rml-core/RMLTC0021a-JSON/student.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus Williams", - "Sport": "Tennis" - }, { - "ID": 20, - "Name":"Serena Williams", - "Sport": "Tennis" - }, { - "ID": 30, - "Name":"Loena Hendrickx", - "Sport": "Figure skating" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/README.md b/src/test/resources/rml-core/RMLTC0022a-JSON/README.md deleted file mode 100644 index 31d47a2..0000000 --- a/src/test/resources/rml-core/RMLTC0022a-JSON/README.md +++ /dev/null @@ -1,64 +0,0 @@ -## RMLTC0022a-JSON - -**Title**: "Generating of triples with constant datatype" - -**Description**: "Test triples with a fixed constant datatype" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus", - "Age": 21 - }] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . -@prefix xsd: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatype xsd:string; - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:datatype xsd:int; - rml:reference "$.Age" - ]; - rml:predicate ex:age - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Name}" - ] . - -``` - -**Output** -``` - "Venus"^^ . - "21"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0022a-JSON/mapping.ttl deleted file mode 100644 index 761e550..0000000 --- a/src/test/resources/rml-core/RMLTC0022a-JSON/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . -@prefix xsd: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatype xsd:string; - rml:reference "$.Name" - ]; - rml:predicate foaf:name - ], [ - rml:objectMap [ - rml:datatype xsd:int; - rml:reference "$.Age" - ]; - rml:predicate ex:age - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.Name}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0022a-JSON/output.nq deleted file mode 100644 index f18b6f4..0000000 --- a/src/test/resources/rml-core/RMLTC0022a-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "Venus"^^ . - "21"^^ . diff --git a/src/test/resources/rml-core/RMLTC0022a-JSON/student.json b/src/test/resources/rml-core/RMLTC0022a-JSON/student.json deleted file mode 100644 index b51a0d8..0000000 --- a/src/test/resources/rml-core/RMLTC0022a-JSON/student.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus", - "Age": 21 - }] -} diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/README.md b/src/test/resources/rml-core/RMLTC0022b-JSON/README.md deleted file mode 100644 index 7fe506f..0000000 --- a/src/test/resources/rml-core/RMLTC0022b-JSON/README.md +++ /dev/null @@ -1,56 +0,0 @@ -## RMLTC0022b-JSON - -**Title**: "Generating of triples with datatypeMap" - -**Description**: "Test triples with a XSD datatype generated from the data" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -[ - { "FOO": 1, "BAR": "string"}, - { "FOO": 2, "BAR": "int"} -] - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatypeMap [ - rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}" - ]; - rml:reference "$.FOO" - ]; - rml:predicate ex:x - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.FOO}" - ] . - - -``` - -**Output** -``` - "1"^^ . - "2"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/data.json b/src/test/resources/rml-core/RMLTC0022b-JSON/data.json deleted file mode 100644 index 6b0dcef..0000000 --- a/src/test/resources/rml-core/RMLTC0022b-JSON/data.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "FOO": 1, "BAR": "string"}, - { "FOO": 2, "BAR": "int"} -] diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0022b-JSON/mapping.ttl deleted file mode 100644 index 0f51928..0000000 --- a/src/test/resources/rml-core/RMLTC0022b-JSON/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatypeMap [ - rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}" - ]; - rml:reference "$.FOO" - ]; - rml:predicate ex:x - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.FOO}" - ] . - diff --git a/src/test/resources/rml-core/RMLTC0022b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0022b-JSON/output.nq deleted file mode 100644 index 0e3c60c..0000000 --- a/src/test/resources/rml-core/RMLTC0022b-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "1"^^ . - "2"^^ . diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/README.md b/src/test/resources/rml-core/RMLTC0022c-JSON/README.md deleted file mode 100644 index 72870ba..0000000 --- a/src/test/resources/rml-core/RMLTC0022c-JSON/README.md +++ /dev/null @@ -1,55 +0,0 @@ -## RMLTC0022c-JSON - -**Title**: "Generating of triples with datatypeMap with custom datatype" - -**Description**: "Test triples with a custom datype from the data" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -[ - { "FOO": 1, "BAR": "string"}, - { "FOO": 2, "BAR": "int"} -] - -``` - -**Mapping** -``` -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatypeMap [ - rml:template "datatype#{$.BAR}" - ]; - rml:reference "$.FOO" - ]; - rml:predicate ex:x - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.FOO}" - ] . - -``` - -**Output** -``` - "1"^^ . - "2"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/data.json b/src/test/resources/rml-core/RMLTC0022c-JSON/data.json deleted file mode 100644 index 6b0dcef..0000000 --- a/src/test/resources/rml-core/RMLTC0022c-JSON/data.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - { "FOO": 1, "BAR": "string"}, - { "FOO": 2, "BAR": "int"} -] diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0022c-JSON/mapping.ttl deleted file mode 100644 index 3bc1cd7..0000000 --- a/src/test/resources/rml-core/RMLTC0022c-JSON/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix ex: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:datatypeMap [ - rml:template "datatype#{$.BAR}" - ]; - rml:reference "$.FOO" - ]; - rml:predicate ex:x - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.FOO}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0022c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0022c-JSON/output.nq deleted file mode 100644 index dcca5d8..0000000 --- a/src/test/resources/rml-core/RMLTC0022c-JSON/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "1"^^ . - "2"^^ . diff --git a/src/test/resources/rml-core/RMLTC0023a-JSON/README.md b/src/test/resources/rml-core/RMLTC0023a-JSON/README.md deleted file mode 100644 index 80535cc..0000000 --- a/src/test/resources/rml-core/RMLTC0023a-JSON/README.md +++ /dev/null @@ -1,42 +0,0 @@ -## RMLTC0023a-JSON - -**Title**: "Invalid IRI template 1" - -**Description**: "Test handling of invalid IRI template" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "{Name}":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{{Name}}"; - rml:class foaf:Person; - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0023a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023a-JSON/mapping.ttl deleted file mode 100644 index 4c4e692..0000000 --- a/src/test/resources/rml-core/RMLTC0023a-JSON/mapping.ttl +++ /dev/null @@ -1,16 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{{Name}}"; - rml:class foaf:Person; - ] . diff --git a/src/test/resources/rml-core/RMLTC0023a-JSON/student.json b/src/test/resources/rml-core/RMLTC0023a-JSON/student.json deleted file mode 100644 index 2aa2168..0000000 --- a/src/test/resources/rml-core/RMLTC0023a-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "{Name}":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0023b-JSON/README.md b/src/test/resources/rml-core/RMLTC0023b-JSON/README.md deleted file mode 100644 index b77e693..0000000 --- a/src/test/resources/rml-core/RMLTC0023b-JSON/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## RMLTC0023b-JSON - -**Title**: "Invalid IRI template 2" - -**Description**: "Test handling of invalid IRI template" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "N\ame":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{N\ame}"; - rml:class foaf:Person; - ] . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0023b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023b-JSON/mapping.ttl deleted file mode 100644 index e23f693..0000000 --- a/src/test/resources/rml-core/RMLTC0023b-JSON/mapping.ttl +++ /dev/null @@ -1,17 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{N\ame}"; - rml:class foaf:Person; - ] . - diff --git a/src/test/resources/rml-core/RMLTC0023b-JSON/student.json b/src/test/resources/rml-core/RMLTC0023b-JSON/student.json deleted file mode 100644 index a905e53..0000000 --- a/src/test/resources/rml-core/RMLTC0023b-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "N\ame":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0023c-JSON/README.md b/src/test/resources/rml-core/RMLTC0023c-JSON/README.md deleted file mode 100644 index 8428561..0000000 --- a/src/test/resources/rml-core/RMLTC0023c-JSON/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## RMLTC0023c-JSON - -**Title**: "Invalid IRI template 3" - -**Description**: "Test handling of invalid IRI template" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name\}"; - rml:class foaf:Person; - ] . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0023c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023c-JSON/mapping.ttl deleted file mode 100644 index 0b46f35..0000000 --- a/src/test/resources/rml-core/RMLTC0023c-JSON/mapping.ttl +++ /dev/null @@ -1,17 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name\}"; - rml:class foaf:Person; - ] . - diff --git a/src/test/resources/rml-core/RMLTC0023c-JSON/student.json b/src/test/resources/rml-core/RMLTC0023c-JSON/student.json deleted file mode 100644 index 0f6f797..0000000 --- a/src/test/resources/rml-core/RMLTC0023c-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "Name":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0023d-JSON/README.md b/src/test/resources/rml-core/RMLTC0023d-JSON/README.md deleted file mode 100644 index 1cbc5ee..0000000 --- a/src/test/resources/rml-core/RMLTC0023d-JSON/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## RMLTC0023d-JSON - -**Title**: "Invalid IRI template 4" - -**Description**: "Test handling of invalid IRI template" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "{Name}":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{\\\\{Name\\\\}}"; - rml:class foaf:Person; - ] . - - -``` - diff --git a/src/test/resources/rml-core/RMLTC0023d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023d-JSON/mapping.ttl deleted file mode 100644 index 4d56d8a..0000000 --- a/src/test/resources/rml-core/RMLTC0023d-JSON/mapping.ttl +++ /dev/null @@ -1,17 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{\\\\{Name\\\\}}"; - rml:class foaf:Person; - ] . - diff --git a/src/test/resources/rml-core/RMLTC0023d-JSON/student.json b/src/test/resources/rml-core/RMLTC0023d-JSON/student.json deleted file mode 100644 index 2aa2168..0000000 --- a/src/test/resources/rml-core/RMLTC0023d-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "{Name}":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0023e-JSON/README.md b/src/test/resources/rml-core/RMLTC0023e-JSON/README.md deleted file mode 100644 index 91737ab..0000000 --- a/src/test/resources/rml-core/RMLTC0023e-JSON/README.md +++ /dev/null @@ -1,42 +0,0 @@ -## RMLTC0023e-JSON - -**Title**: "Invalid IRI template 5" - -**Description**: "Test handling of invalid IRI template" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "ID": 10, - "N\ame":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{N\\\ame}"; - rml:class foaf:Person; - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0023e-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023e-JSON/mapping.ttl deleted file mode 100644 index 98c1d29..0000000 --- a/src/test/resources/rml-core/RMLTC0023e-JSON/mapping.ttl +++ /dev/null @@ -1,16 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{N\\\ame}"; - rml:class foaf:Person; - ] . diff --git a/src/test/resources/rml-core/RMLTC0023e-JSON/student.json b/src/test/resources/rml-core/RMLTC0023e-JSON/student.json deleted file mode 100644 index a905e53..0000000 --- a/src/test/resources/rml-core/RMLTC0023e-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "N\ame":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/README.md b/src/test/resources/rml-core/RMLTC0023f-JSON/README.md deleted file mode 100644 index e786a76..0000000 --- a/src/test/resources/rml-core/RMLTC0023f-JSON/README.md +++ /dev/null @@ -1,48 +0,0 @@ -## RMLTC0023f-JSON - -**Title**: "Valid IRI template with backslash-escape" - -**Description**: "Test handling of a valid IRI template using backslash-escape" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [{ - "ID": 10, - "{Name}":"Venus" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{\\{Name\\}}"; - rml:class foaf:Person; - ] . - - -``` - -**Output** -``` - . -``` - diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0023f-JSON/mapping.ttl deleted file mode 100644 index 6a61906..0000000 --- a/src/test/resources/rml-core/RMLTC0023f-JSON/mapping.ttl +++ /dev/null @@ -1,17 +0,0 @@ -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.students[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:subjectMap [ - rml:template "http://example.com/{\\{Name\\}}"; - rml:class foaf:Person; - ] . - diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/output.nq b/src/test/resources/rml-core/RMLTC0023f-JSON/output.nq deleted file mode 100644 index aa54753..0000000 --- a/src/test/resources/rml-core/RMLTC0023f-JSON/output.nq +++ /dev/null @@ -1 +0,0 @@ - . \ No newline at end of file diff --git a/src/test/resources/rml-core/RMLTC0023f-JSON/student.json b/src/test/resources/rml-core/RMLTC0023f-JSON/student.json deleted file mode 100644 index 2aa2168..0000000 --- a/src/test/resources/rml-core/RMLTC0023f-JSON/student.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "students": [{ - "ID": 10, - "{Name}":"Venus" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0024a-JSON/README.md b/src/test/resources/rml-core/RMLTC0024a-JSON/README.md deleted file mode 100644 index 142a5be..0000000 --- a/src/test/resources/rml-core/RMLTC0024a-JSON/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## RMLTC0024a-JSON - -**Title**: "Usage of constant term maps in combination with explicitly defined term types" - -**Description**: "Tests the usage of constant term maps in combination with explicitly defined term types" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "students": [{ - "Name":"Venus" - }, - { - "Name":"Julio" - }] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rml: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:student - ]; - rml:subjectMap [ - rml:constant "School"; - rml:termType rml:BlankNode - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0024a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0024a-JSON/mapping.ttl deleted file mode 100644 index 387a394..0000000 --- a/src/test/resources/rml-core/RMLTC0024a-JSON/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix foaf: . -@prefix rml: . -@prefix ex: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.Name" - ]; - rml:predicate ex:student - ]; - rml:subjectMap [ - rml:constant "School"; - rml:termType rml:BlankNode - ] . diff --git a/src/test/resources/rml-core/RMLTC0024a-JSON/student.json b/src/test/resources/rml-core/RMLTC0024a-JSON/student.json deleted file mode 100644 index 10ebb2e..0000000 --- a/src/test/resources/rml-core/RMLTC0024a-JSON/student.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "students": [{ - "Name":"Venus" - }, - { - "Name":"Julio" - }] -} diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/README.md b/src/test/resources/rml-core/RMLTC0025a-JSON/README.md deleted file mode 100644 index 7ecf2dd..0000000 --- a/src/test/resources/rml-core/RMLTC0025a-JSON/README.md +++ /dev/null @@ -1,55 +0,0 @@ -## RMLTC0025a-JSON - -**Title**: "Generation of triples from arrays" - -**Description**: "Tests the generation of triples from array input data structures" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amounts[*]" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.fname}/{$.lname}" - ] . - -``` - -**Output** -``` - "30"^^ . - "40"^^ . - "50"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0025a-JSON/mapping.ttl deleted file mode 100644 index ea839cd..0000000 --- a/src/test/resources/rml-core/RMLTC0025a-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amounts[*]" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.fname}/{$.lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0025a-JSON/output.nq deleted file mode 100644 index e1bc9a4..0000000 --- a/src/test/resources/rml-core/RMLTC0025a-JSON/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "30"^^ . - "40"^^ . - "50"^^ . diff --git a/src/test/resources/rml-core/RMLTC0025a-JSON/persons.json b/src/test/resources/rml-core/RMLTC0025a-JSON/persons.json deleted file mode 100644 index 705406a..0000000 --- a/src/test/resources/rml-core/RMLTC0025a-JSON/persons.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0025b-JSON/README.md b/src/test/resources/rml-core/RMLTC0025b-JSON/README.md deleted file mode 100644 index 30a3a75..0000000 --- a/src/test/resources/rml-core/RMLTC0025b-JSON/README.md +++ /dev/null @@ -1,47 +0,0 @@ -## RMLTC0025b-JSON - -**Title**: "Generation of triples from arrays with wrong reference" - -**Description**: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array" - -**Default Base IRI**: http://example.com/ - -**Error expected?** Yes - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amounts" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.fname}/{$.lname}" - ] . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0025b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0025b-JSON/mapping.ttl deleted file mode 100644 index 780bd99..0000000 --- a/src/test/resources/rml-core/RMLTC0025b-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amounts" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.fname}/{$.lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0025b-JSON/persons.json b/src/test/resources/rml-core/RMLTC0025b-JSON/persons.json deleted file mode 100644 index 705406a..0000000 --- a/src/test/resources/rml-core/RMLTC0025b-JSON/persons.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/README.md b/src/test/resources/rml-core/RMLTC0025c-JSON/README.md deleted file mode 100644 index 3472e63..0000000 --- a/src/test/resources/rml-core/RMLTC0025c-JSON/README.md +++ /dev/null @@ -1,58 +0,0 @@ -## RMLTC0025c-JSON - -**Title**: "Generation of triples from arrays in subject and object" - -**Description**: "Tests the generation of triples from array input data structures in subject and object" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"names":["Bob", "Smith"],"amounts":[30, 40, 50]} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amounts[*]" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.names[*]}" - ] . - -``` - -**Output** -``` - "30"^^ . - "40"^^ . - "50"^^ . - "30"^^ . - "40"^^ . - "50"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0025c-JSON/mapping.ttl deleted file mode 100644 index e498664..0000000 --- a/src/test/resources/rml-core/RMLTC0025c-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amounts[*]" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/Student/{$.names[*]}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0025c-JSON/output.nq deleted file mode 100644 index 8fc1278..0000000 --- a/src/test/resources/rml-core/RMLTC0025c-JSON/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "30"^^ . - "40"^^ . - "50"^^ . - "30"^^ . - "40"^^ . - "50"^^ . diff --git a/src/test/resources/rml-core/RMLTC0025c-JSON/persons.json b/src/test/resources/rml-core/RMLTC0025c-JSON/persons.json deleted file mode 100644 index 6b67d59..0000000 --- a/src/test/resources/rml-core/RMLTC0025c-JSON/persons.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "persons": [ - {"names":["Bob", "Smith"],"amounts":[30, 40, 50]} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/README.md b/src/test/resources/rml-core/RMLTC0026a-JSON/README.md deleted file mode 100644 index b220185..0000000 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/README.md +++ /dev/null @@ -1,77 +0,0 @@ -## RMLTC0026a-JSON - -**Title**: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs" - -**Description**: "Tests the generation of triples from relative IRIs using base IRI" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.lname}" - ] . - -``` - -**Output** -``` - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl deleted file mode 100644 index 41ed54d..0000000 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "http://example.com/{$.lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026a-JSON/output.nq deleted file mode 100644 index e6eee90..0000000 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026a-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026a-JSON/persons.json deleted file mode 100644 index b7f1a04..0000000 --- a/src/test/resources/rml-core/RMLTC0026a-JSON/persons.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/README.md b/src/test/resources/rml-core/RMLTC0026b-JSON/README.md deleted file mode 100644 index 618503d..0000000 --- a/src/test/resources/rml-core/RMLTC0026b-JSON/README.md +++ /dev/null @@ -1,77 +0,0 @@ -## RMLTC0026b-JSON - -**Title**: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter" - -**Description**: "Tests the generation of triples from relative IRI using base IRI parameter" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.lname}" - ] . - -``` - -**Output** -``` - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026b-JSON/mapping.ttl deleted file mode 100644 index 040d95d..0000000 --- a/src/test/resources/rml-core/RMLTC0026b-JSON/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026b-JSON/output.nq deleted file mode 100644 index 9a44701..0000000 --- a/src/test/resources/rml-core/RMLTC0026b-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026b-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026b-JSON/persons.json deleted file mode 100644 index b7f1a04..0000000 --- a/src/test/resources/rml-core/RMLTC0026b-JSON/persons.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/README.md b/src/test/resources/rml-core/RMLTC0026c-JSON/README.md deleted file mode 100644 index d07991f..0000000 --- a/src/test/resources/rml-core/RMLTC0026c-JSON/README.md +++ /dev/null @@ -1,78 +0,0 @@ -## RMLTC0026c-JSON - -**Title**: "Two triples maps, both with rml:baseIRI defined" - -**Description**: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.lname}" - ] . - -``` - -**Output** -``` - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026c-JSON/mapping.ttl deleted file mode 100644 index d282541..0000000 --- a/src/test/resources/rml-core/RMLTC0026c-JSON/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026c-JSON/output.nq deleted file mode 100644 index e6eee90..0000000 --- a/src/test/resources/rml-core/RMLTC0026c-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026c-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026c-JSON/persons.json deleted file mode 100644 index b7f1a04..0000000 --- a/src/test/resources/rml-core/RMLTC0026c-JSON/persons.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/README.md b/src/test/resources/rml-core/RMLTC0026d-JSON/README.md deleted file mode 100644 index d799d4e..0000000 --- a/src/test/resources/rml-core/RMLTC0026d-JSON/README.md +++ /dev/null @@ -1,78 +0,0 @@ -## RMLTC0026d-JSON - -**Title**: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined" - -**Description**: "Tests the generation of triples by with base IRIs different than the base IRI parameter" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} - -``` - -**Mapping** -``` -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.lname}" - ] . - -``` - -**Output** -``` - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0026d-JSON/mapping.ttl deleted file mode 100644 index 387c625..0000000 --- a/src/test/resources/rml-core/RMLTC0026d-JSON/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.fname}" - ] . - - a rml:TriplesMap; - rml:baseIRI ; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.persons[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "persons.json" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "$.amount" - ]; - rml:predicate ex:amount - ]; - rml:subjectMap [ - rml:template "{$.lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/output.nq b/src/test/resources/rml-core/RMLTC0026d-JSON/output.nq deleted file mode 100644 index a6a4afa..0000000 --- a/src/test/resources/rml-core/RMLTC0026d-JSON/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "30"^^ . - "20"^^ . - "30"^^ . - "20"^^ . diff --git a/src/test/resources/rml-core/RMLTC0026d-JSON/persons.json b/src/test/resources/rml-core/RMLTC0026d-JSON/persons.json deleted file mode 100644 index b7f1a04..0000000 --- a/src/test/resources/rml-core/RMLTC0026d-JSON/persons.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "persons": [ - {"fname":"Bob","lname":"Smith","amount":30}, - {"fname":"Sue","lname":"Jones","amount":20} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0027-XML/ious.xml b/src/test/resources/rml-core/RMLTC0027-XML/ious.xml deleted file mode 100644 index 83fe72a..0000000 --- a/src/test/resources/rml-core/RMLTC0027-XML/ious.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Bob - Smith - 30.0E0 - - - Sue - Jones - 20.0E0 - - - Bob - Smith - 30.0E0 - - diff --git a/src/test/resources/rml-core/RMLTC0027-XML/mapping.ttl b/src/test/resources/rml-core/RMLTC0027-XML/mapping.ttl deleted file mode 100644 index 07ca48e..0000000 --- a/src/test/resources/rml-core/RMLTC0027-XML/mapping.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix ex: . -@prefix foaf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "/persons/person"; - rml:referenceFormulation rml:XPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "ious.xml" - ] - ]; - rml:predicateObjectMap [ - rml:objectMap [ - rml:reference "substring-before(amount, '.')" - ]; - rml:predicate ex:owes - ]; - rml:subjectMap [ - rml:class foaf:Person; - rml:template "http://example.com/{fname};{lname}" - ] . diff --git a/src/test/resources/rml-core/RMLTC0027-XML/output.nq b/src/test/resources/rml-core/RMLTC0027-XML/output.nq deleted file mode 100644 index 4cb0cff..0000000 --- a/src/test/resources/rml-core/RMLTC0027-XML/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - "30" . - . - "20" . - diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/README.md b/src/test/resources/rml-core/RMLTC0027a-JSON/README.md deleted file mode 100644 index 7aed158..0000000 --- a/src/test/resources/rml-core/RMLTC0027a-JSON/README.md +++ /dev/null @@ -1,60 +0,0 @@ -## RMLTC0027a-JSON - -**Title**: "Generation of triples using the URI term type" - -**Description**: "Tests the generation of triples with a URI term type in the subject or object" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [ - {"Name": "Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "Danny"}, - {"Name": "Emily Smith"} - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.Name}"; - rml:termType rml:URI - ] . - -``` - -**Output** -``` - . - . - . - . - . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0027a-JSON/mapping.ttl deleted file mode 100644 index 2d873b5..0000000 --- a/src/test/resources/rml-core/RMLTC0027a-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.Name}"; - rml:termType rml:URI - ] . diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0027a-JSON/output.nq deleted file mode 100644 index 0d4f556..0000000 --- a/src/test/resources/rml-core/RMLTC0027a-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0027a-JSON/student.json b/src/test/resources/rml-core/RMLTC0027a-JSON/student.json deleted file mode 100644 index c1c6e96..0000000 --- a/src/test/resources/rml-core/RMLTC0027a-JSON/student.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "students": [ - {"Name": "Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "Danny"}, - {"Name": "Emily Smith"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/README.md b/src/test/resources/rml-core/RMLTC0027b-JSON/README.md deleted file mode 100644 index 748971f..0000000 --- a/src/test/resources/rml-core/RMLTC0027b-JSON/README.md +++ /dev/null @@ -1,60 +0,0 @@ -## RMLTC0027b-JSON - -**Title**: "Generation of triples using the UnsafeURI term type" - -**Description**: "Tests the generation of triples with a UnsafeURI term type in the subject or object" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [ - {"Name": "Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "Danny"}, - {"Name": "Emily Smith"} - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.Name}"; - rml:termType rml:UnsafeURI - ] . - -``` - -**Output** -``` - . - . - . - . - . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0027b-JSON/mapping.ttl deleted file mode 100644 index 803c17e..0000000 --- a/src/test/resources/rml-core/RMLTC0027b-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.Name}"; - rml:termType rml:UnsafeURI - ] . diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0027b-JSON/output.nq deleted file mode 100644 index 0d4f556..0000000 --- a/src/test/resources/rml-core/RMLTC0027b-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0027b-JSON/student.json b/src/test/resources/rml-core/RMLTC0027b-JSON/student.json deleted file mode 100644 index c1c6e96..0000000 --- a/src/test/resources/rml-core/RMLTC0027b-JSON/student.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "students": [ - {"Name": "Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "Danny"}, - {"Name": "Emily Smith"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/README.md b/src/test/resources/rml-core/RMLTC0027c-JSON/README.md deleted file mode 100644 index 9d6d04b..0000000 --- a/src/test/resources/rml-core/RMLTC0027c-JSON/README.md +++ /dev/null @@ -1,60 +0,0 @@ -## RMLTC0027c-JSON - -**Title**: "Generation of triples using the UnsafeIRI term type" - -**Description**: "Tests the generation of triples with a UnsafeIRI term type in the subject or object" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -{ - "students": [ - {"Name": "Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "Danny"}, - {"Name": "Emily Smith"} - ] -} - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.Name}"; - rml:termType rml:UnsafeIRI - ] . - -``` - -**Output** -``` - . - . - . - . - . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0027c-JSON/mapping.ttl deleted file mode 100644 index 4a03ab5..0000000 --- a/src/test/resources/rml-core/RMLTC0027c-JSON/mapping.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix foaf: . -@prefix rdf: . -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:iterator "$.students[*]"; - rml:referenceFormulation rml:JSONPath; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.json" - ] - ]; - rml:predicateObjectMap [ - rml:object foaf:Person; - rml:predicate rdf:type - ]; - rml:subjectMap [ - rml:template "http://example.com/Person/{$.Name}"; - rml:termType rml:UnsafeIRI - ] . diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0027c-JSON/output.nq deleted file mode 100644 index 0d4f556..0000000 --- a/src/test/resources/rml-core/RMLTC0027c-JSON/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - . - . - . - . - . diff --git a/src/test/resources/rml-core/RMLTC0027c-JSON/student.json b/src/test/resources/rml-core/RMLTC0027c-JSON/student.json deleted file mode 100644 index c1c6e96..0000000 --- a/src/test/resources/rml-core/RMLTC0027c-JSON/student.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "students": [ - {"Name": "Alice"}, - {"Name": "Bob"}, - {"Name": "Bob/Charles"}, - {"Name": "Danny"}, - {"Name": "Emily Smith"} - ] -} diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/README.md b/src/test/resources/rml-core/RMLTC0028a-JSON/README.md deleted file mode 100644 index d5d5cec..0000000 --- a/src/test/resources/rml-core/RMLTC0028a-JSON/README.md +++ /dev/null @@ -1,45 +0,0 @@ -## RMLTC0028a-JSON - -**Title**: "Generation of the right datatype for a constant in the mapping" - -**Description**: "Test the honoring of the datatype specified by the constant term in the mapping" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -[ { "id": "0", "foo": "bar" } ] - -``` - -**Mapping** -``` -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; - ]; - rml:predicateObjectMap [ - rml:predicate ; - rml:object true ; # datatype is boolean - ] . - -``` - -**Output** -``` - "true"^^ . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/data.json b/src/test/resources/rml-core/RMLTC0028a-JSON/data.json deleted file mode 100644 index 64a11ae..0000000 --- a/src/test/resources/rml-core/RMLTC0028a-JSON/data.json +++ /dev/null @@ -1 +0,0 @@ -[ { "id": "0", "foo": "bar" } ] diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0028a-JSON/mapping.ttl deleted file mode 100644 index 140141f..0000000 --- a/src/test/resources/rml-core/RMLTC0028a-JSON/mapping.ttl +++ /dev/null @@ -1,18 +0,0 @@ -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; - ]; - rml:predicateObjectMap [ - rml:predicate ; - rml:object true ; # datatype is boolean - ] . diff --git a/src/test/resources/rml-core/RMLTC0028a-JSON/output.nq b/src/test/resources/rml-core/RMLTC0028a-JSON/output.nq deleted file mode 100644 index ed7a2cd..0000000 --- a/src/test/resources/rml-core/RMLTC0028a-JSON/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/README.md b/src/test/resources/rml-core/RMLTC0028b-JSON/README.md deleted file mode 100644 index 4428a0a..0000000 --- a/src/test/resources/rml-core/RMLTC0028b-JSON/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## RMLTC0028b-JSON - -**Title**: "Generation of all named graphs when rml:defaultGraph is involved" - -**Description**: "Test if the default graph is also generated correctly." - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -[ { "id": "0", "name": "Alice" } ] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix s: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; - rml:class s:Person ; - rml:graph ; - ]; - rml:predicateObjectMap [ - rml:predicate s:givenName ; - rml:objectMap [ rml:reference "name" ] ; - rml:graph rml:defaultGraph ; - ]. - -``` - -**Output** -``` - "Alice". - "Alice" . - . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/data.json b/src/test/resources/rml-core/RMLTC0028b-JSON/data.json deleted file mode 100644 index 4087270..0000000 --- a/src/test/resources/rml-core/RMLTC0028b-JSON/data.json +++ /dev/null @@ -1 +0,0 @@ -[ { "id": "0", "name": "Alice" } ] diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0028b-JSON/mapping.ttl deleted file mode 100644 index 9564c1e..0000000 --- a/src/test/resources/rml-core/RMLTC0028b-JSON/mapping.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix rml: . -@prefix s: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; - rml:class s:Person ; - rml:graph ; - ]; - rml:predicateObjectMap [ - rml:predicate s:givenName ; - rml:objectMap [ rml:reference "name" ] ; - rml:graph rml:defaultGraph ; - ]. diff --git a/src/test/resources/rml-core/RMLTC0028b-JSON/output.nq b/src/test/resources/rml-core/RMLTC0028b-JSON/output.nq deleted file mode 100644 index 8e30635..0000000 --- a/src/test/resources/rml-core/RMLTC0028b-JSON/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "Alice". - "Alice" . - . diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/README.md b/src/test/resources/rml-core/RMLTC0028c-JSON/README.md deleted file mode 100644 index 2a0a6d0..0000000 --- a/src/test/resources/rml-core/RMLTC0028c-JSON/README.md +++ /dev/null @@ -1,45 +0,0 @@ -## RMLTC0028c-JSON - -**Title**: "Generation of the right language tag for a constant in the mapping" - -**Description**: "Test the honoring of the language tag specified by the constant term in the mapping" - -**Default Base IRI**: http://example.com/ - -**Error expected?** No - -**Input** -``` -[ { "id": "0", "foo": "bar" } ] - -``` - -**Mapping** -``` -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; - ]; - rml:predicateObjectMap [ - rml:predicate ; - rml:object "train"@en ; - ] . - -``` - -**Output** -``` - "train"@en . - -``` - diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/data.json b/src/test/resources/rml-core/RMLTC0028c-JSON/data.json deleted file mode 100644 index 64a11ae..0000000 --- a/src/test/resources/rml-core/RMLTC0028c-JSON/data.json +++ /dev/null @@ -1 +0,0 @@ -[ { "id": "0", "foo": "bar" } ] diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/mapping.ttl b/src/test/resources/rml-core/RMLTC0028c-JSON/mapping.ttl deleted file mode 100644 index 8c9145d..0000000 --- a/src/test/resources/rml-core/RMLTC0028c-JSON/mapping.ttl +++ /dev/null @@ -1,18 +0,0 @@ -@prefix rml: . - - a rml:TriplesMap; - rml:logicalSource [ - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]"; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.json" - ] - ]; - rml:subjectMap [ - rml:template "https://example.org/instances/{id}"; - ]; - rml:predicateObjectMap [ - rml:predicate ; - rml:object "train"@en ; - ] . diff --git a/src/test/resources/rml-core/RMLTC0028c-JSON/output.nq b/src/test/resources/rml-core/RMLTC0028c-JSON/output.nq deleted file mode 100644 index 55246cc..0000000 --- a/src/test/resources/rml-core/RMLTC0028c-JSON/output.nq +++ /dev/null @@ -1 +0,0 @@ - "train"@en . diff --git a/src/test/resources/rml-core/config.js b/src/test/resources/rml-core/config.js deleted file mode 100644 index 8bc9b13..0000000 --- a/src/test/resources/rml-core/config.js +++ /dev/null @@ -1,79 +0,0 @@ -async function loadTurtle() { - //this is the function you call in 'preProcess', to load the highlighter - const worker = await new Promise(resolve => { - require(["core/worker"], ({ worker }) => resolve(worker)); - }); - const action = "highlight-load-lang"; - const langURL = - "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; - const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded - const lang = "turtle"; // this is the class you use to identify the language - worker.postMessage({ action, langURL, propName, lang }); - return new Promise(resolve => { - worker.addEventListener("message", function listener({ data }) { - const { action: responseAction, lang: responseLang } = data; - if (responseAction === action && responseLang === lang) { - worker.removeEventListener("message", listener); - resolve(); - } - }); - }); -} - -var respecConfig = { - // check https://respec.org/docs/ for the meaning of these keys - preProcess: [loadTurtle], - authors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - edDraftURI: "https://w3id.org/rml/core/test-cases/", - editors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - }, - { - name: "David Chaves-Fraga", - url: "https://davidchavesfraga.com", - company: "CiTIUS – University of Santiago de Compostela", - orcid: "0000-0003-3236-2789", - companyURL: "https://citius.gal" - } - ], - formerEditors: [ - ], - github: "https://github.com/kg-construct/rml-core", - license: "w3c-software-doc", - localBiblio: { - "RML-Core": { - title: "RML-Core", - href: "https://w3id.org/rml/core/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "07 August 2024", - }, - "RML-IO": { - title: "RML-IO", - href: "https://w3id.org/rml/io/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "12 March 2024", - }, - }, - otherLinks: [], - shortName: "RML-Core-Testcases", - specStatus: "CG-DRAFT", - // W3C config - copyrightStart: "2024", - doJsonLd: true, - group: "kg-construct", -}; diff --git a/src/test/resources/rml-core/descriptions.csv b/src/test/resources/rml-core/descriptions.csv deleted file mode 100644 index c5220b8..0000000 --- a/src/test/resources/rml-core/descriptions.csv +++ /dev/null @@ -1,64 +0,0 @@ -ID,title,description -RMLTC0000-JSON,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph -RMLTC0001a-JSON,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property -RMLTC0001b-JSON,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property -RMLTC0002a-JSON,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property" -RMLTC0002b-JSON,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property" -RMLTC0002e-JSON,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path -RMLTC0002g-JSON,"Two columns mapping, invalid JSONPath",Test the presence of an invalid JSONPath -RMLTC0003c-JSON,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal -RMLTC0004a-JSON,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class" -RMLTC0004b-JSON,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid" -RMLTC0005a-JSON,Typing of resources,Tests the typing of resources -RMLTC0006a-JSON,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap" -RMLTC0007a-JSON,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate -RMLTC0007b-JSON,Assigning triples to Named Graphs,Tests the generation of triples to a named graph -RMLTC0007c-JSON,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class" -RMLTC0007d-JSON,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type" -RMLTC0007e-JSON,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class -RMLTC0007f-JSON,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type -RMLTC0007g-JSON,Assigning triples to the default graph,Tests the generation of triples to the default graph -RMLTC0007h-JSON,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error" -RMLTC0008a-JSON,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template -RMLTC0008b-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map without join -RMLTC0008c-JSON,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap -RMLTC0009a-JSON,Generation of triples from foreign key relations,Test foreign key relationships among logical tables -RMLTC0009b-JSON,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs. -RMLTC0010a-JSON,Template with table column with blank space,Tests a template with blank space in column value -RMLTC0010b-JSON,Template with table columns with special chars,Tests a template with special chars in column value -RMLTC0010c-JSON,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates -RMLTC0011b-JSON,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map" -RMLTC0012a-JSON,Blank node referencing multiple columns,Tests that blank nodes can be generated by referencing multiple columns -RMLTC0012b-JSON,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent. -RMLTC0012c-JSON,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap." -RMLTC0012d-JSON,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap." -RMLTC0013a-JSON,Null value in JSON file,Tests if null values in JSON files are handled correctly. -RMLTC0015a-JSON,Generation of language tags from a table with language information,Generation of language tags from a table with language information -RMLTC0015b-JSON,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error" -RMLTC0019a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes -RMLTC0019b-JSON,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)" -RMLTC0020a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes -RMLTC0021a-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition -RMLTC0022a-JSON,Generating of triples with constant datatype,Test triples with a fixed constant datatype -RMLTC0022b-JSON,Generating of triples with datatypeMap,Test triples with a XSD datatype generated from the data -RMLTC0022c-JSON,Generating of triples with datatypeMap with custom datatype,Test triples with a custom datype from the data -RMLTC0023a-JSON,Invalid IRI template 1,Test handling of invalid IRI template -RMLTC0023b-JSON,Invalid IRI template 2,Test handling of invalid IRI template -RMLTC0023c-JSON,Invalid IRI template 3,Test handling of invalid IRI template -RMLTC0023d-JSON,Invalid IRI template 4,Test handling of invalid IRI template -RMLTC0023e-JSON,Invalid IRI template 5,Test handling of invalid IRI template -RMLTC0023f-JSON,Valid IRI template with backslash-escape,Test handling of a valid IRI template using backslash-escape -RMLTC0024a-JSON,Usage of constant term maps in combination with explicitly defined term types,Tests the usage of constant term maps in combination with explicitly defined term types -RMLTC0025a-JSON,Generation of triples from arrays,Tests the generation of triples from array input data structures -RMLTC0025b-JSON,Generation of triples from arrays with wrong reference,Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array -RMLTC0025c-JSON,Generation of triples from arrays in subject and object,Tests the generation of triples from array input data structures in subject and object -RMLTC0026a-JSON,"Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs",Tests the generation of triples from relative IRIs using base IRI -RMLTC0026b-JSON,"Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter",Tests the generation of triples from relative IRI using base IRI parameter -RMLTC0026c-JSON,"Two triples maps, both with rml:baseIRI defined","Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter" -RMLTC0026d-JSON,"Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined",Tests the generation of triples by with base IRIs different than the base IRI parameter -RMLTC0027a-JSON,Generation of triples using the URI term type,Tests the generation of triples with a URI term type in the subject or object -RMLTC0027b-JSON,Generation of triples using the UnsafeURI term type,Tests the generation of triples with a UnsafeURI term type in the subject or object -RMLTC0027c-JSON,Generation of triples using the UnsafeIRI term type,Tests the generation of triples with a UnsafeIRI term type in the subject or object -RMLTC0028a-JSON,Generation of the right datatype for a constant in the mapping,Test the honoring of the datatype specified by the constant term in the mapping -RMLTC0028b-JSON,Generation of all named graphs when rml:defaultGraph is involved,Test if the default graph is also generated correctly. -RMLTC0028c-JSON,Generation of the right language tag for a constant in the mapping,Test the honoring of the language tag specified by the constant term in the mapping diff --git a/src/test/resources/rml-core/descriptions_old.csv b/src/test/resources/rml-core/descriptions_old.csv deleted file mode 100644 index a80465e..0000000 --- a/src/test/resources/rml-core/descriptions_old.csv +++ /dev/null @@ -1,426 +0,0 @@ -ID,Title,Purpose,"Error expected?",Input ,"Output default","Output 1","Output 2","Output 3",Comment -RMLTC0000-CSV,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, -RMLTC0000-JSON,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, -RMLTC0000-XML,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, -RMLTC0000-MySQL,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, -RMLTC0000-PostgreSQL,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, -RMLTC0000-SQLServer,"one table, one column, zero rows",Tests if an empty table produces an empty RDF graph,no,,,,,, -RMLTC0000-SPARQL,Empty dataset,Test if an empty dataset produces an empty RDF graph,no,,,,,, -RMLTC0001a-CSV,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, -RMLTC0001a-JSON,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, -RMLTC0001a-XML,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, -RMLTC0001a-MySQL,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, -RMLTC0001a-PostgreSQL,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, -RMLTC0001a-SQLServer,"One column mapping, subject URI generation by using rml:template",Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property,no,,,,,, -RMLTC0001a-SPARQL,"One tripple mapping, subject URI generation by using rml:template",Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one tripple to one property,no,,,,,, -RMLTC0001b-CSV,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, -RMLTC0001b-JSON,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, -RMLTC0001b-XML,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, -RMLTC0001b-MySQL,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, -RMLTC0001b-PostgreSQL,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, -RMLTC0001b-SQLServer,"One column mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property,no,,,,,, -RMLTC0001b-SPARQL,"One tripple mapping, generation of a BlankNode subject by using rml:termType",Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one tripple to one property,no,,,,,, -RMLTC0002a-CSV,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, -RMLTC0002a-JSON,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, -RMLTC0002a-XML,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, -RMLTC0002a-MySQL,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, -RMLTC0002a-PostgreSQL,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, -RMLTC0002a-SQLServer,"Two columns mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property",no,,,,,, -RMLTC0002a-SPARQL,"Two tripples mapping, generation of a subject URI by the concatenation of two column values","Tests: (1) two tripple mapping, no primary key; (2) subject URI generated by the concatenation of two tripple object values; (3) one tripple object to one property",no,,,,,, -RMLTC0002b-CSV,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, -RMLTC0002b-JSON,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, -RMLTC0002b-XML,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, -RMLTC0002b-MySQL,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, -RMLTC0002b-PostgreSQL,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, -RMLTC0002b-SQLServer,"Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property",no,,,,,, -RMLTC0002b-SPARQL,"Two tripples maping, generation of a BlankNode subject by using rml:template and rml:termType","Tests: (1) two tripple mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one triple to one property",no,,,,,, -RMLTC0002c-CSV,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, -RMLTC0002c-XML,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, -RMLTC0002c-MySQL,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, -RMLTC0002c-PostgreSQL,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, -RMLTC0002c-SQLServer,"Two columns mapping, an undefined SQL identifier / logical reference",Tests the presence of an undefined SQL identifier / logical reference,yes,,,,,, -RMLTC0002d-MySQL,"Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns","Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property",no,,,,,, -RMLTC0002d-PostgreSQL,"Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns","Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property",no,,,,,, -RMLTC0002d-SQLServer,"Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns","Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property",no,,,,,, -RMLTC0002e-CSV,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, -RMLTC0002e-JSON,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, -RMLTC0002e-XML,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, -RMLTC0002e-MySQL,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, -RMLTC0002e-PostgreSQL,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, -RMLTC0002e-SQLServer,"Two columns mapping, an undefined rml:path",Tests the presence of an undefined rml:path,yes,,,,,, -RMLTC0002f-MySQL,"Two columns mapping, delimited identifiers referenced as regular identifiers","Tests the presence of delimited identifiers referenced as regular identifiers. Within rml:template ID is ok, but Name is not",yes,,,,,, -RMLTC0002f-PostgreSQL,"Two columns mapping, delimited identifiers referenced as regular identifiers","Tests the presence of delimited identifiers referenced as regular identifiers. Within rml:template ID is ok, but Name is not",yes,,,,,, -RMLTC0002f-SQLServer,"Two columns mapping, delimited identifiers referenced as regular identifiers","Tests the presence of delimited identifiers referenced as regular identifiers. Within rml:template ID is ok, but Name is not",yes,,,,,, -RMLTC0002g-JSON,"Two columns mapping, invalid JSONPath",Test the presence of an invalid JSONPath,yes,,,,,, -RMLTC0002g-MySQL,"Two columns mapping, invalid SQL query",Tests the presence of an invalid SQL query,yes,,,,,, -RMLTC0002g-PostgreSQL,"Two columns mapping, invalid SQL query",Tests the presence of an invalid SQL query,yes,,,,,, -RMLTC0002g-SQLServer,"Two columns mapping, invalid SQL query",Tests the presence of an invalid SQL query,yes,,,,,, -RMLTC0002g-SPARQL,"Two tripples mapping, invalid SPARQL query",Tests the presence of an invalid SPARQL query,yes,,,,,, -RMLTC0002h-MySQL,"Two columns mapping, duplicate column name in SELECT",Tests the presence of duplicate column names in the SELECT list of the SQL query,yes,,,,,, -RMLTC0002h-PostgreSQL,"Two columns mapping, duplicate column name in SELECT",Tests the presence of duplicate column names in the SELECT list of the SQL query,yes,,,,,, -RMLTC0002h-SQLServer,"Two columns mapping, duplicate column name in SELECT",Tests the presence of duplicate column names in the SELECT list of the SQL query,yes,,,,,, -RMLTC0002h-SPARQL,"Two tripples mapping, duplicate variable name in SELECT",Tests the presence of duplicate variable names in the SELECT list of the SPARQL query,yes,,,,,, -RMLTC0002i-MySQL,"Two columns mapping, SQL Version identifier",Tests the presence of a SQL Version identifier ,no,,,,,, -RMLTC0002i-PostgreSQL,"Two columns mapping, SQL Version identifier",Tests the presence of a SQL Version identifier ,no,,,,,, -RMLTC0002i-SQLServer,"Two columns mapping, SQL Version identifier",Tests the presence of a SQL Version identifier ,no,,,,,, -RMLTC0002j-MySQL,"Two columns mapping, qualified column names",Tests the presence of qualified column names in the SELECT list of the SQL query,no,,,,,, -RMLTC0002j-PostgreSQL,"Two columns mapping, qualified column names",Tests the presence of qualified column names in the SELECT list of the SQL query,no,,,,,, -RMLTC0002j-SQLServer,"Two columns mapping, qualified column names",Tests the presence of qualified column names in the SELECT list of the SQL query,no,,,,,, -RMLTC0003a-MySQL,"Three columns mapping, undefined SQL Version identifier",Tests the presence of an undefined SQL Version identifier,yes,,,,,, -RMLTC0003a-PostgreSQL,"Three columns mapping, undefined SQL Version identifier",Tests the presence of an undefined SQL Version identifier,yes,,,,,, -RMLTC0003a-SQLServer,"Three columns mapping, undefined SQL Version identifier",Tests the presence of an undefined SQL Version identifier,yes,,,,,, -RMLTC0003b-MySQL,"Three columns mapping, concatenation of columns, by using a rml:SQL2008Query to produce literal","Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rml:SQL2008Query",no,,,,,, -RMLTC0003b-PostgreSQL,"Three columns mapping, concatenation of columns, by using a rml:SQL2008Query to produce literal","Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rml:SQL2008Query",no,,,,,, -RMLTC0003b-SQLServer,"Three columns mapping, concatenation of columns, by using a rml:SQL2008Query to produce literal","Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rml:SQL2008Query",no,,,,,, -RMLTC0003c-CSV,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, -RMLTC0003c-JSON,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, -RMLTC0003c-XML,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, -RMLTC0003c-MySQL,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, -RMLTC0003c-PostgreSQL,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, -RMLTC0003c-SQLServer,"Three columns mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, -RMLTC0003c-SPARQL,"Three tripple mapping, by using a rml:template to produce literal",Tests: (1) three column mapping; and (2) the use of rml:template to produce literal,no,,,,,, -RMLTC0004a-CSV,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, -RMLTC0004a-JSON,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, -RMLTC0004a-XML,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, -RMLTC0004a-MySQL,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, -RMLTC0004a-PostgreSQL,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, -RMLTC0004a-SQLServer,"Two column mapping, from one row table to two different triples","Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class",no,,,,,, -RMLTC0004a-SPARQL,"Two BlankNodes mapping, from one object to two different triples","Tests: (1) two BlankNodes mapping, (2) subject URI generated by a tripple object value; (3) from one BlankNode to two different triples (4) typing by using rml:class",no,,,,,, -RMLTC0004b-CSV,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, -RMLTC0004b-JSON,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, -RMLTC0004b-XML,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, -RMLTC0004b-MySQL,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, -RMLTC0004b-PostgreSQL,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, -RMLTC0004b-SQLServer,"One column mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, -RMLTC0004b-SPARQL,"One tripple mapping, presence of rml:termType rml:Literal on rml:subjectMap","Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid",yes,,,,,, -RMLTC0005a-CSV,Typing of resources,Tests the typing of resources,no,,,,,, -RMLTC0005a-JSON,Typing of resources,Tests the typing of resources,no,,,,,, -RMLTC0005a-XML,Typing of resources,Tests the typing of resources,no,,,,,, -RMLTC0005a-MySQL,Typing of resources,Tests the typing of resources,no,,,,,, -RMLTC0005a-PostgreSQL,Typing of resources,Tests the typing of resources,no,,,,,, -RMLTC0005a-SQLServer,Typing of resources,Tests the typing of resources,no,,,,,, -RMLTC0005b-MySQL,Default mapping,Tests the generation of a default mapping for tables without a primary key,no,,,,,, -RMLTC0005b-PostgreSQL,Default mapping,Tests the generation of a default mapping for tables without a primary key,no,,,,,, -RMLTC0005b-SQLServer,Default mapping,Tests the generation of a default mapping for tables without a primary key,no,,,,,, -RMLTC0006a-CSV,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, -RMLTC0006a-JSON,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, -RMLTC0006a-XML,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, -RMLTC0006a-MySQL,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, -RMLTC0006a-PostgreSQL,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, -RMLTC0006a-SQLServer,"Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, -RMLTC0006a-SPARQL,"rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap","Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap",no,,,,,, -RMLTC0007a-CSV,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, -RMLTC0007a-JSON,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, -RMLTC0007a-XML,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, -RMLTC0007a-MySQL,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, -RMLTC0007a-PostgreSQL,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, -RMLTC0007a-SQLServer,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, -RMLTC0007a-SPARQL,Typing resources by relying on rdf:type predicate,Tests the typing resources by relying on rdf:type predicate,no,,,,,, -RMLTC0007b-CSV,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, -RMLTC0007b-JSON,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, -RMLTC0007b-XML,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, -RMLTC0007b-MySQL,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, -RMLTC0007b-PostgreSQL,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, -RMLTC0007b-SQLServer,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, -RMLTC0007b-SPARQL,Assigning triples to Named Graphs,Tests the generation of triples to a named graph,no,,,,,, -RMLTC0007c-CSV,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, -RMLTC0007c-JSON,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, -RMLTC0007c-XML,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, -RMLTC0007c-MySQL,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, -RMLTC0007c-PostgreSQL,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, -RMLTC0007c-SQLServer,"One row mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, -RMLTC0007c-SPARQL,"One object mapping, using rml:class","Tests subjectmap with more than one class IRIs, rml:class",no,,,,,, -RMLTC0007d-CSV,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, -RMLTC0007d-JSON,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, -RMLTC0007d-XML,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, -RMLTC0007d-MySQL,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, -RMLTC0007d-PostgreSQL,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, -RMLTC0007d-SQLServer,"One column mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, -RMLTC0007d-SPARQL,"One object mapping, specifying an rml:predicateObjectMap with rdf:type","Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type",no,,,,,, -RMLTC0007e-CSV,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, -RMLTC0007e-JSON,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, -RMLTC0007e-XML,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, -RMLTC0007e-MySQL,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, -RMLTC0007e-PostgreSQL,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, -RMLTC0007e-SQLServer,"One column mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, -RMLTC0007e-SPARQL,"One object mapping, using rml:graphMap and rml:class",Tests subjectmap with rml:graphMap and rml:class,no,,,,,, -RMLTC0007f-CSV,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, -RMLTC0007f-JSON,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, -RMLTC0007f-XML,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, -RMLTC0007f-MySQL,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, -RMLTC0007f-PostgreSQL,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, -RMLTC0007f-SQLServer,"One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, -RMLTC0007f-SPARQL,"One object mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type",Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type,no,,,,,, -RMLTC0007g-CSV,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, -RMLTC0007g-JSON,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, -RMLTC0007g-XML,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, -RMLTC0007g-MySQL,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, -RMLTC0007g-PostgreSQL,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, -RMLTC0007g-SQLServer,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, -RMLTC0007g-SPARQL,Assigning triples to the default graph,Tests the generation of triples to the default graph,no,,,,,, -RMLTC0007h-CSV,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, -RMLTC0007h-JSON,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, -RMLTC0007h-XML,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, -RMLTC0007h-MySQL,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, -RMLTC0007h-PostgreSQL,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, -RMLTC0007h-SQLServer,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, -RMLTC0007h-SPARQL,Assigning triples to a non-IRI named graph,"Tests the generation of triples to a non-IRI named graph, which is an error",yes,,,,,, -RMLTC0008a-CSV,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, -RMLTC0008a-JSON,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, -RMLTC0008a-XML,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, -RMLTC0008a-MySQL,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, -RMLTC0008a-PostgreSQL,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, -RMLTC0008a-SQLServer,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, -RMLTC0008a-SPARQL,Generation of triples to a target graph by using rml:graphMap and rml:template,Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template,no,,,,,, -RMLTC0008b-CSV,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, -RMLTC0008b-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, -RMLTC0008b-XML,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, -RMLTC0008b-MySQL,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, -RMLTC0008b-PostgreSQL,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, -RMLTC0008b-SQLServer,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, -RMLTC0008b-SPARQL,Generation of triples referencing object map,Tests the mapping specification referencing object map without join,no,,,,,, -RMLTC0008c-CSV,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, -RMLTC0008c-JSON,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, -RMLTC0008c-XML,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, -RMLTC0008c-MySQL,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, -RMLTC0008c-PostgreSQL,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, -RMLTC0008c-SQLServer,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, -RMLTC0008c-SPARQL,Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap,no,,,,,, -RMLTC0009a-CSV,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, -RMLTC0009a-JSON,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, -RMLTC0009a-XML,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, -RMLTC0009a-MySQL,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, -RMLTC0009a-PostgreSQL,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, -RMLTC0009a-SQLServer,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, -RMLTC0009a-SPARQL,Generation of triples from foreign key relations,Test foreign key relationships among logical tables,no,,,,,, -RMLTC0009b-CSV,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, -RMLTC0009b-JSON,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, -RMLTC0009b-XML,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, -RMLTC0009b-MySQL,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, -RMLTC0009b-PostgreSQL,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, -RMLTC0009b-SQLServer,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, -RMLTC0009b-SPARQL,Generation of triples to multiple graphs,Test that results from distinct parts of the mapping can be directed to different target graphs.,no,,,,,, -RMLTC0009c-MySQL,Unnamed column in a logical table,Test a logical table with unnamed column.,no,,,,,, -RMLTC0009c-PostgreSQL,Unnamed column in a logical table,Test a logical table with unnamed column.,no,,,,,, -RMLTC0009c-SQLServer,Unnamed column in a logical table,Test a logical table with unnamed column.,no,,,,,, -RMLTC0009d-MySQL,Named column in logical table,Test a logical table named column.,no,,,,,, -RMLTC0009d-PostgreSQL,Named column in logical table,Test a logical table named column.,no,,,,,, -RMLTC0009d-SQLServer,Named column in logical table,Test a logical table named column.,no,,,,,, -RMLTC0010a-CSV,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, -RMLTC0010a-JSON,Template with table column with blank space,Tests a template with blank space in column value,no,,,,,, -RMLTC0010a-MySQL,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, -RMLTC0010a-PostgreSQL,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, -RMLTC0010a-SQLServer,Template with table column with special chars,Tests a template with blank space in column value,no,,,,,, -RMLTC0010b-CSV,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, -RMLTC0010b-JSON,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, -RMLTC0010b-XML,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, -RMLTC0010b-MySQL,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, -RMLTC0010b-PostgreSQL,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, -RMLTC0010b-SQLServer,Template with table columns with special chars,Tests a template with special chars in column value,no,,,,,, -RMLTC0010c-CSV,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates,no,,,,,, -RMLTC0010c-JSON,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates,no,,,,,, -RMLTC0010c-XML,Template with table columns with special chars and backslashes,Tests a template with special chars in reference value and backslash escapes in string templates,no,,,,,, -RMLTC0010c-MySQL,Template with table columns with special chars and backslashes,Tests a template with special chars in column value and backslash escapes in string templates,no,,,,,, -RMLTC0010c-PostgreSQL,Template with table columns with special chars and backslashes,Tests a template with special chars in column value and backslash escapes in string templates,no,,,,,, -RMLTC0010c-SQLServer,Template with table columns with special chars and backslashes,Tests a template with special chars in column value and backslash escapes in string templates,no,,,,,, -RMLTC0011a-MySQL,"M to M relation, by using a SQL query","Tests, M to M relations, by using a SQL query",no,,,,,, -RMLTC0011a-PostgreSQL,"M to M relation, by using a SQL query","Tests, M to M relations, by using a SQL query",no,,,,,, -RMLTC0011a-SQLServer,"M to M relation, by using a SQL query","Tests, M to M relations, by using a SQL query",no,,,,,, -RMLTC0011b-CSV,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, -RMLTC0011b-JSON,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, -RMLTC0011b-XML,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, -RMLTC0011b-MySQL,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, -RMLTC0011b-PostgreSQL,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, -RMLTC0011b-SQLServer,"M to M relation, by using an additional Triples Map","Tests, M to M relations, by using an additional Triples Map",no,,,,,, -RMLTC0012a-CSV,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012a-JSON,Blank node referencing multiple columns,Tests that blank nodes can be generated by referencing multiple columns,no,,,,,, -RMLTC0012a-XML,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012a-MySQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012a-PostgreSQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012a-SQLServer,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012a-SPARQL,Duplicate triples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012b-CSV,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012b-JSON,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012b-XML,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012b-MySQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012b-PostgreSQL,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012b-SQLServer,Duplicate tuples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012b-SPARQL,Duplicate triples generate same blank node,Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.,no,,,,,, -RMLTC0012c-CSV,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, -RMLTC0012c-JSON,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, -RMLTC0012c-XML,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, -RMLTC0012c-MySQL,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, -RMLTC0012c-PostgreSQL,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, -RMLTC0012c-SQLServer,TriplesMap without subjectMap,"Tests a RML with missing information, TriplesMap without subjectMap.",yes,,,,,, -RMLTC0012d-CSV,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012d-JSON,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012d-XML,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012d-MySQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012d-PostgreSQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012d-SQLServer,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012e-MySQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, -RMLTC0012e-PostgreSQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, -RMLTC0012e-SQLServer,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, -RMLTC0013a-JSON,Null value in JSON file,Tests if null values in JSON files are handled correctly.,no,,,,,, -RMLTC0013a-MySQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, -RMLTC0013a-PostgreSQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, -RMLTC0013a-SQLServer,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, -"Inverse expression can only be used for run-time optimizations, i.e., if you use it it will only affect performance, but not the resulting RDF. Therefore, I would suggest to skip those.",Subjectmap with rr:inverseExpression,Tests a rml:subjectMap with rr:inverseExpression,no,,,,,, -,Triplesmaps with rr:inverseExpression and rr:joinCondition,"Test two triplesmaps, one with a rr:inverseExpression and the other with a rr:joinCondition for foerign key relations",no,,,,,, -,"Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps","Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps",no,,,,,, -RMLTC0014d-MySQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, -RMLTC0014d-PostgreSQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, -RMLTC0014d-SQLServer,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, -RMLTC0015a-CSV,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-JSON,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-XML,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-MySQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-PostgreSQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-SQLServer,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015b-CSV,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-JSON,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-XML,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-MySQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-PostgreSQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-SQLServer,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0016a-MySQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, -RMLTC0016a-PostgreSQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, -RMLTC0016a-SQLServer,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, -RMLTC0016b-MySQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, -RMLTC0016b-PostgreSQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, -RMLTC0016b-SQLServer,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, -RMLTC0016c-MySQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, -RMLTC0016c-PostgreSQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, -RMLTC0016c-SQLServer,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, -RMLTC0016d-MySQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, -RMLTC0016d-PostgreSQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, -RMLTC0016d-SQLServer,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, -RMLTC0016e-MySQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, -RMLTC0016e-PostgreSQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, -RMLTC0016e-SQLServer,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, -RMLTC0018a-MySQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, -RMLTC0018a-PostgreSQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, -RMLTC0018a-SQLServer,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, -RMLTC0019a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes,no,,,,,, -RMLTC0019a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, -RMLTC0019a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019b-CSV,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-JSON,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-XML,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-MySQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-PostgreSQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-SQLServer,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0020a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020a-JSON,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in attributes,no,,,,,, -RMLTC0020a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, -RMLTC0020a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020b-CSV,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-JSON,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-XML,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-MySQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-PostgreSQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-SQLServer,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0021a-CSV,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-JSON,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-XML,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-MySQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-PostgreSQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-SQLServer,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-SPARQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0012d-MySQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012d-PostgreSQL,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012d-SQLServer,TriplesMap with two subjectMap,"Tests a RML with wrong information, TriplesMap with two subjectMap.",yes,,,,,, -RMLTC0012e-MySQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, -RMLTC0012e-PostgreSQL,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, -RMLTC0012e-SQLServer,Default mapping,Tests the generation of a default mapping for tables without a primary key.,no,,,,,, -RMLTC0013a-MySQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, -RMLTC0013a-PostgreSQL,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, -RMLTC0013a-SQLServer,Generation of empty triples from referenced columns that have null values,Tests the generation of empty triples from referenced columns that have null values,no,,,,,, -"Inverse expression can only be used for run-time optimizations, i.e., if you use it it will only affect performance, but not the resulting RDF. Therefore, I would suggest to skip those.",Subjectmap with rr:inverseExpression,Tests a rml:subjectMap with rr:inverseExpression,no,,,,,, -,Triplesmaps with rr:inverseExpression and rr:joinCondition,"Test two triplesmaps, one with a rr:inverseExpression and the other with a rr:joinCondition for foerign key relations",no,,,,,, -,"Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps","Triplesmaps with rr:inverseExpression, rr:joinCondition, and referencing object maps",no,,,,,, -RMLTC0014d-MySQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, -RMLTC0014d-PostgreSQL,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, -RMLTC0014d-SQLServer,"three tables, one primary key, one foreign key",Test the translation of database type codes to IRIs,no,,,,,, -RMLTC0015a-CSV,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-XML,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-MySQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-PostgreSQL,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015a-SQLServer,Generation of language tags from a table with language information,Generation of language tags from a table with language information,no,,,,,, -RMLTC0015b-CSV,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-XML,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-MySQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-PostgreSQL,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0015b-SQLServer,"Generation of language tags from a table with language information, and a term map with invalid rml:language value","Tests a term map with an invalid rml:language value, which is an error",yes,,,,,, -RMLTC0016a-MySQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, -RMLTC0016a-PostgreSQL,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, -RMLTC0016a-SQLServer,Table with datatypes: string and integer,Tests the rml:termType and datatype conversions: string and integer,no,,,,,, -RMLTC0016b-MySQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, -RMLTC0016b-PostgreSQL,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, -RMLTC0016b-SQLServer,Table with datatypes: real and float,Tests the rml:termType and datatype conversions: real and float,no,,,,,, -RMLTC0016c-MySQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, -RMLTC0016c-PostgreSQL,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, -RMLTC0016c-SQLServer,Table with datatypes: date and timestamp,Tests the rml:termType and datatype conversions: date and timestamp,no,,,,,, -RMLTC0016d-MySQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, -RMLTC0016d-PostgreSQL,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, -RMLTC0016d-SQLServer,"Table with datatypes, boolean conversions",Tests the rml:termType and datatype conversions: boolean,no,,,,,, -RMLTC0016e-MySQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, -RMLTC0016e-PostgreSQL,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, -RMLTC0016e-SQLServer,"Table with datatypes, binary column",Tests the rml:termType and datatype conversions: binary,no,,,,,, -RMLTC0018a-MySQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, -RMLTC0018a-PostgreSQL,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, -RMLTC0018a-SQLServer,Generation of triples by using CHAR datatype column,"Generation of triples by using CHAR datatype column, resulting RDF literal is space-padded.",no,,,,,, -RMLTC0019a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, -RMLTC0019a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0019b-CSV,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-XML,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-MySQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-PostgreSQL,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0019b-SQLServer,"Generation of triples by using IRI value in columns, with data error","Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)",no,,,,,, -RMLTC0020a-CSV,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020a-XML,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in elements,no,,,,,, -RMLTC0020a-MySQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020a-PostgreSQL,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020a-SQLServer,Generation of triples by using IRI value in columns,Test the generation of triples by using IRI value in columns,no,,,,,, -RMLTC0020b-CSV,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-XML,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-MySQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-PostgreSQL,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0020b-SQLServer,"Generation of triples by using IRI value in columns, with data errors","Test the generation of triples by using IRI value in columns, conforming R2RML mapping with data error (and no result)",no,,,,,, -RMLTC0021a-CSV,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-XML,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-MySQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-PostgreSQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-SQLServer,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0021a-SPARQL,Generation of triples referencing object map,Tests the mapping specification referencing object map with same logical source and join condition,no,,,,,, -RMLTC0022a-JSON,Generating of triples with constant datatype,Test triples with a fixed constant datatype,no,,,,,, -RMLTC0022b-JSON,Generating of triples with datatypeMap,Test triples with a XSD datatype generated from the data,no,,,,,, -RMLTC0022c-JSON,Generating of triples with datatypeMap with custom datatype,Test triples with a custom datype from the data,no,,,,,, -RMLTC0023a-JSON,Invalid IRI template 1,Test handling of invalid IRI template,yes,,,,,, -RMLTC0023b-JSON,Invalid IRI template 2,Test handling of invalid IRI template,yes,,,,,, -RMLTC0023c-JSON,Invalid IRI template 3,Test handling of invalid IRI template,yes,,,,,, -RMLTC0023d-JSON,Invalid IRI template 4,Test handling of invalid IRI template,yes,,,,,, -RMLTC0023e-JSON,Invalid IRI template 5,Test handling of invalid IRI template,yes,,,,,, -RMLTC0023f-JSON,Invalid IRI template 6,Test handling of invalid IRI template,yes,,,,,, -RMLTC0023g-JSON,Valid IRI template with backslash-escape,no,,,,,, -RMLTC0025b-JSON,Usage of constant term maps in combination with explicitly defined term types,Tests the usage of constant term maps in combination with explicitly defined term types,yes,,,,,, -RMLTC0026a-JSON,Generation of triples from arrays,Tests the generation of triples from array input data structures,no,,,,,, -RMLTC0026b-JSON,Generation of triples from arrays with wrong reference,Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array,yes,,,,,, -RMLTC0027a-JSON,"Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs",Tests the generation of triples from relative IRIs using base IRI,no,,,,,, -RMLTC0027b-JSON,"Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter",Tests the generation of triples from relative IRI using base IRI parameter,no,,,,,, -RMLTC0027c-JSON,"Two triples maps, both with rml:baseIRI defined","Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter",no,,,,,, -RMLTC0027d-JSON,"Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined",Tests the generation of triples by with base IRIs different than the base IRI parameter,no,,,,,, -RMLTC0028a-JSON,Generation of triples using the URI term type,Tests the generation of triples with a URI term type in the subject or object,no,,,,,, -RMLTC0028b-JSON,Generation of triples using the UnsafeURI term type,Tests the generation of triples with a UnsafeURI term type in the subject or object,no,,,,,, -RMLTC0028c-JSON,Generation of triples using the UnsafeIRI term type,Tests the generation of triples with a UnsafeIRI term type in the subject or object,no,,,,,, -RMLTC0029a-JSON,Generation of the right datatype for a constant in the mapping,Test the honoring of the datatype specified by the constant term in the mapping,no,,,,,, -RMLTC0029b-JSON,Generation of all named graphs when rml:defaultGraph is involved,Test if the default graph is also generated correctly.,no,,,,,, -RMLTC0029c-JSON,Generation of the right language tag for a constant in the mapping,Test the honoring of the language tag specified by the constant term in the mapping,no,,,,,, \ No newline at end of file diff --git a/src/test/resources/rml-core/dev.html b/src/test/resources/rml-core/dev.html deleted file mode 100644 index a36285b..0000000 --- a/src/test/resources/rml-core/dev.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - RML-Core: Test Cases - - - - - - - - - - -
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - diff --git a/src/test/resources/rml-core/docs/20250130/index.html b/src/test/resources/rml-core/docs/20250130/index.html deleted file mode 100644 index 8c6f0c2..0000000 --- a/src/test/resources/rml-core/docs/20250130/index.html +++ /dev/null @@ -1,19356 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - -
- -

RML-Core: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Core-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-core - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-CSV

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
Name
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

6. RMLTC0000-MySQL

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
# empty database
-
-
-

7. RMLTC0000-PostgreSQL

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
# empty database
-
-
-

8. RMLTC0000-SPARQL

-

Title: "Empty dataset"

-

Description: "Test if an empty dataset produces an empty RDF graph"

-

Error expected? No

-

Input

-

-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            SELECT ?name
-            WHERE {
-                ?name a rdfs:Literal .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-

-
-
-

9. RMLTC0000-SQLServer

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
# empty database
-
-
-

10. RMLTC0000-XML

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

11. RMLTC0001a-CSV

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

12. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

13. RMLTC0001a-MySQL

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

14. RMLTC0001a-PostgreSQL

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

15. RMLTC0001a-SPARQL

-

Title: "One tripple mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-
-[] foaf:name "Venus" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            SELECT ?name
-            WHERE {
-                ?x foaf:name ?name .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

16. RMLTC0001a-SQLServer

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

17. RMLTC0001a-XML

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

18. RMLTC0001b-CSV

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

19. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

20. RMLTC0001b-MySQL

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

21. RMLTC0001b-PostgreSQL

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

22. RMLTC0001b-SPARQL

-

Title: "One tripple mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-
-[] foaf:name "Venus" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            SELECT ?name
-            WHERE {
-                ?x foaf:name ?name .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

23. RMLTC0001b-SQLServer

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

24. RMLTC0001b-XML

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

25. RMLTC0002a-CSV

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

26. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

27. RMLTC0002a-MySQL

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

28. RMLTC0002a-PostgreSQL

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

29. RMLTC0002a-SPARQL

-

Title: "Two tripples mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two tripple mapping, no primary key; (2) subject URI generated by the concatenation of two tripple object values; (3) one tripple object to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x foaf:name ?Name ;
-                   rdf:ID ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID.value"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

30. RMLTC0002a-SQLServer

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student ("ID", "Name") values (10, 'Venus');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

31. RMLTC0002a-XML

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10".
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

32. RMLTC0002b-CSV

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

33. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

34. RMLTC0002b-MySQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

35. RMLTC0002b-PostgreSQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

36. RMLTC0002b-SPARQL

-

Title: "Two tripples maping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two tripple mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one triple to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x foaf:name ?Name ;
-                   rdf:ID ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

37. RMLTC0002b-SQLServer

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

38. RMLTC0002b-XML

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

39. RMLTC0002c-CSV

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-
-

40. RMLTC0002c-MySQL

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

41. RMLTC0002c-PostgreSQL

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

42. RMLTC0002c-SQLServer

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

43. RMLTC0002d-MySQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

-

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "StudentId";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
-
-
-

44. RMLTC0002d-PostgreSQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

-

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT ('Student' || ID) AS StudentId, ID, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "studentid";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
-
-
-

45. RMLTC0002d-SQLServer

-

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

-

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "StudentId";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
-
-
-

46. RMLTC0002e-CSV

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-
-

47. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

48. RMLTC0002e-MySQL

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Students\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

49. RMLTC0002e-PostgreSQL

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Students\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

50. RMLTC0002e-SQLServer

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Students\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

51. RMLTC0002e-XML

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-
-

52. RMLTC0002f-MySQL

-

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

-

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Student;
-CREATE TABLE Student (
-ID INTEGER,
-Name VARCHAR(15)
-);
-INSERT INTO Student (ID, Name) VALUES(10,'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Student\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "\"ID\""
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "\"Name\""
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

53. RMLTC0002f-PostgreSQL

-

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

-

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS Student CASCADE;
-CREATE TABLE Student (
-ID INTEGER,
-Name VARCHAR(15)
-);
-INSERT INTO Student (ID, Name) VALUES(10,'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Student\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "\"ID\""
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "\"Name\""
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

54. RMLTC0002f-SQLServer

-

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

-

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS TestDB.Student;
-CREATE TABLE Student (
-ID INTEGER,
-Name VARCHAR(15)
-);
-INSERT INTO Student (ID, Name) VALUES(10,'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Student\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "\"ID\""
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "\"Name\""
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

55. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

56. RMLTC0002g-MySQL

-

Title: "Two columns mapping, invalid SQL query"

-

Description: "Tests the presence of an invalid SQL query"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

57. RMLTC0002g-PostgreSQL

-

Title: "Two columns mapping, invalid SQL query"

-

Description: "Tests the presence of an invalid SQL query"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

58. RMLTC0002g-SPARQL

-

Title: "Two tripples mapping, invalid SPARQL query"

-

Description: "Tests the presence of an invalid SPARQL query"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT qsdfqsdf sqdfqsdfsd ?Nsdfqs ame ?ID qmsndfknqskfmdnemznfmkznfmizmnknfmz
-            WHERE {
-                ?x foaf:name ?Name ;
-                   rdf:ID ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

59. RMLTC0002g-SQLServer

-

Title: "Two columns mapping, invalid SQL query"

-

Description: "Tests the presence of an invalid SQL query"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

60. RMLTC0002h-MySQL

-

Title: "Two columns mapping, duplicate column name in SELECT"

-

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

61. RMLTC0002h-PostgreSQL

-

Title: "Two columns mapping, duplicate column name in SELECT"

-

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

62. RMLTC0002h-SPARQL

-

Title: "Two tripples mapping, duplicate variable name in SELECT"

-

Description: "Tests the presence of duplicate variable names in the SELECT list of the SPARQL query"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?Name
-            WHERE {
-                ?x foaf:name ?Name ;
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

63. RMLTC0002h-SQLServer

-

Title: "Two columns mapping, duplicate column name in SELECT"

-

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

64. RMLTC0002i-MySQL

-

Title: "Two columns mapping, SQL Version identifier"

-

Description: "Tests the presence of a SQL Version identifier "

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

65. RMLTC0002i-PostgreSQL

-

Title: "Two columns mapping, SQL Version identifier"

-

Description: "Tests the presence of a SQL Version identifier "

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

66. RMLTC0002i-SQLServer

-

Title: "Two columns mapping, SQL Version identifier"

-

Description: "Tests the presence of a SQL Version identifier "

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

67. RMLTC0002j-MySQL

-

Title: "Two columns mapping, qualified column names"

-

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT NoColumnName, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

68. RMLTC0002j-PostgreSQL

-

Title: "Two columns mapping, qualified column names"

-

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT NoColumnName, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

69. RMLTC0002j-SQLServer

-

Title: "Two columns mapping, qualified column names"

-

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT NoColumnName, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

70. RMLTC0003a-MySQL

-

Title: "Three columns mapping, undefined SQL Version identifier"

-

Description: "Tests the presence of an undefined SQL Version identifier"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT FirstName, LastName FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

71. RMLTC0003a-PostgreSQL

-

Title: "Three columns mapping, undefined SQL Version identifier"

-

Description: "Tests the presence of an undefined SQL Version identifier"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT FirstName, LastName FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

72. RMLTC0003a-SQLServer

-

Title: "Three columns mapping, undefined SQL Version identifier"

-

Description: "Tests the presence of an undefined SQL Version identifier"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT FirstName, LastName FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

73. RMLTC0003b-MySQL

-

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT ID, LastName, CONCAT(`FirstName`, '', `LastName`) as Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{LastName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
-
-
-

74. RMLTC0003b-PostgreSQL

-

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  id INTEGER,
-  firstname VARCHAR(50),
-  lastname VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT id, lastname, concat_ws(firstname, '', lastname) as name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{id}/{lastname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
-
-
-

75. RMLTC0003b-SQLServer

-

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT ID, LastName, concat_ws(FirstName, '', LastName) as Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{LastName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
-
-
-

76. RMLTC0003c-CSV

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

77. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

78. RMLTC0003c-MySQL

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

79. RMLTC0003c-PostgreSQL

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

80. RMLTC0003c-SPARQL

-

Title: "Three tripple mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName.value} {LastName.value}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

81. RMLTC0003c-SQLServer

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

82. RMLTC0003c-XML

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

83. RMLTC0004a-CSV

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

84. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

85. RMLTC0004a-MySQL

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

86. RMLTC0004a-PostgreSQL

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-

87. RMLTC0004a-SPARQL

-

Title: "Two BlankNodes mapping, from one object to two different triples"

-

Description: "Tests: (1) two BlankNodes mapping, (2) subject URI generated by a tripple object value; (3) from one BlankNode to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-
-[] a ns1:Student ;
-    ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Student
-            WHERE {
-                ?x  a <http://example.com/Student> ;
-                    foaf:name  ?Student .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student.value}"
-    ] .
-
-ex:TriplesMap2 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?Sport
-                WHERE {
-                    ?x  a <http://example.com/Student> ;
-                        <http://example.com/plays> ?sportObject .
-                    ?sportObject foaf:name ?Sport .
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-

88. RMLTC0004a-SQLServer

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

89. RMLTC0004a-XML

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Student>Venus</Student>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

90. RMLTC0004b-CSV

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

91. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

92. RMLTC0004b-MySQL

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

93. RMLTC0004b-PostgreSQL

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

94. RMLTC0004b-SPARQL

-

Title: "One tripple mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-
-[] foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name
-            WHERE {
-                ?x foaf:name ?Name .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name.value}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

95. RMLTC0004b-SQLServer

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

96. RMLTC0004b-XML

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

97. RMLTC0005a-CSV

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
fname,lname,amount
-Bob,Smith,30.0E0
-Sue,Jones,20.0E0
-Bob,Smith,30.0E0
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

98. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

99. RMLTC0005a-MySQL

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-
-

100. RMLTC0005a-PostgreSQL

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-
-

101. RMLTC0005a-SQLServer

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-
-

102. RMLTC0005a-XML

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-  <person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30.0E0</amount>
-  </person>
-  <person>
-    <fname>Sue</fname>
-    <lname>Jones</lname>
-    <amount>20.0E0</amount>
-  </person>
-  <person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30.0E0</amount>
-  </person>
-</persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

103. RMLTC0005b-MySQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/base/IOUs>;
-      rml:template "{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-    
-
-
-

104. RMLTC0005b-PostgreSQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/base/IOUs>;
-      rml:template "{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-    
-
-
-

105. RMLTC0005b-SQLServer

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/base/IOUs>;
-      rml:template "{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-    
-
-
-

106. RMLTC0006a-CSV

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

107. RMLTC0006a-JSON

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

108. RMLTC0006a-MySQL

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

109. RMLTC0006a-PostgreSQL

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

110. RMLTC0006a-SPARQL

-

Title: "rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?BadStudent ?LastName ?ID
-            WHERE {
-
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

111. RMLTC0006a-SQLServer

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

112. RMLTC0006a-XML

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

113. RMLTC0007a-CSV

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

114. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

115. RMLTC0007a-MySQL

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

116. RMLTC0007a-PostgreSQL

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

117. RMLTC0007a-SPARQL

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

118. RMLTC0007a-SQLServer

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

119. RMLTC0007a-XML

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

120. RMLTC0007b-CSV

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

121. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

122. RMLTC0007b-MySQL

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

123. RMLTC0007b-PostgreSQL

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

124. RMLTC0007b-SPARQL

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

125. RMLTC0007b-SQLServer

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

126. RMLTC0007b-XML

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

127. RMLTC0007c-CSV

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

128. RMLTC0007c-JSON

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

129. RMLTC0007c-MySQL

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

130. RMLTC0007c-PostgreSQL

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

131. RMLTC0007c-SPARQL

-

Title: "One object mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

132. RMLTC0007c-SQLServer

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

133. RMLTC0007c-XML

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

134. RMLTC0007d-CSV

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

135. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

136. RMLTC0007d-MySQL

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

137. RMLTC0007d-PostgreSQL

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

138. RMLTC0007d-SPARQL

-

Title: "One object mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

139. RMLTC0007d-SQLServer

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

140. RMLTC0007d-XML

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

141. RMLTC0007e-CSV

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

142. RMLTC0007e-JSON

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

143. RMLTC0007e-MySQL

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

144. RMLTC0007e-PostgreSQL

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

145. RMLTC0007e-SPARQL

-

Title: "One object mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

146. RMLTC0007e-SQLServer

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

147. RMLTC0007e-XML

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

148. RMLTC0007f-CSV

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

149. RMLTC0007f-JSON

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

150. RMLTC0007f-MySQL

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

151. RMLTC0007f-PostgreSQL

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

152. RMLTC0007f-SPARQL

-

Title: "One object mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

153. RMLTC0007f-SQLServer

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

154. RMLTC0007f-XML

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

155. RMLTC0007g-CSV

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

156. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

157. RMLTC0007g-MySQL

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

158. RMLTC0007g-PostgreSQL

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

159. RMLTC0007g-SPARQL

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

160. RMLTC0007g-SQLServer

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

161. RMLTC0007g-XML

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

162. RMLTC0007h-CSV

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-
-

163. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

164. RMLTC0007h-MySQL

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

165. RMLTC0007h-PostgreSQL

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

166. RMLTC0007h-SPARQL

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

167. RMLTC0007h-SQLServer

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

168. RMLTC0007h-XML

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-
-

169. RMLTC0008a-CSV

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

170. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

171. RMLTC0008a-MySQL

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-
-

172. RMLTC0008a-PostgreSQL

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-
-

173. RMLTC0008a-SPARQL

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?Sport ?ID
-            WHERE {
-                ?x  foaf:name ?Name ;
-                    rdf:ID    ?ID ;
-                    <http://example.com/plays>  ?sportObject .
-                ?sportObject foaf:name ?Sport .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID.value"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport.value"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID.value}/{Name.value}"
-        ];
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

174. RMLTC0008a-SQLServer

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-
-

175. RMLTC0008a-XML

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

176. RMLTC0008b-CSV

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

177. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

178. RMLTC0008b-MySQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

179. RMLTC0008b-PostgreSQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

180. RMLTC0008b-SPARQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x  foaf:name ?Name ;
-                    rdf:ID    ?ID ;
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap ex:RefObjectMap1;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID.value"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-ex:RefObjectMap1 a rml:RefObjectMap;
-  rml:parentTriplesMap ex:TriplesMap2 .
-
-ex:TriplesMap2 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?Sport
-                WHERE {
-                    ?x a <http://example.com/Sport> .
-                    ?x foaf:name ?Sport .
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

181. RMLTC0008b-SQLServer

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

182. RMLTC0008b-XML

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

183. RMLTC0008c-CSV

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

184. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

185. RMLTC0008c-MySQL

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

186. RMLTC0008c-PostgreSQL

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

187. RMLTC0008c-SPARQL

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?Name ?ID
-              WHERE {
-                  ?x  foaf:name ?Name ;
-                      rdf:ID    ?ID ;
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base/#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

188. RMLTC0008c-SQLServer

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

189. RMLTC0008c-XML

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

190. RMLTC0009a-CSV

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
ID,Sport,Name
-10,100,Venus Williams
-20,,Demi Moore
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

191. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

192. RMLTC0009a-MySQL

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Sport VARCHAR(50),
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL , 'Demi Moore');
-
-DROP TABLE IF EXISTS test.sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

193. RMLTC0009a-PostgreSQL

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL , 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

194. RMLTC0009a-SPARQL

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            rdf:ID "100" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-[] ns1:plays [ a ns1:Sport ] ;
-    rdf:ID "20" ;
-    foaf:name "Demi Moore" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?Name ?ID ?Sport
-              WHERE {
-                  ?x  foaf:name ?Name ;
-                      rdf:ID    ?ID ;
-                      <http://example.com/plays> ?sportObject .
-                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
-                                            rdf:ID ?Sport . }
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL1>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID.value}"
-    ] .
-
-<http://example.com/base/#InputSPARQL1> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/#InputSPARQL2> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds2/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?ID ?Name
-                WHERE {
-                    ?x  foaf:name ?Name ;
-                        rdf:ID    ?ID ;
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL2>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID.value}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

195. RMLTC0009a-SQLServer

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL , 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

196. RMLTC0009a-XML

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>100</Sport>
-  </student>
-  <student>
-    <ID>20</ID>
-    <Name>Demi Moore</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/sports/sport";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

197. RMLTC0009b-CSV

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
ID,Sport,Name
-10,100,Venus Williams
-20,,Demi Moore
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

198. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

199. RMLTC0009b-MySQL

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Sport VARCHAR(50),
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL, 'Demi Moore');
-
-DROP TABLE IF EXISTS test.sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

200. RMLTC0009b-PostgreSQL

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL, 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

201. RMLTC0009b-SPARQL

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            rdf:ID "100" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-[] ns1:plays [ a ns1:Sport ] ;
-    rdf:ID "20" ;
-    foaf:name "Demi Moore" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?Name ?ID ?Sport
-              WHERE {
-                  ?x  foaf:name ?Name ;
-                      rdf:ID    ?ID ;
-                      <http://example.com/plays> ?sportObject .
-                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
-                                            rdf:ID ?Sport . }
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL1>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport.value";
-              rml:parent "ID.value"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID.value}"
-    ] .
-
-<http://example.com/base/#InputSPARQL1> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/#InputSPARQL2> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds2/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?ID ?Name
-                WHERE {
-                    ?x  foaf:name ?Name ;
-                        rdf:ID    ?ID ;
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL2>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID.value}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

202. RMLTC0009b-SQLServer

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL, 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

203. RMLTC0009b-XML

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>100</Sport>
-  </student>
-  <student>
-    <ID>20</ID>
-    <Name>Demi Moore</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/sports/sport";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

204. RMLTC0009c-MySQL

-

Title: "Unnamed column in a logical table"

-

Description: "Test a logical table with unnamed column."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Sport;
-DROP TABLE IF EXISTS test.Student;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport)
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-
-
-
-
-

205. RMLTC0009c-PostgreSQL

-

Title: "Unnamed column in a logical table"

-

Description: "Test a logical table with unnamed column."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Sport;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport)
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-
-
-
-
-

206. RMLTC0009c-SQLServer

-

Title: "Unnamed column in a logical table"

-

Description: "Test a logical table with unnamed column."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Sport;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport)
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-
-
-
-
-

207. RMLTC0009d-MySQL

-

Title: "Named column in logical table"

-

Description: "Test a logical table named column."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Student;
-DROP TABLE IF EXISTS test.Sport;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport) as SPORTCOUNT
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "SPORTCOUNT"
-        ];
-      rml:predicate ex:numSport
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-
-
-
-
-
-

208. RMLTC0009d-PostgreSQL

-

Title: "Named column in logical table"

-

Description: "Test a logical table named column."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Student;
-DROP TABLE IF EXISTS Sport;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport) as SPORTCOUNT
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "sportcount"
-        ];
-      rml:predicate ex:numSport
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-
-
-
-
-
-

209. RMLTC0009d-SQLServer

-

Title: "Named column in logical table"

-

Description: "Test a logical table named column."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Student;
-DROP TABLE IF EXISTS Sport;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport) as SPORTCOUNT
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "SPORTCOUNT"
-        ];
-      rml:predicate ex:numSport
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-
-
-
-
-
-

210. RMLTC0010a-CSV

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
Country Code,Name,ISO 3166
-1,"Bolivia, Plurinational State of",BO
-2,"Ireland",IE
-3,"Saint Martin (French part)",MF
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

211. RMLTC0010a-JSON

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

212. RMLTC0010a-MySQL

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.country_info;
-
-CREATE TABLE country_info (
-  `Country Code` INTEGER,
-  Name VARCHAR(100),
-  `ISO 3166` VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

213. RMLTC0010a-PostgreSQL

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

214. RMLTC0010a-SQLServer

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

215. RMLTC0010b-CSV

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
Country Code,Name,ISO 3166
-1,"Bolivia, Plurinational State of",BO
-2,Ireland,IE
-3,"Saint Martin (French part)",MF
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

216. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

217. RMLTC0010b-MySQL

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.country_info;
-
-CREATE TABLE country_info (
-  `Country Code` INTEGER,
-  Name VARCHAR(100),
-  `ISO 3166` VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

218. RMLTC0010b-PostgreSQL

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

219. RMLTC0010b-SQLServer

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

220. RMLTC0010b-XML

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country>
-    <CountryCode>1</CountryCode>
-    <Name>Bolivia, Plurinational State of</Name>
-    <ISO3166>BO</ISO3166>
-  </country>
-  <country>
-    <CountryCode>2</CountryCode>
-    <Name>Ireland</Name>
-    <ISO3166>IE</ISO3166>
-  </country>
-  <country>
-    <CountryCode>3</CountryCode>
-    <Name>Saint Martin (French part)</Name>
-    <ISO3166>MF</ISO3166>
-  </country>
-</countries>
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{CountryCode}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

221. RMLTC0010c-CSV

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
Country Code,Name,ISO 3166
-1,"Bolivia, Plurinational State of",BO
-2,Ireland,IE
-3,Saint Martin (French part),MF
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

222. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

223. RMLTC0010c-MySQL

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.country_info;
-
-CREATE TABLE country_info (
-  `Country Code` INTEGER,
-  Name VARCHAR(100),
-  `ISO 3166` VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

224. RMLTC0010c-PostgreSQL

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

225. RMLTC0010c-SQLServer

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

226. RMLTC0010c-XML

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country>
-    <CountryCode>1</CountryCode>
-    <Name>Bolivia, Plurinational State of</Name>
-    <ISO3166>BO</ISO3166>
-  </country>
-  <country>
-    <CountryCode>2</CountryCode>
-    <Name>Ireland</Name>
-    <ISO3166>IE</ISO3166>
-  </country>
-  <country>
-    <CountryCode>3</CountryCode>
-    <Name>Saint Martin (French part)</Name>
-    <ISO3166>MF</ISO3166>
-  </country>
-</countries>
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{CountryCode}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

227. RMLTC0011a-MySQL

-

Title: "M to M relation, by using a SQL query"

-

Description: "Tests, M to M relations, by using a SQL query"

-

Error expected? No

-

Input

-
USE test;
-SET FOREIGN_KEY_CHECKS = 0;
-DROP TABLE IF EXISTS test.Student_Sport;
-DROP TABLE IF EXISTS test.Sport;
-DROP TABLE IF EXISTS test.Student;
-SET FOREIGN_KEY_CHECKS = 1;
-
-CREATE TABLE Student (
-ID integer PRIMARY KEY,
-FirstName varchar(50),
-LastName varchar(50)
-);
-CREATE TABLE Sport (
-ID integer PRIMARY KEY,
-Description varchar(50)
-);
-CREATE TABLE Student_Sport (
-ID_Student integer,
-ID_Sport integer,
-PRIMARY KEY (ID_Student,ID_Sport),
-FOREIGN KEY (ID_Student) REFERENCES Student(ID),
-FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
-
-INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
-INSERT INTO Sport (ID, Description) VALUES (111,'Football');
-INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
-
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT Student.ID as ID,
-              Student.FirstName as FirstName,
-              Student.LastName as LastName,
-              Sport.Description as Description,
-              Sport.ID as Sport_ID
-       FROM Student,Sport,Student_Sport
-       WHERE Student.ID = Student_Sport.ID_Student
-       AND Sport.ID = Student_Sport.ID_Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ], [
-      rml:objectMap [
-          rml:template "http://example.com/{Sport_ID}/{Description}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT * FROM Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Description}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
-<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
-<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
-<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
-<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/111/Football> <http://example.com/description> "Football" .
-<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
-<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
-<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
-<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
-
-
-
-

228. RMLTC0011a-PostgreSQL

-

Title: "M to M relation, by using a SQL query"

-

Description: "Tests, M to M relations, by using a SQL query"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Student_Sport;
-DROP TABLE IF EXISTS Sport CASCADE;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Student (
-ID integer PRIMARY KEY,
-FirstName varchar(50),
-LastName varchar(50)
-);
-CREATE TABLE Sport (
-ID integer PRIMARY KEY,
-Description varchar(50)
-);
-CREATE TABLE Student_Sport (
-ID_Student integer,
-ID_Sport integer,
-PRIMARY KEY (ID_Student,ID_Sport),
-FOREIGN KEY (ID_Student) REFERENCES Student(ID),
-FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
-
-INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
-INSERT INTO Sport (ID, Description) VALUES (111,'Football');
-INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
-
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT Student.ID as ID,
-              Student.FirstName as FirstName,
-              Student.LastName as LastName,
-              Sport.Description as Description,
-              Sport.ID as Sport_ID
-       FROM Student,Sport,Student_Sport
-       WHERE Student.ID = Student_Sport.ID_Student
-       AND Sport.ID = Student_Sport.ID_Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "lastname"
-        ];
-      rml:predicate ex:lastName
-    ], [
-      rml:objectMap [
-          rml:template "http://example.com/{sport_id}/{description}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{id}/{firstname};{lastname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT * FROM Sport ;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "description"
-        ];
-      rml:predicate ex:description
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{id}/{description}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
-<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
-<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
-<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
-<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/111/Football> <http://example.com/description> "Football" .
-<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
-<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
-<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
-<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
-
-
-
-

229. RMLTC0011a-SQLServer

-

Title: "M to M relation, by using a SQL query"

-

Description: "Tests, M to M relations, by using a SQL query"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE Student (
-ID integer PRIMARY KEY,
-FirstName varchar(50),
-LastName varchar(50)
-);
-CREATE TABLE Sport (
-ID integer PRIMARY KEY,
-Description varchar(50)
-);
-CREATE TABLE Student_Sport (
-ID_Student integer,
-ID_Sport integer,
-PRIMARY KEY (ID_Student,ID_Sport),
-FOREIGN KEY (ID_Student) REFERENCES Student(ID),
-FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
-
-INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
-INSERT INTO Sport (ID, Description) VALUES (111,'Football');
-INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
-
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT Student.ID as ID,
-              Student.FirstName as FirstName,
-              Student.LastName as LastName,
-              Sport.Description as Description,
-              Sport.ID as Sport_ID
-       FROM Student,Sport,Student_Sport
-       WHERE Student.ID = Student_Sport.ID_Student
-       AND Sport.ID = Student_Sport.ID_Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ], [
-      rml:objectMap [
-          rml:template "http://example.com/{Sport_ID}/{Description}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT * FROM Sport ;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Description}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
-<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
-<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
-<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
-<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/111/Football> <http://example.com/description> "Football" .
-<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
-<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
-<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
-<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
-
-
-
-

230. RMLTC0011b-CSV

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-11,Fernando,Alonso
-12,David,Villa
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

231. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

232. RMLTC0011b-MySQL

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
USE test;
-SET FOREIGN_KEY_CHECKS = 0;
-DROP TABLE IF EXISTS test.student_sport;
-DROP TABLE IF EXISTS test.student;
-DROP TABLE IF EXISTS test.sport;
-SET FOREIGN_KEY_CHECKS = 1;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Description VARCHAR(200)
-);
-INSERT INTO sport values ('110','Tennis');
-INSERT INTO sport values ('111','Football');
-INSERT INTO sport values ('112','Formula1');
-
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(200),
-  LastName VARCHAR(200)
-);
-INSERT INTO student values ('10','Venus','Williams');
-INSERT INTO student values ('11','Fernando','Alonso');
-INSERT INTO student values ('12','David','Villa');
-
-
-CREATE TABLE student_sport (
-  ID_Student INTEGER,
-  ID_Sport INTEGER
-);
-INSERT INTO student_sport values ('10', '110');
-INSERT INTO student_sport values ('11','111');
-INSERT INTO student_sport values ('11','112');
-INSERT INTO student_sport values ('12','111');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

233. RMLTC0011b-PostgreSQL

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student_sport;
-DROP TABLE IF EXISTS student;
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Description VARCHAR(200)
-);
-INSERT INTO sport values ('110','Tennis');
-INSERT INTO sport values ('111','Football');
-INSERT INTO sport values ('112','Formula1');
-
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(200),
-  LastName VARCHAR(200)
-);
-INSERT INTO student values ('10','Venus','Williams');
-INSERT INTO student values ('11','Fernando','Alonso');
-INSERT INTO student values ('12','David','Villa');
-
-
-CREATE TABLE student_sport (
-  ID_Student INTEGER,
-  ID_Sport INTEGER
-);
-INSERT INTO student_sport values ('10', '110');
-INSERT INTO student_sport values ('11','111');
-INSERT INTO student_sport values ('11','112');
-INSERT INTO student_sport values ('12','111');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{id_sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{id_student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "lastname"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{id}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

234. RMLTC0011b-SQLServer

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student_sport;
-DROP TABLE IF EXISTS student;
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Description VARCHAR(200)
-);
-INSERT INTO sport values ('110','Tennis');
-INSERT INTO sport values ('111','Football');
-INSERT INTO sport values ('112','Formula1');
-
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(200),
-  LastName VARCHAR(200)
-);
-INSERT INTO student values ('10','Venus','Williams');
-INSERT INTO student values ('11','Fernando','Alonso');
-INSERT INTO student values ('12','David','Villa');
-
-
-CREATE TABLE student_sport (
-  ID_Student INTEGER,
-  ID_Sport INTEGER
-);
-INSERT INTO student_sport values ('10', '110');
-INSERT INTO student_sport values ('11','111');
-INSERT INTO student_sport values ('11','112');
-INSERT INTO student_sport values ('12','111');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

235. RMLTC0011b-XML

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<Students>
-  <Student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </Student>
-  <Student>
-    <ID>11</ID>
-    <FirstName>Fernando</FirstName>
-    <LastName>Alonso</LastName>
-  </Student>
-  <Student>
-    <ID>12</ID>
-    <FirstName>David</FirstName>
-    <LastName>Villa</LastName>
-  </Student>
-</Students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/links/link";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Students/Student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Sports/Sport";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

236. RMLTC0012a-CSV

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
fname,lname,amount
-Bob,Smith,30
-Sue,Jones,20
-Bob,Smith,30
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

237. RMLTC0012a-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

238. RMLTC0012a-MySQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount INT);
-/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

239. RMLTC0012a-PostgreSQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount INT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

240. RMLTC0012a-SPARQL

-

Title: "Duplicate triples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-[] ns1:amount "20" ;
-    foaf:firstName "Sue" ;
-    foaf:lastName "Jones" .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?fname ?lname ?amount
-            WHERE {
-                ?x  foaf:firstName ?fname ;
-                    foaf:lastName  ?lname ;
-                    <http://example.com/amount> ?amount .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname.value} {lname.value}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount.value"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname.value}{lname.value}{amount.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

241. RMLTC0012a-SQLServer

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount INT);
-/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

242. RMLTC0012a-XML

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<Persons>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-  <Person>
-    <fname>Sue</fname>
-    <lname>Jones</lname>
-    <amount>20</amount>
-  </Person>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-</Persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

243. RMLTC0012b-CSV

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

244. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

245. RMLTC0012b-MySQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.persons;
-
-CREATE TABLE persons (
-  fname VARCHAR(200),
-  lname VARCHAR(200),
-  amount INTEGER
-);
-INSERT INTO persons values ('Bob','Smith','30');
-INSERT INTO persons values ('Sue','Jones','20');
-INSERT INTO persons values ('Bob','Smith','30');
-
-DROP TABLE IF EXISTS test.lives;
-
-CREATE TABLE lives (
-  fname VARCHAR(200),
-  lname VARCHAR(200),
-  city VARCHAR(200)
-);
-INSERT INTO lives values ('Bob','Smith','London');
-INSERT INTO lives values ('Sue','Jones','Madrid');
-INSERT INTO lives values ('Bob','Smith','London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "persons"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "lives"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

246. RMLTC0012b-PostgreSQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS persons;
-
-CREATE TABLE persons (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "amount" INTEGER
-);
-INSERT INTO persons values ('Bob','Smith','30');
-INSERT INTO persons values ('Sue','Jones','20');
-INSERT INTO persons values ('Bob','Smith','30');
-
-DROP TABLE IF EXISTS lives;
-
-CREATE TABLE lives (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "city" VARCHAR(200)
-);
-INSERT INTO lives values ('Bob','Smith','London');
-INSERT INTO lives values ('Sue','Jones','Madrid');
-INSERT INTO lives values ('Bob','Smith','London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "persons"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "lives"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

247. RMLTC0012b-SPARQL

-

Title: "Duplicate triples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-[] ns1:amount "20" ;
-    foaf:firstName "Sue" ;
-    foaf:lastName "Jones" .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?fname ?lname
-              WHERE {
-                   ?x  foaf:firstName ?fname ;
-                       foaf:lastName  ?lname ;
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL1>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname.value} {lname.value}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname.value}{lname.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?city ?fname ?lname
-                WHERE {
-                    ?x  foaf:firstName ?fname ;
-                        foaf:lastName  ?lname ;
-                        <http://example.com/city> ?city .
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL2>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city.value"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname.value}{lname.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#InputSPARQL1> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/#InputSPARQL2> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds2/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

248. RMLTC0012b-SQLServer

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS persons;
-
-CREATE TABLE persons (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "amount" INTEGER
-);
-INSERT INTO persons values ('Bob','Smith','30');
-INSERT INTO persons values ('Sue','Jones','20');
-INSERT INTO persons values ('Bob','Smith','30');
-
-DROP TABLE IF EXISTS lives;
-
-CREATE TABLE lives (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "city" VARCHAR(200)
-);
-INSERT INTO lives values ('Bob','Smith','London');
-INSERT INTO lives values ('Sue','Jones','Madrid');
-INSERT INTO lives values ('Bob','Smith','London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "persons"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "lives"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

249. RMLTC0012b-XML

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Lives/Live";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

250. RMLTC0012c-CSV

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
fname,lname,amount
-Bob,Smith,30
-Sue,Jones,20
-Bob,Smith,30
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

251. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

252. RMLTC0012c-MySQL

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

253. RMLTC0012c-PostgreSQL

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-
-

254. RMLTC0012c-SQLServer

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

255. RMLTC0012c-XML

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<Persons>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith></lname>
-    <amount>30</amount>
-  </Person>
-  <Person>
-    <fname>Sue</fname>
-    <lname>Jones></lname>
-    <amount>20</amount>
-  </Person>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith></lname>
-    <amount>30</amount>
-  </Person>
-</Persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

256. RMLTC0012d-CSV

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
fname,lname,amount
-Bob,Smith,30
-Sue,Jones,20
-Bob,Smith,30
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{amount}_{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

257. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

258. RMLTC0012d-MySQL

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}"
-    ], [
-      rml:template "{amount}_{fname}_{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

259. RMLTC0012d-PostgreSQL

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}"
-    ], [
-      rml:template "{amount}_{fname}_{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-
-

260. RMLTC0012d-SQLServer

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}"
-    ], [
-      rml:template "{amount}_{fname}_{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

261. RMLTC0012d-XML

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<Persons>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-  <Person>
-    <fname>Sue</fname>
-    <lname>Jones</lname>
-    <amount>20</amount>
-  </Person>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-</Persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{amount}_{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

262. RMLTC0012e-MySQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/IOUs>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Lives"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/Lives>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate <http://example.com/base/IOUs#city>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{city}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
-_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
-
-
-
-
-

263. RMLTC0012e-PostgreSQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/IOUs>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Lives"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/Lives>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate <http://example.com/base/IOUs#city>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{city}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
-_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
-
-
-
-
-

264. RMLTC0012e-SQLServer

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/IOUs>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Lives"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/Lives>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate <http://example.com/base/IOUs#city>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{city}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
-_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
-
-
-
-
-

265. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

266. RMLTC0013a-MySQL

-

Title: "Generation of empty triples from referenced columns that have null values"

-

Description: "Tests the generation of empty triples from referenced columns that have null values"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Person;
-
-CREATE TABLE Person (
-ID integer,
-Name varchar(50),
-DateOfBirth varchar(50),
-PRIMARY KEY (ID)
-);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Person"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-
-
-

267. RMLTC0013a-PostgreSQL

-

Title: "Generation of empty triples from referenced columns that have null values"

-

Description: "Tests the generation of empty triples from referenced columns that have null values"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Person;
-
-CREATE TABLE Person (
-"ID" integer,
-"Name" varchar(50),
-"DateOfBirth" varchar(50),
-PRIMARY KEY ("ID")
-);
-INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (1,'Alice', NULL);
-INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (2,'Bob', 'September, 2010');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Person"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-
-
-

268. RMLTC0013a-SQLServer

-

Title: "Generation of empty triples from referenced columns that have null values"

-

Description: "Tests the generation of empty triples from referenced columns that have null values"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Person;
-
-CREATE TABLE Person (
-ID integer,
-Name varchar(50),
-DateOfBirth varchar(50),
-PRIMARY KEY (ID)
-);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Person"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-
-
-

269. RMLTC0014d-MySQL

-

Title: "three tables, one primary key, one foreign key"

-

Description: "Test the translation of database type codes to IRIs"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.DEPT;
-DROP TABLE IF EXISTS test.EMP;
-DROP TABLE IF EXISTS test.LIKES;
-
-CREATE TABLE DEPT (
-      deptno INTEGER UNIQUE,
-      dname VARCHAR(30),
-      loc VARCHAR(100));
-INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
-
-CREATE TABLE EMP (
-      empno INTEGER PRIMARY KEY,
-      ename VARCHAR(100),
-      job VARCHAR(30),
-      deptno INTEGER REFERENCES DEPT (deptno),
-      etype VARCHAR(30));
-INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
-
-CREATE TABLE LIKES (
-      id INTEGER,
-      likeType VARCHAR(30),
-      likedObj VARCHAR(100));
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-      SELECT EMP.*, (CASE job
-        WHEN 'CLERK' THEN 'general-office'
-        WHEN 'NIGHTGUARD' THEN 'security'
-        WHEN 'ENGINEER' THEN 'engineering'
-      END) AS ROLE FROM EMP
-    """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://data.example.com/roles/{ROLE}"
-        ];
-      rml:predicate ex:role
-    ];
-  rml:subjectMap [
-      rml:template "http://data.example.com/employee/{empno}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
-
-
-

270. RMLTC0014d-PostgreSQL

-

Title: "three tables, one primary key, one foreign key"

-

Description: "Test the translation of database type codes to IRIs"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS LIKES;
-DROP TABLE IF EXISTS EMP;
-DROP TABLE IF EXISTS DEPT;
-
-CREATE TABLE DEPT (
-      deptno INTEGER UNIQUE,
-      dname VARCHAR(30),
-      loc VARCHAR(100));
-INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
-
-CREATE TABLE EMP (
-      empno INTEGER PRIMARY KEY,
-      ename VARCHAR(100),
-      job VARCHAR(30),
-      deptno INTEGER REFERENCES DEPT (deptno),
-      etype VARCHAR(30));
-INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
-
-CREATE TABLE LIKES (
-      id INTEGER,
-      likeType VARCHAR(30),
-      likedObj VARCHAR(100));
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-      SELECT EMP.*, (CASE job
-        WHEN 'CLERK' THEN 'general-office'
-        WHEN 'NIGHTGUARD' THEN 'security'
-        WHEN 'ENGINEER' THEN 'engineering'
-      END) AS ROLE FROM EMP
-    """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://data.example.com/roles/{role}"
-        ];
-      rml:predicate ex:role
-    ];
-  rml:subjectMap [
-      rml:template "http://data.example.com/employee/{empno}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
-
-
-

271. RMLTC0014d-SQLServer

-

Title: "three tables, one primary key, one foreign key"

-

Description: "Test the translation of database type codes to IRIs"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE DEPT (
-      deptno INTEGER UNIQUE,
-      dname VARCHAR(30),
-      loc VARCHAR(100));
-INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
-
-CREATE TABLE EMP (
-      empno INTEGER PRIMARY KEY,
-      ename VARCHAR(100),
-      job VARCHAR(30),
-      deptno INTEGER REFERENCES DEPT (deptno),
-      etype VARCHAR(30));
-INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
-
-CREATE TABLE LIKES (
-      id INTEGER,
-      likeType VARCHAR(30),
-      likedObj VARCHAR(100));
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-      SELECT EMP.*, (CASE job
-        WHEN 'CLERK' THEN 'general-office'
-        WHEN 'NIGHTGUARD' THEN 'security'
-        WHEN 'ENGINEER' THEN 'engineering'
-      END) AS ROLE FROM EMP
-    """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://data.example.com/roles/{ROLE}"
-        ];
-      rml:predicate ex:role
-    ];
-  rml:subjectMap [
-      rml:template "http://data.example.com/employee/{empno}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
-
-
-

272. RMLTC0015a-CSV

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
Code,Name
-BO,"Bolivia, Plurinational State of"
-IE,Ireland
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

273. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

274. RMLTC0015a-MySQL

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'ES';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

275. RMLTC0015a-PostgreSQL

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'ES';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

276. RMLTC0015a-SQLServer

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT \"Code\", \"Name\", \"Lan\"
-        FROM \"Country\"
-        WHERE \"Lan\" = 'ES';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

277. RMLTC0015a-XML

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
-  <country><Code>IE</Code><Name>Ireland</Name></country>
-</countries>
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

278. RMLTC0015b-CSV

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
Code,Name
-BO,"Bolivia, Plurinational State of"
-IE,Ireland
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-
-

279. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

280. RMLTC0015b-MySQL

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

281. RMLTC0015b-PostgreSQL

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

282. RMLTC0015b-SQLServer

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

283. RMLTC0015b-XML

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
-  <country><Code>IE</Code><Name>Ireland</Name></country>
-</countries>
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-
-

284. RMLTC0016a-MySQL

-

Title: "Table with datatypes: string and integer"

-

Description: "Tests the rr:termtype and datatype conversions: string and integer"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sex"
-        ];
-      rml:predicate ex:gender
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
-<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
-<http://example.com/Patient/10> <http://example.com/gender> "female" .
-<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
-<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
-<http://example.com/Patient/11> <http://example.com/gender> "female" .
-<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
-<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
-<http://example.com/Patient/12> <http://example.com/gender> "male" .
-
-
-
-

285. RMLTC0016a-PostgreSQL

-

Title: "Table with datatypes: string and integer"

-

Description: "Tests the rr:termtype and datatype conversions: string and integer"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "sex"
-        ];
-      rml:predicate ex:gender
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "lastname"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient/{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
-<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
-<http://example.com/Patient/10> <http://example.com/gender> "female" .
-<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
-<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
-<http://example.com/Patient/11> <http://example.com/gender> "female" .
-<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
-<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
-<http://example.com/Patient/12> <http://example.com/gender> "male" .
-
-
-
-

286. RMLTC0016a-SQLServer

-

Title: "Table with datatypes: string and integer"

-

Description: "Tests the rr:termtype and datatype conversions: string and integer"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sex"
-        ];
-      rml:predicate ex:gender
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
-<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
-<http://example.com/Patient/10> <http://example.com/gender> "female" .
-<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
-<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
-<http://example.com/Patient/11> <http://example.com/gender> "female" .
-<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
-<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
-<http://example.com/Patient/12> <http://example.com/gender> "male" .
-
-
-
-

287. RMLTC0016b-MySQL

-

Title: "Table with datatypes: real and float"

-

Description: "Tests the rr:termtype and datatype conversions: real and float"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "Weight"
-        ];
-      rml:predicate ex:weight
-    ], [
-      rml:objectMap [
-          rml:reference "Height"
-        ];
-      rml:predicate ex:height
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-

288. RMLTC0016b-PostgreSQL

-

Title: "Table with datatypes: real and float"

-

Description: "Tests the rr:termtype and datatype conversions: real and float"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "weight"
-        ];
-      rml:predicate ex:weight
-    ], [
-      rml:objectMap [
-          rml:reference "height"
-        ];
-      rml:predicate ex:height
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-

289. RMLTC0016b-SQLServer

-

Title: "Table with datatypes: real and float"

-

Description: "Tests the rr:termtype and datatype conversions: real and float"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "Weight"
-        ];
-      rml:predicate ex:weight
-    ], [
-      rml:objectMap [
-          rml:reference "Height"
-        ];
-      rml:predicate ex:height
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-

290. RMLTC0016c-MySQL

-

Title: "Table with datatypes: date and timestamp"

-

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "BirthDate"
-        ];
-      rml:predicate ex:birthdate
-    ], [
-      rml:objectMap [
-          rml:reference "EntranceDate"
-        ];
-      rml:predicate ex:entrancedate
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-
-
-

291. RMLTC0016c-PostgreSQL

-

Title: "Table with datatypes: date and timestamp"

-

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "birthdate"
-        ];
-      rml:predicate ex:birthdate
-    ], [
-      rml:objectMap [
-          rml:reference "entrancedate"
-        ];
-      rml:predicate ex:entrancedate
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-
-
-

292. RMLTC0016c-SQLServer

-

Title: "Table with datatypes: date and timestamp"

-

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "BirthDate"
-        ];
-      rml:predicate ex:birthdate
-    ], [
-      rml:objectMap [
-          rml:reference "EntranceDate"
-        ];
-      rml:predicate ex:entrancedate
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-
-
-

293. RMLTC0016d-MySQL

-

Title: "Table with datatypes, boolean conversions"

-

Description: "Tests the rr:termtype and datatype conversions: boolean"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "PaidInAdvance"
-        ];
-      rml:predicate ex:paid
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

294. RMLTC0016d-PostgreSQL

-

Title: "Table with datatypes, boolean conversions"

-

Description: "Tests the rr:termtype and datatype conversions: boolean"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "paidinadvance"
-        ];
-      rml:predicate ex:paid
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

295. RMLTC0016d-SQLServer

-

Title: "Table with datatypes, boolean conversions"

-

Description: "Tests the rr:termtype and datatype conversions: boolean"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "PaidInAdvance"
-        ];
-      rml:predicate ex:paid
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

296. RMLTC0016e-MySQL

-

Title: "Table with datatypes, binary column"

-

Description: "Tests the rr:termtype and datatype conversions: binary"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:template "data:image/png;hex,{Photo}"
-        ];
-      rml:predicate ex:photo
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-
-
-

297. RMLTC0016e-PostgreSQL

-

Title: "Table with datatypes, binary column"

-

Description: "Tests the rr:termtype and datatype conversions: binary"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:template "data:image/png;hex,{photo}"
-        ];
-      rml:predicate ex:photo
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-
-
-

298. RMLTC0016e-SQLServer

-

Title: "Table with datatypes, binary column"

-

Description: "Tests the rr:termtype and datatype conversions: binary"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:template "data:image/png;hex,{Photo}"
-        ];
-      rml:predicate ex:photo
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-
-
-

299. RMLTC0019a-CSV

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,http://example.com/ns#Jhon,Smith
-20,Carlos,Mendoza
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

300. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

301. RMLTC0019a-MySQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT ID, FirstName, LastName
-        FROM Employee
-        WHERE ID < 30
-     """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

302. RMLTC0019a-PostgreSQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT ID, FirstName, LastName
-        FROM Employee
-        WHERE ID < 30
-     """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "firstname"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

303. RMLTC0019a-SQLServer

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT ID, FirstName, LastName
-        FROM Employee
-        WHERE ID < 30
-     """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

304. RMLTC0019a-XML

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in elements"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-    <person>
-        <ID>10</ID>
-        <FirstName>http://example.com/ns#Jhon</FirstName>
-        <LastName>Smith</LastName>
-    </person>
-    <person>
-        <ID>20</ID>
-        <FirstName>Carlos</FirstName>
-        <LastName>Mendoza</LastName>
-    </person>
-</persons>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

305. RMLTC0019b-CSV

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
ID,FirstName,LastName
-10,http://example.com/ns#Jhon,Smith
-20,Carlos,Mendoza
-30,Juan Daniel,Crespo
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-
-

306. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    },
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-
-

307. RMLTC0019b-MySQL

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Employee"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

308. RMLTC0019b-PostgreSQL

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Employee"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "firstname"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

309. RMLTC0019b-SQLServer

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Employee"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

310. RMLTC0019b-XML

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-    <person>
-        <ID>10</ID>
-        <FirstName>http://example.com/ns#Jhon</FirstName>
-        <LastName>Smith</LastName>
-    </person>
-    <person>
-        <ID>20</ID>
-        <FirstName>Carlos</FirstName>
-        <LastName>Mendoza</LastName>
-    </person>
-    <person>
-        <ID>30</ID>
-        <FirstName>Juan Daniel</FirstName>
-        <LastName>Crespo</LastName>
-    </person>
-</persons>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-
-

311. RMLTC0020a-CSV

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
Name
-http://example.com/company/Alice
-Bob
-Bob/Charles
-path/../Danny
-Emily Smith
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

312. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

313. RMLTC0020a-MySQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Student_Sport;
-DROP TABLE IF EXISTS test.Student;
-
-CREATE TABLE Student (
-Name VARCHAR(50)
-);
-
-INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
-INSERT INTO Student (Name) VALUES ('Bob');
-INSERT INTO Student (Name) VALUES ('Bob/Charles');
-INSERT INTO Student (Name) VALUES ('path/../Danny');
-INSERT INTO Student (Name) VALUES ('Emily Smith');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

314. RMLTC0020a-PostgreSQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Student (
-Name VARCHAR(50)
-);
-
-INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
-INSERT INTO Student (Name) VALUES ('Bob');
-INSERT INTO Student (Name) VALUES ('Bob/Charles');
-INSERT INTO Student (Name) VALUES ('path/../Danny');
-INSERT INTO Student (Name) VALUES ('Emily Smith');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{name}";
-      rml:termType rml:IRI
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

315. RMLTC0020a-SQLServer

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Student (
-Name VARCHAR(50)
-);
-
-INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
-INSERT INTO Student (Name) VALUES ('Bob');
-INSERT INTO Student (Name) VALUES ('Bob/Charles');
-INSERT INTO Student (Name) VALUES ('path/../Danny');
-INSERT INTO Student (Name) VALUES ('Emily Smith');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

316. RMLTC0020a-XML

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in elements"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student><Name>http://example.com/company/Alice</Name></student>
-  <student><Name>Bob</Name></student>
-  <student><Name>Bob/Charles</Name></student>
-  <student><Name>path/../Danny</Name></student>
-  <student><Name>Emily Smith</Name></student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

317. RMLTC0021a-CSV

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-20,Serena Williams,Tennis
-30,Loena Hendrickx,Figure skating
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

318. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

319. RMLTC0021a-MySQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
-INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

320. RMLTC0021a-PostgreSQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
-INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

321. RMLTC0021a-SPARQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "20" ;
-    foaf:name "Serena Williams" .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Figure skating" ] ;
-    rdf:ID "30" ;
-    foaf:name "Loena Hendrickx" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:RefObjectMap1 a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport.value";
-      rml:parent "Sport.value"
-    ];
-  rml:parentTriplesMap ex:TriplesMap1 .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x  foaf:name ?Name ;
-                    rdf:ID    ?ID ;
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap ex:RefObjectMap1;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

322. RMLTC0021a-SQLServer

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
-INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

323. RMLTC0021a-XML

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-  <student>
-    <ID>20</ID>
-    <Name>Serena Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-  <student>
-    <ID>30</ID>
-    <Name>Loena Hendrickx</Name>
-    <Sport>Figure skating</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

324. RMLTC0022a-CSV

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Error expected? No

-

Input

-
Name,Age
-Venus,21
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

325. RMLTC0022b-CSV

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Error expected? No

-

Input

-
FOO,BAR
-1,string
-2,int
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{BAR}"
-            ];
-          rml:reference "FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

326. RMLTC0022c-CSV

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Error expected? No

-

Input

-
FOO,BAR
-1,string
-2,int
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{BAR}"
-            ];
-          rml:reference "FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/base/datatype#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/base/datatype#int> .
-
-
-

327. RMLTC0023a-XML

-

Title: "XML attributes selection"

-

Description: "Test generation of triples with selected XML attributes"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-  <person fname="Bob" lname="Smith" amount="30.0E0">
-  </person>
-  <person fname="Sue" lname="Jones" amount="20.0E0">
-  </person>
-  <person fname="Bob" lname="Smith" amount="30.0E0">
-  </person>
-</persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "@amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{@fname};{@lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

328. RMLTC0024a-CSV

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{NON_EXISTING_COLUMN}"
-      rml:class foaf:Person;
-    ] .
-
-
-

329. RMLTC0024b-CSV

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{Name}
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}"
-      rml:class foaf:Person;
-    ] .
-
-
-

330. RMLTC0024c-CSV

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
N\ame
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}"
-      rml:class foaf:Person;
-    ] .
-
-
-

331. RMLTC0024d-CSV

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}"
-      rml:class foaf:Person;
-    ] .
-
-
-

332. RMLTC0024e-CSV

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{Name}
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

333. RMLTC0024f-CSV

-

Title: "Invalid IRI template 6"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
N\ame
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250204/index.html b/src/test/resources/rml-core/docs/20250204/index.html deleted file mode 100644 index 8c6f0c2..0000000 --- a/src/test/resources/rml-core/docs/20250204/index.html +++ /dev/null @@ -1,19356 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - -
- -

RML-Core: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Core-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-core - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-CSV

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
Name
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

6. RMLTC0000-MySQL

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
# empty database
-
-
-

7. RMLTC0000-PostgreSQL

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
# empty database
-
-
-

8. RMLTC0000-SPARQL

-

Title: "Empty dataset"

-

Description: "Test if an empty dataset produces an empty RDF graph"

-

Error expected? No

-

Input

-

-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            SELECT ?name
-            WHERE {
-                ?name a rdfs:Literal .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-

-
-
-

9. RMLTC0000-SQLServer

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
# empty database
-
-
-

10. RMLTC0000-XML

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

11. RMLTC0001a-CSV

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

12. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

13. RMLTC0001a-MySQL

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

14. RMLTC0001a-PostgreSQL

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

15. RMLTC0001a-SPARQL

-

Title: "One tripple mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-
-[] foaf:name "Venus" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            SELECT ?name
-            WHERE {
-                ?x foaf:name ?name .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

16. RMLTC0001a-SQLServer

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

17. RMLTC0001a-XML

-

Title: "One column mapping, subject URI generation by using rr:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rr:tmplate; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

18. RMLTC0001b-CSV

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

19. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

20. RMLTC0001b-MySQL

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

21. RMLTC0001b-PostgreSQL

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

22. RMLTC0001b-SPARQL

-

Title: "One tripple mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one tripple mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one tripple to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-
-[] foaf:name "Venus" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            SELECT ?name
-            WHERE {
-                ?x foaf:name ?name .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

23. RMLTC0001b-SQLServer

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

24. RMLTC0001b-XML

-

Title: "One column mapping, generation of a BlankNode subject by using rr:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rr:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

25. RMLTC0002a-CSV

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

26. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

27. RMLTC0002a-MySQL

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

28. RMLTC0002a-PostgreSQL

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

29. RMLTC0002a-SPARQL

-

Title: "Two tripples mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two tripple mapping, no primary key; (2) subject URI generated by the concatenation of two tripple object values; (3) one tripple object to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x foaf:name ?Name ;
-                   rdf:ID ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID.value"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

30. RMLTC0002a-SQLServer

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student ("ID", "Name") values (10, 'Venus');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

31. RMLTC0002a-XML

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10".
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

32. RMLTC0002b-CSV

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

33. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

34. RMLTC0002b-MySQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

35. RMLTC0002b-PostgreSQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

36. RMLTC0002b-SPARQL

-

Title: "Two tripples maping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two tripple mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one triple to one property"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x foaf:name ?Name ;
-                   rdf:ID ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

37. RMLTC0002b-SQLServer

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

38. RMLTC0002b-XML

-

Title: "Two columns mapping, generation of a BlankNode subject by using rr:template and rr:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rr:template; (3) one column to one property"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

39. RMLTC0002c-CSV

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-
-

40. RMLTC0002c-MySQL

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

41. RMLTC0002c-PostgreSQL

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

42. RMLTC0002c-SQLServer

-

Title: "Two columns mapping, an undefined SQL identifier / logical reference"

-

Description: "Tests the presence of an undefined SQL identifier / logical reference"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

43. RMLTC0002d-MySQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

-

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "StudentId";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
-
-
-

44. RMLTC0002d-PostgreSQL

-

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

-

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT ('Student' || ID) AS StudentId, ID, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "studentid";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
-
-
-

45. RMLTC0002d-SQLServer

-

Title: "Two columns mapping, generation of a BlankNode subject by using a SQL Query that concatenates two columns"

-

Description: "Tests (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using a SQL Query that concatenates two columns; (3) one column to one property"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT CONCAT('Student', ID) AS StudentId, ID, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "StudentId";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Student10 <http://xmlns.com/foaf/0.1/name> "Venus".
-
-
-

46. RMLTC0002e-CSV

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-
-

47. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

48. RMLTC0002e-MySQL

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Students\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

49. RMLTC0002e-PostgreSQL

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Students\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

50. RMLTC0002e-SQLServer

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Students\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

51. RMLTC0002e-XML

-

Title: "Two columns mapping, an undefined rr:tableName"

-

Description: "Tests the presence of an undefined rr:tableName"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-
-

52. RMLTC0002f-MySQL

-

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

-

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Student;
-CREATE TABLE Student (
-ID INTEGER,
-Name VARCHAR(15)
-);
-INSERT INTO Student (ID, Name) VALUES(10,'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Student\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "\"ID\""
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "\"Name\""
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

53. RMLTC0002f-PostgreSQL

-

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

-

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS Student CASCADE;
-CREATE TABLE Student (
-ID INTEGER,
-Name VARCHAR(15)
-);
-INSERT INTO Student (ID, Name) VALUES(10,'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Student\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "\"ID\""
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "\"Name\""
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

54. RMLTC0002f-SQLServer

-

Title: "Two columns mapping, delimited identifiers referenced as regular identifiers"

-

Description: "Tests the presence of delimited identifiers referenced as regular identifiers. Within rr:template ID is ok, but Name is not"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS TestDB.Student;
-CREATE TABLE Student (
-ID INTEGER,
-Name VARCHAR(15)
-);
-INSERT INTO Student (ID, Name) VALUES(10,'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:iterator "\"Student\""
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "\"ID\""
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "\"Name\""
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{\"ID\"}/{\"Name\"}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

55. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

56. RMLTC0002g-MySQL

-

Title: "Two columns mapping, invalid SQL query"

-

Description: "Tests the presence of an invalid SQL query"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

57. RMLTC0002g-PostgreSQL

-

Title: "Two columns mapping, invalid SQL query"

-

Description: "Tests the presence of an invalid SQL query"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

58. RMLTC0002g-SPARQL

-

Title: "Two tripples mapping, invalid SPARQL query"

-

Description: "Tests the presence of an invalid SPARQL query"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT qsdfqsdf sqdfqsdfsd ?Nsdfqs ame ?ID qmsndfknqskfmdnemznfmkznfmizmnknfmz
-            WHERE {
-                ?x foaf:name ?Name ;
-                   rdf:ID ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

59. RMLTC0002g-SQLServer

-

Title: "Two columns mapping, invalid SQL query"

-

Description: "Tests the presence of an invalid SQL query"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "SELECT kjnqsdjfbqsdjfmsdnfm FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

60. RMLTC0002h-MySQL

-

Title: "Two columns mapping, duplicate column name in SELECT"

-

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

61. RMLTC0002h-PostgreSQL

-

Title: "Two columns mapping, duplicate column name in SELECT"

-

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

62. RMLTC0002h-SPARQL

-

Title: "Two tripples mapping, duplicate variable name in SELECT"

-

Description: "Tests the presence of duplicate variable names in the SELECT list of the SPARQL query"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?Name
-            WHERE {
-                ?x foaf:name ?Name ;
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

63. RMLTC0002h-SQLServer

-

Title: "Two columns mapping, duplicate column name in SELECT"

-

Description: "Tests the presence of duplicate column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

64. RMLTC0002i-MySQL

-

Title: "Two columns mapping, SQL Version identifier"

-

Description: "Tests the presence of a SQL Version identifier "

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

65. RMLTC0002i-PostgreSQL

-

Title: "Two columns mapping, SQL Version identifier"

-

Description: "Tests the presence of a SQL Version identifier "

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

66. RMLTC0002i-SQLServer

-

Title: "Two columns mapping, SQL Version identifier"

-

Description: "Tests the presence of a SQL Version identifier "

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

67. RMLTC0002j-MySQL

-

Title: "Two columns mapping, qualified column names"

-

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT NoColumnName, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

68. RMLTC0002j-PostgreSQL

-

Title: "Two columns mapping, qualified column names"

-

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT NoColumnName, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

69. RMLTC0002j-SQLServer

-

Title: "Two columns mapping, qualified column names"

-

Description: "Tests the presence of qualified column names in the SELECT list of the SQL query"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT NoColumnName, Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

70. RMLTC0003a-MySQL

-

Title: "Three columns mapping, undefined SQL Version identifier"

-

Description: "Tests the presence of an undefined SQL Version identifier"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT FirstName, LastName FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

71. RMLTC0003a-PostgreSQL

-

Title: "Three columns mapping, undefined SQL Version identifier"

-

Description: "Tests the presence of an undefined SQL Version identifier"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT FirstName, LastName FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

72. RMLTC0003a-SQLServer

-

Title: "Three columns mapping, undefined SQL Version identifier"

-

Description: "Tests the presence of an undefined SQL Version identifier"

-

Error expected? Yes

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT FirstName, LastName FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

73. RMLTC0003b-MySQL

-

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT ID, LastName, CONCAT(`FirstName`, '', `LastName`) as Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{LastName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
-
-
-

74. RMLTC0003b-PostgreSQL

-

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  id INTEGER,
-  firstname VARCHAR(50),
-  lastname VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT id, lastname, concat_ws(firstname, '', lastname) as name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{id}/{lastname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
-
-
-

75. RMLTC0003b-SQLServer

-

Title: "Three columns mapping, concatenation of columns, by using a rr:sqlQuery to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) concatenation of columns to produce literal, by using a rr:sqlQuery"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator "SELECT ID, LastName, concat_ws(FirstName, '', LastName) as Name FROM student";
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{LastName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/10/Williams> <http://xmlns.com/foaf/0.1/name> "VenusWilliams" .
-
-
-

76. RMLTC0003c-CSV

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

77. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

78. RMLTC0003c-MySQL

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

79. RMLTC0003c-PostgreSQL

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student CASCADE ;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

80. RMLTC0003c-SPARQL

-

Title: "Three tripple mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName.value} {LastName.value}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

81. RMLTC0003c-SQLServer

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

82. RMLTC0003c-XML

-

Title: "Three columns mapping, by using a rr:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rr:template to produce literal"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{FirstName} {LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

83. RMLTC0004a-CSV

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

84. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

85. RMLTC0004a-MySQL

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

86. RMLTC0004a-PostgreSQL

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-

87. RMLTC0004a-SPARQL

-

Title: "Two BlankNodes mapping, from one object to two different triples"

-

Description: "Tests: (1) two BlankNodes mapping, (2) subject URI generated by a tripple object value; (3) from one BlankNode to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-
-[] a ns1:Student ;
-    ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Student
-            WHERE {
-                ?x  a <http://example.com/Student> ;
-                    foaf:name  ?Student .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student.value}"
-    ] .
-
-ex:TriplesMap2 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?Sport
-                WHERE {
-                    ?x  a <http://example.com/Student> ;
-                        <http://example.com/plays> ?sportObject .
-                    ?sportObject foaf:name ?Sport .
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-

88. RMLTC0004a-SQLServer

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
Student,Sport
-Venus,Tennis
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

89. RMLTC0004a-XML

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rr:class"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Student>Venus</Student>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

90. RMLTC0004b-CSV

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

91. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

92. RMLTC0004b-MySQL

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-CREATE TABLE student (
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

93. RMLTC0004b-PostgreSQL

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

94. RMLTC0004b-SPARQL

-

Title: "One tripple mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-
-[] foaf:name "Venus" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name
-            WHERE {
-                ?x foaf:name ?Name .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name.value}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

95. RMLTC0004b-SQLServer

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('Venus');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

96. RMLTC0004b-XML

-

Title: "One column mapping, presence of rr:termType rr:Literal on rr:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rr:termType rr:Literal on rr:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

97. RMLTC0005a-CSV

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
fname,lname,amount
-Bob,Smith,30.0E0
-Sue,Jones,20.0E0
-Bob,Smith,30.0E0
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

98. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

99. RMLTC0005a-MySQL

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-
-

100. RMLTC0005a-PostgreSQL

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-
-

101. RMLTC0005a-SQLServer

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-
-

102. RMLTC0005a-XML

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-  <person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30.0E0</amount>
-  </person>
-  <person>
-    <fname>Sue</fname>
-    <lname>Jones</lname>
-    <amount>20.0E0</amount>
-  </person>
-  <person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30.0E0</amount>
-  </person>
-</persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{fname};{lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

103. RMLTC0005b-MySQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/base/IOUs>;
-      rml:template "{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-    
-
-
-

104. RMLTC0005b-PostgreSQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/base/IOUs>;
-      rml:template "{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-    
-
-
-

105. RMLTC0005b-SQLServer

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname  VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/base/IOUs>;
-      rml:template "{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Bob_Smith <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-    
-
-
-

106. RMLTC0006a-CSV

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

107. RMLTC0006a-JSON

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

108. RMLTC0006a-MySQL

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

109. RMLTC0006a-PostgreSQL

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

110. RMLTC0006a-SPARQL

-

Title: "rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?BadStudent ?LastName ?ID
-            WHERE {
-
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

111. RMLTC0006a-SQLServer

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

112. RMLTC0006a-XML

-

Title: "Long form of R2RML by using rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Description: "Tests the use of rr:constant in rr:subjectMap, rr:predicateMap, rr:objectMap and rr:graphMap"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

113. RMLTC0007a-CSV

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

114. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

115. RMLTC0007a-MySQL

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

116. RMLTC0007a-PostgreSQL

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

117. RMLTC0007a-SPARQL

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

118. RMLTC0007a-SQLServer

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

119. RMLTC0007a-XML

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

120. RMLTC0007b-CSV

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

121. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

122. RMLTC0007b-MySQL

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

123. RMLTC0007b-PostgreSQL

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

124. RMLTC0007b-SPARQL

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

125. RMLTC0007b-SQLServer

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

126. RMLTC0007b-XML

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

127. RMLTC0007c-CSV

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

128. RMLTC0007c-JSON

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

129. RMLTC0007c-MySQL

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

130. RMLTC0007c-PostgreSQL

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

131. RMLTC0007c-SPARQL

-

Title: "One object mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

132. RMLTC0007c-SQLServer

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

133. RMLTC0007c-XML

-

Title: "One row mapping, using rr:class"

-

Description: "Tests subjectmap with more than one class IRIs, rr:class"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

134. RMLTC0007d-CSV

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

135. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

136. RMLTC0007d-MySQL

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

137. RMLTC0007d-PostgreSQL

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

138. RMLTC0007d-SPARQL

-

Title: "One object mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

139. RMLTC0007d-SQLServer

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

140. RMLTC0007d-XML

-

Title: "One column mapping, specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

141. RMLTC0007e-CSV

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
ID,Name
-10,Venus
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

142. RMLTC0007e-JSON

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

143. RMLTC0007e-MySQL

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

144. RMLTC0007e-PostgreSQL

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

145. RMLTC0007e-SPARQL

-

Title: "One object mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

146. RMLTC0007e-SQLServer

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

147. RMLTC0007e-XML

-

Title: "One column mapping, using rr:graphMap and rr:class"

-

Description: "Tests subjectmap with rr:graphMap and rr:class"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

148. RMLTC0007f-CSV

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

149. RMLTC0007f-JSON

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

150. RMLTC0007f-MySQL

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

151. RMLTC0007f-PostgreSQL

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

152. RMLTC0007f-SPARQL

-

Title: "One object mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

153. RMLTC0007f-SQLServer

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

154. RMLTC0007f-XML

-

Title: "One column mapping, using rr:graphMap and specifying an rr:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

155. RMLTC0007g-CSV

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

156. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

157. RMLTC0007g-MySQL

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

158. RMLTC0007g-PostgreSQL

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

159. RMLTC0007g-SPARQL

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

160. RMLTC0007g-SQLServer

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

161. RMLTC0007g-XML

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

162. RMLTC0007h-CSV

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-
-

163. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

164. RMLTC0007h-MySQL

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(50),
-  LastName VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

165. RMLTC0007h-PostgreSQL

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

166. RMLTC0007h-SPARQL

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] rdf:ID "10" ;
-    foaf:firstName "Venus" ;
-    foaf:lastName "Williams" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?FirstName ?LastName ?ID
-            WHERE {
-                ?x  foaf:firstName ?FirstName ;
-                    foaf:lastName  ?LastName ;
-                    rdf:ID         ?ID .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID.value}/{FirstName.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-
-

167. RMLTC0007h-SQLServer

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "FirstName" VARCHAR(50),
-  "LastName" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus', 'Williams');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

168. RMLTC0007h-XML

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{ID}/{FirstName}"
-    ] .
-
-
-

169. RMLTC0008a-CSV

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

170. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

171. RMLTC0008a-MySQL

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-
-

172. RMLTC0008a-PostgreSQL

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-
-

173. RMLTC0008a-SPARQL

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?Sport ?ID
-            WHERE {
-                ?x  foaf:name ?Name ;
-                    rdf:ID    ?ID ;
-                    <http://example.com/plays>  ?sportObject .
-                ?sportObject foaf:name ?Sport .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID.value"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport.value"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID.value}/{Name.value}"
-        ];
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

174. RMLTC0008a-SQLServer

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-
-

175. RMLTC0008a-XML

-

Title: "Generation of triples to a target graph by using rr:graphMap and rr:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rr:graphMap and rr:template"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{ID}/{Name}"
-        ];
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

176. RMLTC0008b-CSV

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

177. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

178. RMLTC0008b-MySQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

179. RMLTC0008b-PostgreSQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

180. RMLTC0008b-SPARQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x  foaf:name ?Name ;
-                    rdf:ID    ?ID ;
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap ex:RefObjectMap1;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID.value"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-ex:RefObjectMap1 a rml:RefObjectMap;
-  rml:parentTriplesMap ex:TriplesMap2 .
-
-ex:TriplesMap2 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?Sport
-                WHERE {
-                    ?x a <http://example.com/Sport> .
-                    ?x foaf:name ?Sport .
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

181. RMLTC0008b-SQLServer

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer>  . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

182. RMLTC0008b-XML

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

183. RMLTC0008c-CSV

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

184. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

185. RMLTC0008c-MySQL

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

186. RMLTC0008c-PostgreSQL

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

187. RMLTC0008c-SPARQL

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?Name ?ID
-              WHERE {
-                  ?x  foaf:name ?Name ;
-                      rdf:ID    ?ID ;
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base/#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

188. RMLTC0008c-SQLServer

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

189. RMLTC0008c-XML

-

Title: "Generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rr:predicateObjectMap"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

190. RMLTC0009a-CSV

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
ID,Sport,Name
-10,100,Venus Williams
-20,,Demi Moore
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

191. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

192. RMLTC0009a-MySQL

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Sport VARCHAR(50),
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL , 'Demi Moore');
-
-DROP TABLE IF EXISTS test.sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

193. RMLTC0009a-PostgreSQL

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL , 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

194. RMLTC0009a-SPARQL

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            rdf:ID "100" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-[] ns1:plays [ a ns1:Sport ] ;
-    rdf:ID "20" ;
-    foaf:name "Demi Moore" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?Name ?ID ?Sport
-              WHERE {
-                  ?x  foaf:name ?Name ;
-                      rdf:ID    ?ID ;
-                      <http://example.com/plays> ?sportObject .
-                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
-                                            rdf:ID ?Sport . }
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL1>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID.value}"
-    ] .
-
-<http://example.com/base/#InputSPARQL1> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/#InputSPARQL2> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds2/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?ID ?Name
-                WHERE {
-                    ?x  foaf:name ?Name ;
-                        rdf:ID    ?ID ;
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL2>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID.value}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

195. RMLTC0009a-SQLServer

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL , 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

196. RMLTC0009a-XML

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>100</Sport>
-  </student>
-  <student>
-    <ID>20</ID>
-    <Name>Demi Moore</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/sports/sport";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

197. RMLTC0009b-CSV

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
ID,Sport,Name
-10,100,Venus Williams
-20,,Demi Moore
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

198. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

199. RMLTC0009b-MySQL

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Sport VARCHAR(50),
-  Name VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL, 'Demi Moore');
-
-DROP TABLE IF EXISTS test.sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Name VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

200. RMLTC0009b-PostgreSQL

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL, 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

201. RMLTC0009b-SPARQL

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            rdf:ID "100" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-[] ns1:plays [ a ns1:Sport ] ;
-    rdf:ID "20" ;
-    foaf:name "Demi Moore" .
-
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?Name ?ID ?Sport
-              WHERE {
-                  ?x  foaf:name ?Name ;
-                      rdf:ID    ?ID ;
-                      <http://example.com/plays> ?sportObject .
-                  OPTIONAL { ?sportObject a <http://example.com/Sport> ;
-                                            rdf:ID ?Sport . }
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL1>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport.value";
-              rml:parent "ID.value"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID.value}"
-    ] .
-
-<http://example.com/base/#InputSPARQL1> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/#InputSPARQL2> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds2/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?ID ?Name
-                WHERE {
-                    ?x  foaf:name ?Name ;
-                        rdf:ID    ?ID ;
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL2>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name.value"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID.value}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

202. RMLTC0009b-SQLServer

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Sport" VARCHAR(50),
-  "Name" VARCHAR(50)
-);
-INSERT INTO student values ('10', '100', 'Venus Williams');
-INSERT INTO student values ('20', NULL, 'Demi Moore');
-
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  "ID" INTEGER,
-  "Name" VARCHAR(50)
-);
-INSERT INTO sport values ('100', 'Tennis');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

203. RMLTC0009b-XML

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>100</Sport>
-  </student>
-  <student>
-    <ID>20</ID>
-    <Name>Demi Moore</Name>
-  </student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "Sport";
-              rml:parent "ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/sports/sport";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

204. RMLTC0009c-MySQL

-

Title: "Unnamed column in a logical table"

-

Description: "Test a logical table with unnamed column."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Sport;
-DROP TABLE IF EXISTS test.Student;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport)
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-
-
-
-
-

205. RMLTC0009c-PostgreSQL

-

Title: "Unnamed column in a logical table"

-

Description: "Test a logical table with unnamed column."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Sport;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport)
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-
-
-
-
-

206. RMLTC0009c-SQLServer

-

Title: "Unnamed column in a logical table"

-

Description: "Test a logical table with unnamed column."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Sport;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport)
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-
-
-
-
-

207. RMLTC0009d-MySQL

-

Title: "Named column in logical table"

-

Description: "Test a logical table named column."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Student;
-DROP TABLE IF EXISTS test.Sport;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport) as SPORTCOUNT
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "SPORTCOUNT"
-        ];
-      rml:predicate ex:numSport
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-
-
-
-
-
-

208. RMLTC0009d-PostgreSQL

-

Title: "Named column in logical table"

-

Description: "Test a logical table named column."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Student;
-DROP TABLE IF EXISTS Sport;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport) as SPORTCOUNT
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "sportcount"
-        ];
-      rml:predicate ex:numSport
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-
-
-
-
-
-

209. RMLTC0009d-SQLServer

-

Title: "Named column in logical table"

-

Description: "Test a logical table named column."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Student;
-DROP TABLE IF EXISTS Sport;
-
-CREATE TABLE Sport (
-ID integer,
-Name varchar (50),
-PRIMARY KEY (ID)
-);
-
-CREATE TABLE Student (
-ID integer,
-Name varchar(50),
-Sport integer,
-PRIMARY KEY (ID),
-FOREIGN KEY(Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Sport (ID, Name) VALUES (100,'Tennis');
-INSERT INTO Student (ID, Name, Sport) VALUES (10,'Venus Williams', 100);
-INSERT INTO Student (ID, Name, Sport) VALUES (20,'Demi Moore', NULL);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Name, COUNT(Sport) as SPORTCOUNT
-        FROM Student
-        GROUP BY Name
-        """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "SPORTCOUNT"
-        ];
-      rml:predicate ex:numSport
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/resource/student_Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" . 
-<http://example.com/resource/student_Venus%20Williams> <http://example.com/numSport> "1"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/resource/student_Demi%20Moore> <http://xmlns.com/foaf/0.1/name> "Demi Moore" . 
-<http://example.com/resource/student_Demi%20Moore> <http://example.com/numSport> "0"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-
-
-
-
-
-

210. RMLTC0010a-CSV

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
Country Code,Name,ISO 3166
-1,"Bolivia, Plurinational State of",BO
-2,"Ireland",IE
-3,"Saint Martin (French part)",MF
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

211. RMLTC0010a-JSON

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

212. RMLTC0010a-MySQL

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.country_info;
-
-CREATE TABLE country_info (
-  `Country Code` INTEGER,
-  Name VARCHAR(100),
-  `ISO 3166` VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

213. RMLTC0010a-PostgreSQL

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

214. RMLTC0010a-SQLServer

-

Title: "Template with table column with special chars"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

215. RMLTC0010b-CSV

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
Country Code,Name,ISO 3166
-1,"Bolivia, Plurinational State of",BO
-2,Ireland,IE
-3,"Saint Martin (French part)",MF
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

216. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

217. RMLTC0010b-MySQL

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.country_info;
-
-CREATE TABLE country_info (
-  `Country Code` INTEGER,
-  Name VARCHAR(100),
-  `ISO 3166` VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

218. RMLTC0010b-PostgreSQL

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

219. RMLTC0010b-SQLServer

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

220. RMLTC0010b-XML

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country>
-    <CountryCode>1</CountryCode>
-    <Name>Bolivia, Plurinational State of</Name>
-    <ISO3166>BO</ISO3166>
-  </country>
-  <country>
-    <CountryCode>2</CountryCode>
-    <Name>Ireland</Name>
-    <ISO3166>IE</ISO3166>
-  </country>
-  <country>
-    <CountryCode>3</CountryCode>
-    <Name>Saint Martin (French part)</Name>
-    <ISO3166>MF</ISO3166>
-  </country>
-</countries>
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{CountryCode}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

221. RMLTC0010c-CSV

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
Country Code,Name,ISO 3166
-1,"Bolivia, Plurinational State of",BO
-2,Ireland,IE
-3,Saint Martin (French part),MF
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

222. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

223. RMLTC0010c-MySQL

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.country_info;
-
-CREATE TABLE country_info (
-  `Country Code` INTEGER,
-  Name VARCHAR(100),
-  `ISO 3166` VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

224. RMLTC0010c-PostgreSQL

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

225. RMLTC0010c-SQLServer

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in column value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS country_info;
-
-CREATE TABLE country_info (
-  "Country Code" INTEGER,
-  "Name" VARCHAR(100),
-  "ISO 3166" VARCHAR(10)
-);
-INSERT INTO country_info values ('1', 'Bolivia, Plurinational State of', 'BO');
-INSERT INTO country_info values ('2', 'Ireland', 'IE');
-INSERT INTO country_info values ('3', 'Saint Martin (French part)', 'MF');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "country_info"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Country Code}/{Name}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

226. RMLTC0010c-XML

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country>
-    <CountryCode>1</CountryCode>
-    <Name>Bolivia, Plurinational State of</Name>
-    <ISO3166>BO</ISO3166>
-  </country>
-  <country>
-    <CountryCode>2</CountryCode>
-    <Name>Ireland</Name>
-    <ISO3166>IE</ISO3166>
-  </country>
-  <country>
-    <CountryCode>3</CountryCode>
-    <Name>Saint Martin (French part)</Name>
-    <ISO3166>MF</ISO3166>
-  </country>
-</countries>
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {ISO3166} \\}\\}\\}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate ex:code
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{CountryCode}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

227. RMLTC0011a-MySQL

-

Title: "M to M relation, by using a SQL query"

-

Description: "Tests, M to M relations, by using a SQL query"

-

Error expected? No

-

Input

-
USE test;
-SET FOREIGN_KEY_CHECKS = 0;
-DROP TABLE IF EXISTS test.Student_Sport;
-DROP TABLE IF EXISTS test.Sport;
-DROP TABLE IF EXISTS test.Student;
-SET FOREIGN_KEY_CHECKS = 1;
-
-CREATE TABLE Student (
-ID integer PRIMARY KEY,
-FirstName varchar(50),
-LastName varchar(50)
-);
-CREATE TABLE Sport (
-ID integer PRIMARY KEY,
-Description varchar(50)
-);
-CREATE TABLE Student_Sport (
-ID_Student integer,
-ID_Sport integer,
-PRIMARY KEY (ID_Student,ID_Sport),
-FOREIGN KEY (ID_Student) REFERENCES Student(ID),
-FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
-
-INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
-INSERT INTO Sport (ID, Description) VALUES (111,'Football');
-INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
-
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT Student.ID as ID,
-              Student.FirstName as FirstName,
-              Student.LastName as LastName,
-              Sport.Description as Description,
-              Sport.ID as Sport_ID
-       FROM Student,Sport,Student_Sport
-       WHERE Student.ID = Student_Sport.ID_Student
-       AND Sport.ID = Student_Sport.ID_Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ], [
-      rml:objectMap [
-          rml:template "http://example.com/{Sport_ID}/{Description}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT * FROM Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Description}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
-<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
-<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
-<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
-<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/111/Football> <http://example.com/description> "Football" .
-<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
-<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
-<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
-<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
-
-
-
-

228. RMLTC0011a-PostgreSQL

-

Title: "M to M relation, by using a SQL query"

-

Description: "Tests, M to M relations, by using a SQL query"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Student_Sport;
-DROP TABLE IF EXISTS Sport CASCADE;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Student (
-ID integer PRIMARY KEY,
-FirstName varchar(50),
-LastName varchar(50)
-);
-CREATE TABLE Sport (
-ID integer PRIMARY KEY,
-Description varchar(50)
-);
-CREATE TABLE Student_Sport (
-ID_Student integer,
-ID_Sport integer,
-PRIMARY KEY (ID_Student,ID_Sport),
-FOREIGN KEY (ID_Student) REFERENCES Student(ID),
-FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
-
-INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
-INSERT INTO Sport (ID, Description) VALUES (111,'Football');
-INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
-
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT Student.ID as ID,
-              Student.FirstName as FirstName,
-              Student.LastName as LastName,
-              Sport.Description as Description,
-              Sport.ID as Sport_ID
-       FROM Student,Sport,Student_Sport
-       WHERE Student.ID = Student_Sport.ID_Student
-       AND Sport.ID = Student_Sport.ID_Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "lastname"
-        ];
-      rml:predicate ex:lastName
-    ], [
-      rml:objectMap [
-          rml:template "http://example.com/{sport_id}/{description}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{id}/{firstname};{lastname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT * FROM Sport ;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "description"
-        ];
-      rml:predicate ex:description
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{id}/{description}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
-<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
-<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
-<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
-<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/111/Football> <http://example.com/description> "Football" .
-<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
-<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
-<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
-<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
-
-
-
-

229. RMLTC0011a-SQLServer

-

Title: "M to M relation, by using a SQL query"

-

Description: "Tests, M to M relations, by using a SQL query"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE Student (
-ID integer PRIMARY KEY,
-FirstName varchar(50),
-LastName varchar(50)
-);
-CREATE TABLE Sport (
-ID integer PRIMARY KEY,
-Description varchar(50)
-);
-CREATE TABLE Student_Sport (
-ID_Student integer,
-ID_Sport integer,
-PRIMARY KEY (ID_Student,ID_Sport),
-FOREIGN KEY (ID_Student) REFERENCES Student(ID),
-FOREIGN KEY (ID_Sport) REFERENCES Sport(ID)
-);
-
-INSERT INTO Student (ID,FirstName,LastName) VALUES (10,'Venus', 'Williams');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (11,'Fernando', 'Alonso');
-INSERT INTO Student (ID,FirstName,LastName) VALUES (12,'David', 'Villa');
-
-INSERT INTO Sport (ID, Description) VALUES (110,'Tennis');
-INSERT INTO Sport (ID, Description) VALUES (111,'Football');
-INSERT INTO Sport (ID, Description) VALUES (112,'Formula1');
-
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (10,110);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,111);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (11,112);
-INSERT INTO Student_Sport (ID_Student, ID_Sport) VALUES (12,111);
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT Student.ID as ID,
-              Student.FirstName as FirstName,
-              Student.LastName as LastName,
-              Sport.Description as Description,
-              Sport.ID as Sport_ID
-       FROM Student,Sport,Student_Sport
-       WHERE Student.ID = Student_Sport.ID_Student
-       AND Sport.ID = Student_Sport.ID_Sport;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ], [
-      rml:objectMap [
-          rml:template "http://example.com/{Sport_ID}/{Description}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{FirstName};{LastName}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-       SELECT * FROM Sport ;
-       """;
-      rml:referenceFormulation rml:SQL2008Query;
-      rml:source <http://example.com/base/#DB_source>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{ID}/{Description}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/110/Tennis> <http://example.com/description> "Tennis" .
-<http://example.com/110/Tennis> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus;Williams> <http://example.com/plays> <http://example.com/110/Tennis> .
-<http://example.com/10/Venus;Williams> <http://example.com/lastName> "Williams" .
-<http://example.com/10/Venus;Williams> <http://example.com/firstName> "Venus" .
-<http://example.com/10/Venus;Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/111/Football> <http://example.com/description> "Football" .
-<http://example.com/111/Football> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/12/David;Villa> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/12/David;Villa> <http://example.com/lastName> "Villa" .
-<http://example.com/12/David;Villa> <http://example.com/firstName> "David" .
-<http://example.com/12/David;Villa> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/112/Formula1> <http://example.com/description> "Formula1" .
-<http://example.com/112/Formula1> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/lastName> "Alonso" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/firstName> "Fernando" .
-<http://example.com/11/Fernando;Alonso> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/111/Football> .
-<http://example.com/11/Fernando;Alonso> <http://example.com/plays> <http://example.com/112/Formula1> .
-
-
-
-

230. RMLTC0011b-CSV

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,Venus,Williams
-11,Fernando,Alonso
-12,David,Villa
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

231. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

232. RMLTC0011b-MySQL

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
USE test;
-SET FOREIGN_KEY_CHECKS = 0;
-DROP TABLE IF EXISTS test.student_sport;
-DROP TABLE IF EXISTS test.student;
-DROP TABLE IF EXISTS test.sport;
-SET FOREIGN_KEY_CHECKS = 1;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Description VARCHAR(200)
-);
-INSERT INTO sport values ('110','Tennis');
-INSERT INTO sport values ('111','Football');
-INSERT INTO sport values ('112','Formula1');
-
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(200),
-  LastName VARCHAR(200)
-);
-INSERT INTO student values ('10','Venus','Williams');
-INSERT INTO student values ('11','Fernando','Alonso');
-INSERT INTO student values ('12','David','Villa');
-
-
-CREATE TABLE student_sport (
-  ID_Student INTEGER,
-  ID_Sport INTEGER
-);
-INSERT INTO student_sport values ('10', '110');
-INSERT INTO student_sport values ('11','111');
-INSERT INTO student_sport values ('11','112');
-INSERT INTO student_sport values ('12','111');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

233. RMLTC0011b-PostgreSQL

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student_sport;
-DROP TABLE IF EXISTS student;
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Description VARCHAR(200)
-);
-INSERT INTO sport values ('110','Tennis');
-INSERT INTO sport values ('111','Football');
-INSERT INTO sport values ('112','Formula1');
-
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(200),
-  LastName VARCHAR(200)
-);
-INSERT INTO student values ('10','Venus','Williams');
-INSERT INTO student values ('11','Fernando','Alonso');
-INSERT INTO student values ('12','David','Villa');
-
-
-CREATE TABLE student_sport (
-  ID_Student INTEGER,
-  ID_Sport INTEGER
-);
-INSERT INTO student_sport values ('10', '110');
-INSERT INTO student_sport values ('11','111');
-INSERT INTO student_sport values ('11','112');
-INSERT INTO student_sport values ('12','111');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{id_sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{id_student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "lastname"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{id}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

234. RMLTC0011b-SQLServer

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student_sport;
-DROP TABLE IF EXISTS student;
-DROP TABLE IF EXISTS sport;
-
-CREATE TABLE sport (
-  ID INTEGER,
-  Description VARCHAR(200)
-);
-INSERT INTO sport values ('110','Tennis');
-INSERT INTO sport values ('111','Football');
-INSERT INTO sport values ('112','Formula1');
-
-
-CREATE TABLE student (
-  ID INTEGER,
-  FirstName VARCHAR(200),
-  LastName VARCHAR(200)
-);
-INSERT INTO student values ('10','Venus','Williams');
-INSERT INTO student values ('11','Fernando','Alonso');
-INSERT INTO student values ('12','David','Villa');
-
-
-CREATE TABLE student_sport (
-  ID_Student INTEGER,
-  ID_Sport INTEGER
-);
-INSERT INTO student_sport values ('10', '110');
-INSERT INTO student_sport values ('11','111');
-INSERT INTO student_sport values ('11','112');
-INSERT INTO student_sport values ('12','111');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student_sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "sport"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

235. RMLTC0011b-XML

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<Students>
-  <Student>
-    <ID>10</ID>
-    <FirstName>Venus</FirstName>
-    <LastName>Williams</LastName>
-  </Student>
-  <Student>
-    <ID>11</ID>
-    <FirstName>Fernando</FirstName>
-    <LastName>Alonso</LastName>
-  </Student>
-  <Student>
-    <ID>12</ID>
-    <FirstName>David</FirstName>
-    <LastName>Villa</LastName>
-  </Student>
-</Students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/links/link";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Students/Student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Sports/Sport";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

236. RMLTC0012a-CSV

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
fname,lname,amount
-Bob,Smith,30
-Sue,Jones,20
-Bob,Smith,30
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

237. RMLTC0012a-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

238. RMLTC0012a-MySQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount INT);
-/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

239. RMLTC0012a-PostgreSQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount INT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

240. RMLTC0012a-SPARQL

-

Title: "Duplicate triples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-[] ns1:amount "20" ;
-    foaf:firstName "Sue" ;
-    foaf:lastName "Jones" .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base#Country> rml:logicalSource [
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?fname ?lname ?amount
-            WHERE {
-                ?x  foaf:firstName ?fname ;
-                    foaf:lastName  ?lname ;
-                    <http://example.com/amount> ?amount .
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source <http://example.com/base#InputSPARQL>
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname.value} {lname.value}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount.value"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname.value}{lname.value}{amount.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

241. RMLTC0012a-SQLServer

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount INT);
-/* We replaced DOUBLE with INT, because the datatype conversion is different across databases, and this test case is not relevant to that aspect */
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Bob_Smith_30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Bob_Smith_30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:Sue_Jones_20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:Sue_Jones_20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

242. RMLTC0012a-XML

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<Persons>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-  <Person>
-    <fname>Sue</fname>
-    <lname>Jones</lname>
-    <amount>20</amount>
-  </Person>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-</Persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

243. RMLTC0012b-CSV

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

244. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

245. RMLTC0012b-MySQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.persons;
-
-CREATE TABLE persons (
-  fname VARCHAR(200),
-  lname VARCHAR(200),
-  amount INTEGER
-);
-INSERT INTO persons values ('Bob','Smith','30');
-INSERT INTO persons values ('Sue','Jones','20');
-INSERT INTO persons values ('Bob','Smith','30');
-
-DROP TABLE IF EXISTS test.lives;
-
-CREATE TABLE lives (
-  fname VARCHAR(200),
-  lname VARCHAR(200),
-  city VARCHAR(200)
-);
-INSERT INTO lives values ('Bob','Smith','London');
-INSERT INTO lives values ('Sue','Jones','Madrid');
-INSERT INTO lives values ('Bob','Smith','London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "persons"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "lives"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

246. RMLTC0012b-PostgreSQL

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS persons;
-
-CREATE TABLE persons (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "amount" INTEGER
-);
-INSERT INTO persons values ('Bob','Smith','30');
-INSERT INTO persons values ('Sue','Jones','20');
-INSERT INTO persons values ('Bob','Smith','30');
-
-DROP TABLE IF EXISTS lives;
-
-CREATE TABLE lives (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "city" VARCHAR(200)
-);
-INSERT INTO lives values ('Bob','Smith','London');
-INSERT INTO lives values ('Sue','Jones','Madrid');
-INSERT INTO lives values ('Bob','Smith','London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "persons"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "lives"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

247. RMLTC0012b-SPARQL

-

Title: "Duplicate triples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-[] ns1:amount "20" ;
-    foaf:firstName "Sue" ;
-    foaf:lastName "Jones" .
-
-[] ns1:amount "30" ;
-    foaf:firstName "Bob" ;
-    foaf:lastName "Smith" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-              SELECT ?fname ?lname
-              WHERE {
-                   ?x  foaf:firstName ?fname ;
-                       foaf:lastName  ?lname ;
-              } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL1>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname.value} {lname.value}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname.value}{lname.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-                SELECT ?city ?fname ?lname
-                WHERE {
-                    ?x  foaf:firstName ?fname ;
-                        foaf:lastName  ?lname ;
-                        <http://example.com/city> ?city .
-                } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base/#InputSPARQL2>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city.value"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname.value}{lname.value}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#InputSPARQL1> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-<http://example.com/base/#InputSPARQL2> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds2/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

248. RMLTC0012b-SQLServer

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS persons;
-
-CREATE TABLE persons (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "amount" INTEGER
-);
-INSERT INTO persons values ('Bob','Smith','30');
-INSERT INTO persons values ('Sue','Jones','20');
-INSERT INTO persons values ('Bob','Smith','30');
-
-DROP TABLE IF EXISTS lives;
-
-CREATE TABLE lives (
-  "fname" VARCHAR(200),
-  "lname" VARCHAR(200),
-  "city" VARCHAR(200)
-);
-INSERT INTO lives values ('Bob','Smith','London');
-INSERT INTO lives values ('Sue','Jones','Madrid');
-INSERT INTO lives values ('Bob','Smith','London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "persons"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "lives"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

249. RMLTC0012b-XML

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Lives/Live";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{fname}{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

250. RMLTC0012c-CSV

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
fname,lname,amount
-Bob,Smith,30
-Sue,Jones,20
-Bob,Smith,30
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

251. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

252. RMLTC0012c-MySQL

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

253. RMLTC0012c-PostgreSQL

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-
-

254. RMLTC0012c-SQLServer

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

255. RMLTC0012c-XML

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<Persons>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith></lname>
-    <amount>30</amount>
-  </Person>
-  <Person>
-    <fname>Sue</fname>
-    <lname>Jones></lname>
-    <amount>20</amount>
-  </Person>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith></lname>
-    <amount>30</amount>
-  </Person>
-</Persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

256. RMLTC0012d-CSV

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
fname,lname,amount
-Bob,Smith,30
-Sue,Jones,20
-Bob,Smith,30
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{amount}_{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

257. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

258. RMLTC0012d-MySQL

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}"
-    ], [
-      rml:template "{amount}_{fname}_{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

259. RMLTC0012d-PostgreSQL

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}"
-    ], [
-      rml:template "{amount}_{fname}_{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-
-

260. RMLTC0012d-SQLServer

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}"
-    ], [
-      rml:template "{amount}_{fname}_{lname}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

261. RMLTC0012d-XML

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<Persons>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-  <Person>
-    <fname>Sue</fname>
-    <lname>Jones</lname>
-    <amount>20</amount>
-  </Person>
-  <Person>
-    <fname>Bob</fname>
-    <lname>Smith</lname>
-    <amount>30</amount>
-  </Person>
-</Persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/Persons/Person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{fname} {lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{amount}_{fname}_{lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

262. RMLTC0012e-MySQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key."

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.IOUs;
-DROP TABLE IF EXISTS test.Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/IOUs>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Lives"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/Lives>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate <http://example.com/base/IOUs#city>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{city}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
-_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
-
-
-
-
-

263. RMLTC0012e-PostgreSQL

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key."

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/IOUs>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Lives"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/Lives>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate <http://example.com/base/IOUs#city>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{city}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
-_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
-
-
-
-
-

264. RMLTC0012e-SQLServer

-

Title: "Default mapping"

-

Description: "Tests the generation of a default mapping for tables without a primary key."

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS IOUs;
-DROP TABLE IF EXISTS Lives;
-
-CREATE TABLE IOUs (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      amount FLOAT);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Sue', 'Jones', 20);
-INSERT INTO IOUs (fname, lname, amount) VALUES ('Bob', 'Smith', 30);
-
-CREATE TABLE Lives (
-      fname VARCHAR(20),
-      lname VARCHAR(20),
-      city VARCHAR(20));
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-INSERT INTO Lives (fname, lname, city) VALUES ('Sue', 'Jones', 'Madrid');
-INSERT INTO Lives (fname, lname, city) VALUES ('Bob', 'Smith', 'London');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "IOUs"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/IOUs>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "amount"
-        ];
-      rml:predicate <http://example.com/base/IOUs#amount>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Lives"
-    ];
-  rml:predicateObjectMap [
-      rml:object <http://example.com/base/Lives>;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "fname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#fname>
-    ], [
-      rml:objectMap [
-          rml:reference "lname"
-        ];
-      rml:predicate <http://example.com/base/IOUs#lname>
-    ], [
-      rml:objectMap [
-          rml:reference "city"
-        ];
-      rml:predicate <http://example.com/base/IOUs#city>
-    ];
-  rml:subjectMap [
-      rml:template "{fname}_{lname}_{city}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
_:Bob_Smith_30 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Bob_Smith_30 <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_30 <http://example.com/base/IOUs#amount> "3.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Sue_Jones_20 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/IOUs> .
-_:Sue_Jones_20 <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_20 <http://example.com/base/IOUs#amount> "2.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-_:Bob_Smith_London <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Bob_Smith_London <http://example.com/base/IOUs#fname> "Bob" .
-_:Bob_Smith_London <http://example.com/base/IOUs#lname> "Smith" .
-_:Bob_Smith_London <http://example.com/base/IOUs#city> "London" .
-_:Sue_Jones_Madrid <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/base/Lives> .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#fname> "Sue" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#lname> "Jones" .
-_:Sue_Jones_Madrid <http://example.com/base/IOUs#city> "Madrid" .
-
-
-
-
-

265. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

266. RMLTC0013a-MySQL

-

Title: "Generation of empty triples from referenced columns that have null values"

-

Description: "Tests the generation of empty triples from referenced columns that have null values"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Person;
-
-CREATE TABLE Person (
-ID integer,
-Name varchar(50),
-DateOfBirth varchar(50),
-PRIMARY KEY (ID)
-);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Person"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-
-
-

267. RMLTC0013a-PostgreSQL

-

Title: "Generation of empty triples from referenced columns that have null values"

-

Description: "Tests the generation of empty triples from referenced columns that have null values"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Person;
-
-CREATE TABLE Person (
-"ID" integer,
-"Name" varchar(50),
-"DateOfBirth" varchar(50),
-PRIMARY KEY ("ID")
-);
-INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (1,'Alice', NULL);
-INSERT INTO Person ("ID", "Name", "DateOfBirth") VALUES (2,'Bob', 'September, 2010');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Person"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-
-
-

268. RMLTC0013a-SQLServer

-

Title: "Generation of empty triples from referenced columns that have null values"

-

Description: "Tests the generation of empty triples from referenced columns that have null values"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Person;
-
-CREATE TABLE Person (
-ID integer,
-Name varchar(50),
-DateOfBirth varchar(50),
-PRIMARY KEY (ID)
-);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (1,'Alice', NULL);
-INSERT INTO Person (ID, Name, DateOfBirth) VALUES (2,'Bob', 'September, 2010');
-
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Person"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{ID}/{Name}/{DateOfBirth}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-
-
-

269. RMLTC0014d-MySQL

-

Title: "three tables, one primary key, one foreign key"

-

Description: "Test the translation of database type codes to IRIs"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.DEPT;
-DROP TABLE IF EXISTS test.EMP;
-DROP TABLE IF EXISTS test.LIKES;
-
-CREATE TABLE DEPT (
-      deptno INTEGER UNIQUE,
-      dname VARCHAR(30),
-      loc VARCHAR(100));
-INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
-
-CREATE TABLE EMP (
-      empno INTEGER PRIMARY KEY,
-      ename VARCHAR(100),
-      job VARCHAR(30),
-      deptno INTEGER REFERENCES DEPT (deptno),
-      etype VARCHAR(30));
-INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
-
-CREATE TABLE LIKES (
-      id INTEGER,
-      likeType VARCHAR(30),
-      likedObj VARCHAR(100));
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-      SELECT EMP.*, (CASE job
-        WHEN 'CLERK' THEN 'general-office'
-        WHEN 'NIGHTGUARD' THEN 'security'
-        WHEN 'ENGINEER' THEN 'engineering'
-      END) AS ROLE FROM EMP
-    """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://data.example.com/roles/{ROLE}"
-        ];
-      rml:predicate ex:role
-    ];
-  rml:subjectMap [
-      rml:template "http://data.example.com/employee/{empno}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
-
-
-

270. RMLTC0014d-PostgreSQL

-

Title: "three tables, one primary key, one foreign key"

-

Description: "Test the translation of database type codes to IRIs"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS LIKES;
-DROP TABLE IF EXISTS EMP;
-DROP TABLE IF EXISTS DEPT;
-
-CREATE TABLE DEPT (
-      deptno INTEGER UNIQUE,
-      dname VARCHAR(30),
-      loc VARCHAR(100));
-INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
-
-CREATE TABLE EMP (
-      empno INTEGER PRIMARY KEY,
-      ename VARCHAR(100),
-      job VARCHAR(30),
-      deptno INTEGER REFERENCES DEPT (deptno),
-      etype VARCHAR(30));
-INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
-
-CREATE TABLE LIKES (
-      id INTEGER,
-      likeType VARCHAR(30),
-      likedObj VARCHAR(100));
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-      SELECT EMP.*, (CASE job
-        WHEN 'CLERK' THEN 'general-office'
-        WHEN 'NIGHTGUARD' THEN 'security'
-        WHEN 'ENGINEER' THEN 'engineering'
-      END) AS ROLE FROM EMP
-    """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://data.example.com/roles/{role}"
-        ];
-      rml:predicate ex:role
-    ];
-  rml:subjectMap [
-      rml:template "http://data.example.com/employee/{empno}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
-
-
-

271. RMLTC0014d-SQLServer

-

Title: "three tables, one primary key, one foreign key"

-

Description: "Test the translation of database type codes to IRIs"

-

Error expected? No

-

Input

-
USE TestDB;
-EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
-EXEC sp_msforeachtable 'DROP TABLE ?'
-
-CREATE TABLE DEPT (
-      deptno INTEGER UNIQUE,
-      dname VARCHAR(30),
-      loc VARCHAR(100));
-INSERT INTO DEPT (deptno, dname, loc) VALUES (10, 'APPSERVER', 'NEW YORK');
-
-CREATE TABLE EMP (
-      empno INTEGER PRIMARY KEY,
-      ename VARCHAR(100),
-      job VARCHAR(30),
-      deptno INTEGER REFERENCES DEPT (deptno),
-      etype VARCHAR(30));
-INSERT INTO EMP (empno, ename, job, deptno, etype ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
-
-CREATE TABLE LIKES (
-      id INTEGER,
-      likeType VARCHAR(30),
-      likedObj VARCHAR(100));
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Playing', 'Soccer');
-INSERT INTO LIKES (id, likeType, likedObj) VALUES (7369, 'Watching', 'Basketball');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-      SELECT EMP.*, (CASE job
-        WHEN 'CLERK' THEN 'general-office'
-        WHEN 'NIGHTGUARD' THEN 'security'
-        WHEN 'ENGINEER' THEN 'engineering'
-      END) AS ROLE FROM EMP
-    """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://data.example.com/roles/{ROLE}"
-        ];
-      rml:predicate ex:role
-    ];
-  rml:subjectMap [
-      rml:template "http://data.example.com/employee/{empno}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://data.example.com/employee/7369> <http://example.com/ns#role> <http://data.example.com/roles/general-office> .
-
-
-

272. RMLTC0015a-CSV

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
Code,Name
-BO,"Bolivia, Plurinational State of"
-IE,Ireland
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

273. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

274. RMLTC0015a-MySQL

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'ES';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

275. RMLTC0015a-PostgreSQL

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'ES';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

276. RMLTC0015a-SQLServer

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT \"Code\", \"Name\", \"Lan\"
-        FROM \"Country\"
-        WHERE \"Lan\" = 'ES';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

277. RMLTC0015a-XML

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
-  <country><Code>IE</Code><Name>Ireland</Name></country>
-</countries>
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

278. RMLTC0015b-CSV

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
Code,Name
-BO,"Bolivia, Plurinational State of"
-IE,Ireland
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-
-

279. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

280. RMLTC0015b-MySQL

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

281. RMLTC0015b-PostgreSQL

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

282. RMLTC0015b-SQLServer

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Country;
-
-CREATE TABLE Country (
-  Code VARCHAR(2),
-  Name VARCHAR(100),
-  Lan VARCHAR(10),
-  PRIMARY KEY (Code,Lan)
-);
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Ireland', 'EN');
-INSERT INTO Country (Code, Name, Lan) VALUES ('IE', 'Irlanda', 'ES');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:iterator """
-        SELECT Code, Name, Lan
-        FROM Country
-        WHERE Lan = 'EN';
-       """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

283. RMLTC0015b-XML

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rr:language value"

-

Description: "Tests a term map with an invalid rr:language value, which is an error"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<countries>
-  <country><Code>BO</Code><Name>Bolivia, Plurinational State of</Name></country>
-  <country><Code>IE</Code><Name>Ireland</Name></country>
-</countries>
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/countries/country";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Code}"
-    ] .
-
-
-

284. RMLTC0016a-MySQL

-

Title: "Table with datatypes: string and integer"

-

Description: "Tests the rr:termtype and datatype conversions: string and integer"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sex"
-        ];
-      rml:predicate ex:gender
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
-<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
-<http://example.com/Patient/10> <http://example.com/gender> "female" .
-<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
-<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
-<http://example.com/Patient/11> <http://example.com/gender> "female" .
-<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
-<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
-<http://example.com/Patient/12> <http://example.com/gender> "male" .
-
-
-
-

285. RMLTC0016a-PostgreSQL

-

Title: "Table with datatypes: string and integer"

-

Description: "Tests the rr:termtype and datatype conversions: string and integer"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "sex"
-        ];
-      rml:predicate ex:gender
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "id"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "lastname"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient/{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
-<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
-<http://example.com/Patient/10> <http://example.com/gender> "female" .
-<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
-<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
-<http://example.com/Patient/11> <http://example.com/gender> "female" .
-<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
-<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
-<http://example.com/Patient/12> <http://example.com/gender> "male" .
-
-
-
-

286. RMLTC0016a-SQLServer

-

Title: "Table with datatypes: string and integer"

-

Description: "Tests the rr:termtype and datatype conversions: string and integer"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "Sex"
-        ];
-      rml:predicate ex:gender
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient/{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient/10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/10> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/10> <http://example.com/firstName> "Monica" .
-<http://example.com/Patient/10> <http://example.com/lastName> "Geller" .
-<http://example.com/Patient/10> <http://example.com/gender> "female" .
-<http://example.com/Patient/11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/11> <http://example.com/id> "11"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/11> <http://example.com/firstName> "Rachel" .
-<http://example.com/Patient/11> <http://example.com/lastName> "Green" .
-<http://example.com/Patient/11> <http://example.com/gender> "female" .
-<http://example.com/Patient/12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient/12> <http://example.com/id> "12"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Patient/12> <http://example.com/firstName> "Chandler" .
-<http://example.com/Patient/12> <http://example.com/lastName> "Bing" .
-<http://example.com/Patient/12> <http://example.com/gender> "male" .
-
-
-
-

287. RMLTC0016b-MySQL

-

Title: "Table with datatypes: real and float"

-

Description: "Tests the rr:termtype and datatype conversions: real and float"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "Weight"
-        ];
-      rml:predicate ex:weight
-    ], [
-      rml:objectMap [
-          rml:reference "Height"
-        ];
-      rml:predicate ex:height
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-

288. RMLTC0016b-PostgreSQL

-

Title: "Table with datatypes: real and float"

-

Description: "Tests the rr:termtype and datatype conversions: real and float"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "weight"
-        ];
-      rml:predicate ex:weight
-    ], [
-      rml:objectMap [
-          rml:reference "height"
-        ];
-      rml:predicate ex:height
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-

289. RMLTC0016b-SQLServer

-

Title: "Table with datatypes: real and float"

-

Description: "Tests the rr:termtype and datatype conversions: real and float"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "Weight"
-        ];
-      rml:predicate ex:weight
-    ], [
-      rml:objectMap [
-          rml:reference "Height"
-        ];
-      rml:predicate ex:height
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/weight> "8.025E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient10> <http://example.com/height> "1.65E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/weight> "7.022E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient11> <http://example.com/height> "1.7E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/weight> "9.031E1"^^<http://www.w3.org/2001/XMLSchema#double> .
-<http://example.com/Patient12> <http://example.com/height> "1.76E0"^^<http://www.w3.org/2001/XMLSchema#double> .
-
-
-

290. RMLTC0016c-MySQL

-

Title: "Table with datatypes: date and timestamp"

-

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "BirthDate"
-        ];
-      rml:predicate ex:birthdate
-    ], [
-      rml:objectMap [
-          rml:reference "EntranceDate"
-        ];
-      rml:predicate ex:entrancedate
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-
-
-

291. RMLTC0016c-PostgreSQL

-

Title: "Table with datatypes: date and timestamp"

-

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "birthdate"
-        ];
-      rml:predicate ex:birthdate
-    ], [
-      rml:objectMap [
-          rml:reference "entrancedate"
-        ];
-      rml:predicate ex:entrancedate
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-
-
-

292. RMLTC0016c-SQLServer

-

Title: "Table with datatypes: date and timestamp"

-

Description: "Tests the rr:termtype and datatype conversions: date and timestamp"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "BirthDate"
-        ];
-      rml:predicate ex:birthdate
-    ], [
-      rml:objectMap [
-          rml:reference "EntranceDate"
-        ];
-      rml:predicate ex:entrancedate
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/birthdate> "1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient10> <http://example.com/entrancedate> "2009-10-10T12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/birthdate> "1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient11> <http://example.com/entrancedate> "2008-11-12T09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/birthdate> "1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date> .
-<http://example.com/Patient12> <http://example.com/entrancedate> "2007-03-12T02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
-
-
-

293. RMLTC0016d-MySQL

-

Title: "Table with datatypes, boolean conversions"

-

Description: "Tests the rr:termtype and datatype conversions: boolean"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "PaidInAdvance"
-        ];
-      rml:predicate ex:paid
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

294. RMLTC0016d-PostgreSQL

-

Title: "Table with datatypes, boolean conversions"

-

Description: "Tests the rr:termtype and datatype conversions: boolean"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "paidinadvance"
-        ];
-      rml:predicate ex:paid
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

295. RMLTC0016d-SQLServer

-

Title: "Table with datatypes, boolean conversions"

-

Description: "Tests the rr:termtype and datatype conversions: boolean"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "PaidInAdvance"
-        ];
-      rml:predicate ex:paid
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/paid> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/paid> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

296. RMLTC0016e-MySQL

-

Title: "Table with datatypes, binary column"

-

Description: "Tests the rr:termtype and datatype conversions: binary"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-X'89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:template "data:image/png;hex,{Photo}"
-        ];
-      rml:predicate ex:photo
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-
-
-

297. RMLTC0016e-PostgreSQL

-

Title: "Table with datatypes, binary column"

-

Description: "Tests the rr:termtype and datatype conversions: binary"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate TIMESTAMP,
-PaidInAdvance BOOLEAN,
-Photo BYTEA,
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',FALSE,
-'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',TRUE,
-'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',TRUE,
-'\x89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:template "data:image/png;hex,{photo}"
-        ];
-      rml:predicate ex:photo
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{id}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-
-
-

298. RMLTC0016e-SQLServer

-

Title: "Table with datatypes, binary column"

-

Description: "Tests the rr:termtype and datatype conversions: binary"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Patient;
-
-CREATE TABLE Patient (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50),
-Sex VARCHAR(6),
-Weight REAL,
-Height FLOAT,
-BirthDate DATE,
-EntranceDate DATETIME,
-PaidInAdvance BIT,
-Photo VARBINARY(200),
-PRIMARY KEY (ID)
-);
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22',0,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-INSERT INTO Patient (ID, FirstName,LastName,Sex,Weight,Height,BirthDate,EntranceDate,PaidInAdvance,Photo)
-VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14',1,
-CAST('89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082' as VARBINARY));
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Patient"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:template "data:image/png;hex,{Photo}"
-        ];
-      rml:predicate ex:photo
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Patient{ID}"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/Patient10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient10> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient11> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFF3FC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-<http://example.com/Patient12> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Patient12> <http://example.com/photo> <data:image/png;hex,89504E470D0A1A0A0000000D49484452000000050000000508060000008D6F26E50000001C4944415408D763F9FFFEBFC37F062005C3201284D031F18258CD04000EF535CBD18E0E1F0000000049454E44AE426082> .
-
-
-

299. RMLTC0019a-CSV

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
ID,FirstName,LastName
-10,http://example.com/ns#Jhon,Smith
-20,Carlos,Mendoza
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

300. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

301. RMLTC0019a-MySQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT ID, FirstName, LastName
-        FROM Employee
-        WHERE ID < 30
-     """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

302. RMLTC0019a-PostgreSQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT ID, FirstName, LastName
-        FROM Employee
-        WHERE ID < 30
-     """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "firstname"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

303. RMLTC0019a-SQLServer

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-        SELECT ID, FirstName, LastName
-        FROM Employee
-        WHERE ID < 30
-     """;
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Query
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

304. RMLTC0019a-XML

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in elements"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-    <person>
-        <ID>10</ID>
-        <FirstName>http://example.com/ns#Jhon</FirstName>
-        <LastName>Smith</LastName>
-    </person>
-    <person>
-        <ID>20</ID>
-        <FirstName>Carlos</FirstName>
-        <LastName>Mendoza</LastName>
-    </person>
-</persons>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

305. RMLTC0019b-CSV

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
ID,FirstName,LastName
-10,http://example.com/ns#Jhon,Smith
-20,Carlos,Mendoza
-30,Juan Daniel,Crespo
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-
-

306. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    },
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-
-

307. RMLTC0019b-MySQL

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Employee"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-
-

308. RMLTC0019b-PostgreSQL

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Employee"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "firstname"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "firstname"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-
-

309. RMLTC0019b-SQLServer

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in columns, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Employee;
-
-CREATE TABLE Employee (
-ID INTEGER,
-FirstName VARCHAR(50),
-LastName VARCHAR(50)
-);
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (10,'http://example.com/ns#Jhon','Smith');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (20,'Carlos','Mendoza');
-INSERT INTO Employee (ID,FirstName,LastName) VALUES (30,'Juan Daniel','Crespo');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Employee"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-
-

310. RMLTC0019b-XML

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in elements, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-    <person>
-        <ID>10</ID>
-        <FirstName>http://example.com/ns#Jhon</FirstName>
-        <LastName>Smith</LastName>
-    </person>
-    <person>
-        <ID>20</ID>
-        <FirstName>Carlos</FirstName>
-        <LastName>Mendoza</LastName>
-    </person>
-    <person>
-        <ID>30</ID>
-        <FirstName>Juan Daniel</FirstName>
-        <LastName>Crespo</LastName>
-    </person>
-</persons>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "FirstName"
-    ] .
-
-
-

311. RMLTC0020a-CSV

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
Name
-http://example.com/company/Alice
-Bob
-Bob/Charles
-path/../Danny
-Emily Smith
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

312. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

313. RMLTC0020a-MySQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.Student_Sport;
-DROP TABLE IF EXISTS test.Student;
-
-CREATE TABLE Student (
-Name VARCHAR(50)
-);
-
-INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
-INSERT INTO Student (Name) VALUES ('Bob');
-INSERT INTO Student (Name) VALUES ('Bob/Charles');
-INSERT INTO Student (Name) VALUES ('path/../Danny');
-INSERT INTO Student (Name) VALUES ('Emily Smith');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

314. RMLTC0020a-PostgreSQL

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Student (
-Name VARCHAR(50)
-);
-
-INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
-INSERT INTO Student (Name) VALUES ('Bob');
-INSERT INTO Student (Name) VALUES ('Bob/Charles');
-INSERT INTO Student (Name) VALUES ('path/../Danny');
-INSERT INTO Student (Name) VALUES ('Emily Smith');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{name}";
-      rml:termType rml:IRI
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "password";
-  d2rq:username "postgres" .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

315. RMLTC0020a-SQLServer

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in columns"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS Student;
-
-CREATE TABLE Student (
-Name VARCHAR(50)
-);
-
-INSERT INTO Student (Name) VALUES ('http://example.com/company/Alice');
-INSERT INTO Student (Name) VALUES ('Bob');
-INSERT INTO Student (Name) VALUES ('Bob/Charles');
-INSERT INTO Student (Name) VALUES ('path/../Danny');
-INSERT INTO Student (Name) VALUES ('Emily Smith');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "Student"
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

316. RMLTC0020a-XML

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in elements"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student><Name>http://example.com/company/Alice</Name></student>
-  <student><Name>Bob</Name></student>
-  <student><Name>Bob/Charles</Name></student>
-  <student><Name>path/../Danny</Name></student>
-  <student><Name>Emily Smith</Name></student>
-</students>
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

317. RMLTC0021a-CSV

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
ID,Name,Sport
-10,Venus Williams,Tennis
-20,Serena Williams,Tennis
-30,Loena Hendrickx,Figure skating
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

318. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

319. RMLTC0021a-MySQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
USE test;
-DROP TABLE IF EXISTS test.student;
-
-CREATE TABLE student (
-  ID INTEGER,
-  Name VARCHAR(50),
-  Sport VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
-INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver";
-  d2rq:password "";
-  d2rq:username "root" .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

320. RMLTC0021a-PostgreSQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
DROP TABLE IF EXISTS student;
-
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
-INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "org.postgresql.Driver";
-  d2rq:password "";
-  d2rq:username "postgres" .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

321. RMLTC0021a-SPARQL

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ns1: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "10" ;
-    foaf:name "Venus Williams" .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Tennis" ] ;
-    rdf:ID "20" ;
-    foaf:name "Serena Williams" .
-
-[] ns1:plays [ a ns1:Sport ;
-            foaf:name "Figure skating" ] ;
-    rdf:ID "30" ;
-    foaf:name "Loena Hendrickx" .
-
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-
-ex:RefObjectMap1 a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport.value";
-      rml:parent "Sport.value"
-    ];
-  rml:parentTriplesMap ex:TriplesMap1 .
-
-ex:TriplesMap1 a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator """
-            PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-            SELECT ?Name ?ID
-            WHERE {
-                ?x  foaf:name ?Name ;
-                    rdf:ID    ?ID ;
-            } """;
-      rml:referenceFormulation formats:SPARQL_Results_JSON;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path <http://example.com/base#InputSPARQL>
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap ex:RefObjectMap1;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID.value}/{Name.value}"
-    ] .
-
-<http://example.com/base#InputSPARQL> a sd:Service;
-  sd:endpoint <http://HOST:PORT/ds1/sparql>;
-  sd:supportedLanguage sd:SPARQL11Query .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

322. RMLTC0021a-SQLServer

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
USE TestDB;
-DROP TABLE IF EXISTS student;
-CREATE TABLE student (
-  "ID" INTEGER,
-  "Name" VARCHAR(50),
-  "Sport" VARCHAR(50)
-);
-INSERT INTO student values ('10', 'Venus Williams', 'Tennis');
-INSERT INTO student values ('20', 'Serena Williams', 'Tennis');
-INSERT INTO student values ('30', 'Loena Hendrickx', 'Figure skating');
-
-

Mapping

-
@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/#DB_source> a d2rq:Database;
-  d2rq:jdbcDSN "CONNECTIONDSN";
-  d2rq:jdbcDriver "com.microsoft.sqlserver.jdbc.SQLServerDriver";
-  d2rq:password "YourSTRONG!Passw0rd;";
-  d2rq:username "sa" .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [
-      rml:source <http://example.com/base/#DB_source>;
-      rml:referenceFormulation rml:SQL2008Table;
-      rml:iterator "student"
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

323. RMLTC0021a-XML

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<students>
-  <student>
-    <ID>10</ID>
-    <Name>Venus Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-  <student>
-    <ID>20</ID>
-    <Name>Serena Williams</Name>
-    <Sport>Tennis</Sport>
-  </student>
-  <student>
-    <ID>30</ID>
-    <Name>Loena Hendrickx</Name>
-    <Sport>Figure skating</Sport>
-  </student>
-</students>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "Sport";
-      rml:parent "Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/students/student";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{ID}/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

324. RMLTC0022a-CSV

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Error expected? No

-

Input

-
Name,Age
-Venus,21
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

325. RMLTC0022b-CSV

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Error expected? No

-

Input

-
FOO,BAR
-1,string
-2,int
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{BAR}"
-            ];
-          rml:reference "FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

326. RMLTC0022c-CSV

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Error expected? No

-

Input

-
FOO,BAR
-1,string
-2,int
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.csv"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{BAR}"
-            ];
-          rml:reference "FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/base/datatype#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/base/datatype#int> .
-
-
-

327. RMLTC0023a-XML

-

Title: "XML attributes selection"

-

Description: "Test generation of triples with selected XML attributes"

-

Error expected? No

-

Input

-
<?xml version="1.0"?>
-
-<persons>
-  <person fname="Bob" lname="Smith" amount="30.0E0">
-  </person>
-  <person fname="Sue" lname="Jones" amount="20.0E0">
-  </person>
-  <person fname="Bob" lname="Smith" amount="30.0E0">
-  </person>
-</persons>
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "/persons/person";
-      rml:referenceFormulation rml:XPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.xml"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "@amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{@fname};{@lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

328. RMLTC0024a-CSV

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{NON_EXISTING_COLUMN}"
-      rml:class foaf:Person;
-    ] .
-
-
-

329. RMLTC0024b-CSV

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{Name}
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}"
-      rml:class foaf:Person;
-    ] .
-
-
-

330. RMLTC0024c-CSV

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
N\ame
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}"
-      rml:class foaf:Person;
-    ] .
-
-
-

331. RMLTC0024d-CSV

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
Name
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}"
-      rml:class foaf:Person;
-    ] .
-
-
-

332. RMLTC0024e-CSV

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{Name}
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

333. RMLTC0024f-CSV

-

Title: "Invalid IRI template 6"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
N\ame
-Venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:CSV;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250217/index.html b/src/test/resources/rml-core/docs/20250217/index.html deleted file mode 100644 index 128b077..0000000 --- a/src/test/resources/rml-core/docs/20250217/index.html +++ /dev/null @@ -1,2988 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - -
- -

RML-Core: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Core-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-core - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rml:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

6. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

7. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

8. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

9. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rml:path"

-

Description: "Tests the presence of an undefined rml:path"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

10. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

11. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rml:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

12. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

13. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

14. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

15. RMLTC0006a-JSON

-

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

16. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

17. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

18. RMLTC0007c-JSON

-

Title: "One row mapping, using rml:class"

-

Description: "Tests subjectmap with more than one class IRIs, rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

19. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

20. RMLTC0007e-JSON

-

Title: "One column mapping, using rml:graphMap and rml:class"

-

Description: "Tests subjectmap with rml:graphMap and rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

21. RMLTC0007f-JSON

-

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

22. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

23. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

24. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

25. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

26. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

27. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

28. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

29. RMLTC0010a-JSON

-

Title: "Template with table column with blank space"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

30. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

31. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

32. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

33. RMLTC0012a-JSON

-

Title: "Blank node referencing multiple columns"

-

Description: "Tests that blank nodes can be generated by referencing multiple columns"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

34. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

35. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

36. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

37. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

38. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

39. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

-

Description: "Tests a term map with an invalid rml:language value, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

40. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

41. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    },
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-
-

42. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

43. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

44. RMLTC0022a-JSON

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "$.Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

45. RMLTC0022b-JSON

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.[*]"
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

46. RMLTC0022c-JSON

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

47. RMLTC0023a-JSON

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{NON_EXISTING_COLUMN}"
-      rml:class foaf:Person;
-    ] .
-
-
-

48. RMLTC0023b-JSON

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}"
-      rml:class foaf:Person;
-    ] .
-
-
-

49. RMLTC0023c-JSON

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}"
-      rml:class foaf:Person;
-    ] .
-
-
-
-

50. RMLTC0023d-JSON

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}"
-      rml:class foaf:Person;
-    ] .
-
-
-
-

51. RMLTC0023e-JSON

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

52. RMLTC0023f-JSON

-

Title: "Invalid IRI template 6"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250224/index.html b/src/test/resources/rml-core/docs/20250224/index.html deleted file mode 100644 index b1e604b..0000000 --- a/src/test/resources/rml-core/docs/20250224/index.html +++ /dev/null @@ -1,3113 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - -
- -

RML-Core: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Core-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-core - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rml:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

6. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

7. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

8. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

9. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rml:path"

-

Description: "Tests the presence of an undefined rml:path"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

10. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

11. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rml:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

12. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

13. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

14. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

15. RMLTC0006a-JSON

-

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

16. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

17. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

18. RMLTC0007c-JSON

-

Title: "One row mapping, using rml:class"

-

Description: "Tests subjectmap with more than one class IRIs, rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

19. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

20. RMLTC0007e-JSON

-

Title: "One column mapping, using rml:graphMap and rml:class"

-

Description: "Tests subjectmap with rml:graphMap and rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

21. RMLTC0007f-JSON

-

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

22. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

23. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.Name";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

24. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

25. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

26. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

27. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

28. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

29. RMLTC0010a-JSON

-

Title: "Template with table column with blank space"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

30. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

31. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

32. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

33. RMLTC0012a-JSON

-

Title: "Blank node referencing multiple columns"

-

Description: "Tests that blank nodes can be generated by referencing multiple columns"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

34. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

35. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

36. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

37. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

38. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

39. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

-

Description: "Tests a term map with an invalid rml:language value, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

40. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

41. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    },
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-

-
-
-

42. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

43. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

44. RMLTC0022a-JSON

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "$.Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

45. RMLTC0022b-JSON

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

46. RMLTC0022c-JSON

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

47. RMLTC0023a-JSON

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{NON_EXISTING_COLUMN}";
-      rml:class foaf:Person;
-    ] .
-
-
-

48. RMLTC0023b-JSON

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

49. RMLTC0023c-JSON

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

50. RMLTC0023d-JSON

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

51. RMLTC0023e-JSON

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

52. RMLTC0023f-JSON

-

Title: "Invalid IRI template 6"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

53. RMLTC0025a-JSON

-

Title: "Generation of triples with constant blank node "

-

Description: "Tests the generation of triples with a constant blank node"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subject _:School .
-
-

Output

-
_:School <http://example.com/student> "Julio" .
-_:School <http://example.com/student> "Venus" .
-
-
-

54. RMLTC0025b-JSON

-

Title: "Usage of constant term maps in combination with explicitly defined term types"

-

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subjectMap [
-      rml:constant "School";
-      rml:termType rml:BlankNode
-  ] .
-
-
-

55. RMLTC0026a-JSON

-

Title: "Generation of triples from arrays"

-

Description: "Tests the generation of triples from array input data structures"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30" .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40" .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50" .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250228/index.html b/src/test/resources/rml-core/docs/20250228/index.html deleted file mode 100644 index d298e7e..0000000 --- a/src/test/resources/rml-core/docs/20250228/index.html +++ /dev/null @@ -1,3113 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - -
- -

RML-Core: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Core-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/core/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-core - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rml:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

6. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

7. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10" .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

8. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

9. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rml:path"

-

Description: "Tests the presence of an undefined rml:path"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

10. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

11. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rml:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

12. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

13. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

14. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

15. RMLTC0006a-JSON

-

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

16. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

17. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

18. RMLTC0007c-JSON

-

Title: "One row mapping, using rml:class"

-

Description: "Tests subjectmap with more than one class IRIs, rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

19. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

20. RMLTC0007e-JSON

-

Title: "One column mapping, using rml:graphMap and rml:class"

-

Description: "Tests subjectmap with rml:graphMap and rml:class"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

21. RMLTC0007f-JSON

-

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10" <http://example.com/PersonGraph> .
-
-
-
-

22. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

23. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.ID";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

24. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

25. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

26. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

27. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

28. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

29. RMLTC0010a-JSON

-

Title: "Template with table column with blank space"

-

Description: "Tests a template with blank space in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

30. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

31. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

32. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

33. RMLTC0012a-JSON

-

Title: "Blank node referencing multiple columns"

-

Description: "Tests that blank nodes can be generated by referencing multiple columns"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

34. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Error expected? No

-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

35. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

36. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

37. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

38. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

39. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

-

Description: "Tests a term map with an invalid rml:language value, which is an error"

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Bolivia, Plurinational State of"},
-    {"Code": "IE", "Name": "Ireland"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

40. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/base/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

41. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    },
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-

-
-
-

42. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/base/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/base/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

43. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

44. RMLTC0022a-JSON

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "$.Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

45. RMLTC0022b-JSON

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

46. RMLTC0022c-JSON

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

47. RMLTC0023a-JSON

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{NON_EXISTING_COLUMN}";
-      rml:class foaf:Person;
-    ] .
-
-
-

48. RMLTC0023b-JSON

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

49. RMLTC0023c-JSON

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

50. RMLTC0023d-JSON

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

51. RMLTC0023e-JSON

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

52. RMLTC0023f-JSON

-

Title: "Invalid IRI template 6"

-

Description: "Test handling of invalid IRI template"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

53. RMLTC0025a-JSON

-

Title: "Generation of triples with constant blank node "

-

Description: "Tests the generation of triples with a constant blank node"

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subject _:School .
-
-

Output

-
_:School <http://example.com/student> "Julio" .
-_:School <http://example.com/student> "Venus" .
-
-
-

54. RMLTC0025b-JSON

-

Title: "Usage of constant term maps in combination with explicitly defined term types"

-

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subjectMap [
-      rml:constant "School";
-      rml:termType rml:BlankNode
-  ] .
-
-
-

55. RMLTC0026a-JSON

-

Title: "Generation of triples from arrays"

-

Description: "Tests the generation of triples from array input data structures"

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30" .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40" .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50" .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250908/index.html b/src/test/resources/rml-core/docs/20250908/index.html deleted file mode 100644 index ba5fb3d..0000000 --- a/src/test/resources/rml-core/docs/20250908/index.html +++ /dev/null @@ -1,3906 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rml:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

6. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

7. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

8. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

9. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rml:path"

-

Description: "Tests the presence of an undefined rml:path"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

10. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

11. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rml:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

12. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

13. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

14. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

15. RMLTC0006a-JSON

-

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

16. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

17. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

18. RMLTC0007c-JSON

-

Title: "One row mapping, using rml:class"

-

Description: "Tests subjectmap with more than one class IRIs, rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

19. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

20. RMLTC0007e-JSON

-

Title: "One column mapping, using rml:graphMap and rml:class"

-

Description: "Tests subjectmap with rml:graphMap and rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

21. RMLTC0007f-JSON

-

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

22. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

23. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.ID";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

24. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

25. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

26. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

27. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

28. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

29. RMLTC0010a-JSON

-

Title: "Template with table column with blank space"

-

Description: "Tests a template with blank space in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

30. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

31. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

32. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {"ID":110, "Description":"Tennis"},
-    {"ID":111, "Description":"Football"},
-    {"ID":112, "Description":"Formula1"}
-  ]
-}
-
-

Input 2

-
{
-  "links": [
-    {"ID_Student":10, "ID_Sport":110},
-    {"ID_Student":11, "ID_Sport":111},
-    {"ID_Student":11, "ID_Sport":112},
-    {"ID_Student":12, "ID_Sport":111}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110" .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111" .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112" .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

33. RMLTC0012a-JSON

-

Title: "Blank node referencing multiple columns"

-

Description: "Tests that blank nodes can be generated by referencing multiple columns"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

34. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "lives": [
-    {"fname":"Bob","lname":"Smith","city":"London"},
-    {"fname":"Sue","lname":"Jones","city":"Madrid"},
-    {"fname":"Bob","lname":"Smith","city":"London"}
-  ]
-}
-
-

Input 1

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

35. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

36. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

37. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

38. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

39. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

-

Description: "Tests a term map with an invalid rml:language value, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

40. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

41. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-
-

42. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

43. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

44. RMLTC0022a-JSON

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus",
-    "Age": 21
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "$.Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

45. RMLTC0022b-JSON

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

46. RMLTC0022c-JSON

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
-
-
-

47. RMLTC0023a-JSON

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{NON_EXISTING_COLUMN}";
-      rml:class foaf:Person;
-    ] .
-
-
-

48. RMLTC0023b-JSON

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

49. RMLTC0023c-JSON

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

50. RMLTC0023d-JSON

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

51. RMLTC0023e-JSON

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\\\{Name\\\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

52. RMLTC0023f-JSON

-

Title: "Invalid IRI template 6"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-

53. RMLTC0023g-JSON

-

Title: "Valid IRI template with backslash-escape"

-

Description: "Test handling of a valid IRI template using backslash-escape"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

54. RMLTC0024a-JSON

-

Title: "Usage of constant term maps in combination with explicitly defined term types"

-

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subjectMap [
-      rml:constant "School";
-      rml:termType rml:BlankNode
-  ] .
-
-
-

55. RMLTC0025a-JSON

-

Title: "Generation of triples from arrays"

-

Description: "Tests the generation of triples from array input data structures"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

56. RMLTC0025b-JSON

-

Title: "Generation of triples from arrays with wrong reference"

-

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-
-

57. RMLTC0025c-JSON

-

Title: "Generation of triples from arrays in subject and object"

-

Description: "Tests the generation of triples from array input data structures in subject and object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.names[*]}"
-    ] .
-
-

Output

-
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

58. RMLTC0026a-JSON

-

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

-

Description: "Tests the generation of triples from relative IRIs using base IRI"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

59. RMLTC0026b-JSON

-

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

-

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://tp1.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

60. RMLTC0026c-JSON

-

Title: "Two triples maps, both with rml:baseIRI defined"

-

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

61. RMLTC0026d-JSON

-

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

-

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

62. RMLTC0027a-JSON

-

Title: "Generation of triples using the URI term type"

-

Description: "Tests the generation of triples with a URI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:URI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

63. RMLTC0027b-JSON

-

Title: "Generation of triples using the UnsafeURI term type"

-

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeURI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

64. RMLTC0027c-JSON

-

Title: "Generation of triples using the UnsafeIRI term type"

-

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeIRI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

65. RMLTC0028a-JSON

-

Title: "Generation of the right datatype for a constant in the mapping"

-

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-
- [
-    a rml:TriplesMap;
-    rml:logicalSource [
-      rml:source "data.json" ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object true ; # datatype is boolean
-    ];
-  ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

66. RMLTC0028b-JSON

-

Title: "Generation of all named graphs when rml:defaultGraph is involved"

-

Description: "Test if the default graph is also generated correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "name": "Alice"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix s: <http://schema.org/> .
-
- [
-    a rml:TriplesMap;
-    rml:logicalSource [
-      rml:source "data.json" ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-      rml:class s:Person ;
-      rml:graph <graph:1> ;
-    ];
-    rml:predicateObjectMap [
-      rml:predicate s:givenName ;
-      rml:objectMap [ rml:reference "name" ] ;
-      rml:graph rml:defaultGraph ;
-    ];
-  ] .
-
-

Output

-
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
-<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
-<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
-
-
-

67. RMLTC0028c-JSON

-

Title: "Generation of the right language tag for a constant in the mapping"

-

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
- [
-    a rml:TriplesMap;
-    rml:logicalSource [
-      rml:source "data.json" ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object "train"@en ;
-    ];
-  ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250927/index.html b/src/test/resources/rml-core/docs/20250927/index.html deleted file mode 100644 index 7039cea..0000000 --- a/src/test/resources/rml-core/docs/20250927/index.html +++ /dev/null @@ -1,3891 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rml:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

6. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

7. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

8. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

9. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rml:path"

-

Description: "Tests the presence of an undefined rml:path"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

10. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

11. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rml:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

12. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

13. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

14. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

15. RMLTC0006a-JSON

-

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

16. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

17. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

18. RMLTC0007c-JSON

-

Title: "One row mapping, using rml:class"

-

Description: "Tests subjectmap with more than one class IRIs, rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

19. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

20. RMLTC0007e-JSON

-

Title: "One column mapping, using rml:graphMap and rml:class"

-

Description: "Tests subjectmap with rml:graphMap and rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

21. RMLTC0007f-JSON

-

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

22. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

23. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.ID";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

24. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

25. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

26. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

27. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

28. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

29. RMLTC0010a-JSON

-

Title: "Template with table column with blank space"

-

Description: "Tests a template with blank space in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

30. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

31. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

32. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {"ID":110, "Description":"Tennis"},
-    {"ID":111, "Description":"Football"},
-    {"ID":112, "Description":"Formula1"}
-  ]
-}
-
-

Input 2

-
{
-  "links": [
-    {"ID_Student":10, "ID_Sport":110},
-    {"ID_Student":11, "ID_Sport":111},
-    {"ID_Student":11, "ID_Sport":112},
-    {"ID_Student":12, "ID_Sport":111}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

33. RMLTC0012a-JSON

-

Title: "Blank node referencing multiple columns"

-

Description: "Tests that blank nodes can be generated by referencing multiple columns"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30" .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20" .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

34. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "lives": [
-    {"fname":"Bob","lname":"Smith","city":"London"},
-    {"fname":"Sue","lname":"Jones","city":"Madrid"},
-    {"fname":"Bob","lname":"Smith","city":"London"}
-  ]
-}
-
-

Input 1

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

35. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

36. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

37. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

38. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

39. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

-

Description: "Tests a term map with an invalid rml:language value, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

40. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

41. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-
-

42. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

43. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

44. RMLTC0022a-JSON

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus",
-    "Age": 21
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "$.Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

45. RMLTC0022b-JSON

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

46. RMLTC0022c-JSON

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
-
-
-

47. RMLTC0023a-JSON

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

48. RMLTC0023b-JSON

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

49. RMLTC0023c-JSON

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

50. RMLTC0023d-JSON

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\\\{Name\\\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

51. RMLTC0023e-JSON

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-

52. RMLTC0023f-JSON

-

Title: "Valid IRI template with backslash-escape"

-

Description: "Test handling of a valid IRI template using backslash-escape"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
- - - - Error response - - -

Error response

-

Error code: 404

-

Message: File not found.

-

Error code explanation: 404 - Nothing matches the given URI.

- -
-

53. RMLTC0024a-JSON

-

Title: "Usage of constant term maps in combination with explicitly defined term types"

-

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subjectMap [
-      rml:constant "School";
-      rml:termType rml:BlankNode
-  ] .
-
-
-

54. RMLTC0025a-JSON

-

Title: "Generation of triples from arrays"

-

Description: "Tests the generation of triples from array input data structures"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

55. RMLTC0025b-JSON

-

Title: "Generation of triples from arrays with wrong reference"

-

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-
-

56. RMLTC0025c-JSON

-

Title: "Generation of triples from arrays in subject and object"

-

Description: "Tests the generation of triples from array input data structures in subject and object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.names[*]}"
-    ] .
-
-

Output

-
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

57. RMLTC0026a-JSON

-

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

-

Description: "Tests the generation of triples from relative IRIs using base IRI"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

58. RMLTC0026b-JSON

-

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

-

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://tp1.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

59. RMLTC0026c-JSON

-

Title: "Two triples maps, both with rml:baseIRI defined"

-

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

60. RMLTC0026d-JSON

-

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

-

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

61. RMLTC0027a-JSON

-

Title: "Generation of triples using the URI term type"

-

Description: "Tests the generation of triples with a URI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:URI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

62. RMLTC0027b-JSON

-

Title: "Generation of triples using the UnsafeURI term type"

-

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeURI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

63. RMLTC0027c-JSON

-

Title: "Generation of triples using the UnsafeIRI term type"

-

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeIRI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

64. RMLTC0028a-JSON

-

Title: "Generation of the right datatype for a constant in the mapping"

-

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object true ; # datatype is boolean
-    ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

65. RMLTC0028b-JSON

-

Title: "Generation of all named graphs when rml:defaultGraph is involved"

-

Description: "Test if the default graph is also generated correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "name": "Alice"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix s: <http://schema.org/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-      rml:class s:Person ;
-      rml:graph <graph:1> ;
-    ];
-    rml:predicateObjectMap [
-      rml:predicate s:givenName ;
-      rml:objectMap [ rml:reference "name" ] ;
-      rml:graph rml:defaultGraph ;
-    ].
-
-

Output

-
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
-<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
-<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
-
-
-

66. RMLTC0028c-JSON

-

Title: "Generation of the right language tag for a constant in the mapping"

-

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object "train"@en ;
-    ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/20250930/index.html b/src/test/resources/rml-core/docs/20250930/index.html deleted file mode 100644 index 782b75e..0000000 --- a/src/test/resources/rml-core/docs/20250930/index.html +++ /dev/null @@ -1,3878 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rml:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

6. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

7. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

8. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

9. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rml:path"

-

Description: "Tests the presence of an undefined rml:path"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

10. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

11. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rml:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

12. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

13. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

14. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

15. RMLTC0006a-JSON

-

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

16. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

17. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

18. RMLTC0007c-JSON

-

Title: "One row mapping, using rml:class"

-

Description: "Tests subjectmap with more than one class IRIs, rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

19. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

20. RMLTC0007e-JSON

-

Title: "One column mapping, using rml:graphMap and rml:class"

-

Description: "Tests subjectmap with rml:graphMap and rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

21. RMLTC0007f-JSON

-

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

22. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

23. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.ID";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

24. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

25. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

26. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

27. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

28. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

29. RMLTC0010a-JSON

-

Title: "Template with table column with blank space"

-

Description: "Tests a template with blank space in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

30. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

31. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

32. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {"ID":110, "Description":"Tennis"},
-    {"ID":111, "Description":"Football"},
-    {"ID":112, "Description":"Formula1"}
-  ]
-}
-
-

Input 2

-
{
-  "links": [
-    {"ID_Student":10, "ID_Sport":110},
-    {"ID_Student":11, "ID_Sport":111},
-    {"ID_Student":11, "ID_Sport":112},
-    {"ID_Student":12, "ID_Sport":111}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

33. RMLTC0012a-JSON

-

Title: "Blank node referencing multiple columns"

-

Description: "Tests that blank nodes can be generated by referencing multiple columns"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

34. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "lives": [
-    {"fname":"Bob","lname":"Smith","city":"London"},
-    {"fname":"Sue","lname":"Jones","city":"Madrid"},
-    {"fname":"Bob","lname":"Smith","city":"London"}
-  ]
-}
-
-

Input 1

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

35. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

36. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

37. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

38. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

39. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

-

Description: "Tests a term map with an invalid rml:language value, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

40. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

41. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-
-

42. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

43. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

44. RMLTC0022a-JSON

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus",
-    "Age": 21
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "$.Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

45. RMLTC0022b-JSON

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

46. RMLTC0022c-JSON

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
-
-
-

47. RMLTC0023a-JSON

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

48. RMLTC0023b-JSON

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

49. RMLTC0023c-JSON

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

50. RMLTC0023d-JSON

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\\\{Name\\\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

51. RMLTC0023e-JSON

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-

52. RMLTC0023f-JSON

-

Title: "Valid IRI template with backslash-escape"

-

Description: "Test handling of a valid IRI template using backslash-escape"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

53. RMLTC0024a-JSON

-

Title: "Usage of constant term maps in combination with explicitly defined term types"

-

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subjectMap [
-      rml:constant "School";
-      rml:termType rml:BlankNode
-  ] .
-
-
-

54. RMLTC0025a-JSON

-

Title: "Generation of triples from arrays"

-

Description: "Tests the generation of triples from array input data structures"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

55. RMLTC0025b-JSON

-

Title: "Generation of triples from arrays with wrong reference"

-

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-
-

56. RMLTC0025c-JSON

-

Title: "Generation of triples from arrays in subject and object"

-

Description: "Tests the generation of triples from array input data structures in subject and object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.names[*]}"
-    ] .
-
-

Output

-
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

57. RMLTC0026a-JSON

-

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

-

Description: "Tests the generation of triples from relative IRIs using base IRI"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

58. RMLTC0026b-JSON

-

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

-

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://tp1.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

59. RMLTC0026c-JSON

-

Title: "Two triples maps, both with rml:baseIRI defined"

-

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

60. RMLTC0026d-JSON

-

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

-

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

61. RMLTC0027a-JSON

-

Title: "Generation of triples using the URI term type"

-

Description: "Tests the generation of triples with a URI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:URI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

62. RMLTC0027b-JSON

-

Title: "Generation of triples using the UnsafeURI term type"

-

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeURI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

63. RMLTC0027c-JSON

-

Title: "Generation of triples using the UnsafeIRI term type"

-

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeIRI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

64. RMLTC0028a-JSON

-

Title: "Generation of the right datatype for a constant in the mapping"

-

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object true ; # datatype is boolean
-    ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

65. RMLTC0028b-JSON

-

Title: "Generation of all named graphs when rml:defaultGraph is involved"

-

Description: "Test if the default graph is also generated correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "name": "Alice"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix s: <http://schema.org/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-      rml:class s:Person ;
-      rml:graph <graph:1> ;
-    ];
-    rml:predicateObjectMap [
-      rml:predicate s:givenName ;
-      rml:objectMap [ rml:reference "name" ] ;
-      rml:graph rml:defaultGraph ;
-    ].
-
-

Output

-
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
-<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
-<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
-
-
-

66. RMLTC0028c-JSON

-

Title: "Generation of the right language tag for a constant in the mapping"

-

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object "train"@en ;
-    ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/docs/index.html b/src/test/resources/rml-core/docs/index.html deleted file mode 100644 index 782b75e..0000000 --- a/src/test/resources/rml-core/docs/index.html +++ /dev/null @@ -1,3878 +0,0 @@ - - - - - - -RML-Core: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLTC0000-JSON

-

Title: "one table, one column, zero rows"

-

Description: "Tests if an empty table produces an empty RDF graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": []
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
# empty database
-
-
-

5. RMLTC0001a-JSON

-

Title: "One column mapping, subject URI generation by using rml:template"

-

Description: "Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap <http://example.com/base/#NameSubjectMap> .
-
-<http://example.com/base/#NameSubjectMap> rml:template "http://example.com/{$.Name}" .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

6. RMLTC0001b-JSON

-

Title: "One column mapping, generation of a BlankNode subject by using rml:termType"

-

Description: "Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:Venus <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

7. RMLTC0002a-JSON

-

Title: "Two columns mapping, generation of a subject URI by the concatenation of two column values"

-

Description: "Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

8. RMLTC0002b-JSON

-

Title: "Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType"

-

Description: "Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "students{$.ID}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:students10 <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

9. RMLTC0002e-JSON

-

Title: "Two columns mapping, an undefined rml:path"

-

Description: "Tests the presence of an undefined rml:path"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

10. RMLTC0002g-JSON

-

Title: "Two columns mapping, invalid JSONPath"

-

Description: "Test the presence of an invalid JSONPath"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student2.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.IDs"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.ID}/{$.Name}"
-    ] .
-
-
-

11. RMLTC0003c-JSON

-

Title: "Three columns mapping, by using a rml:template to produce literal"

-

Description: "Tests: (1) three column mapping; and (2) the use of rml:template to produce literal"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.FirstName} {$.LastName}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/Student10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-
-
-

12. RMLTC0004a-JSON

-

Title: "Two column mapping, from one row table to two different triples"

-

Description: "Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "Student": "Venus",
-    "Sport":"Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Student"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student;
-      rml:template "http://example.com/{$.Student}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Sport;
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-<http://example.com/Tennis> <http://xmlns.com/foaf/0.1/name> "Tennis" .
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Sport> .
-
-
-
-

13. RMLTC0004b-JSON

-

Title: "One column mapping, presence of rml:termType rml:Literal on rml:subjectMap"

-

Description: "Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}";
-      rml:termType rml:Literal
-    ] .
-
-
-

14. RMLTC0005a-JSON

-

Title: "Typing of resources"

-

Description: "Tests the typing of resources"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    },
-    {
-      "fname": "Sue",
-      "lname": "Jones",
-      "amount": "20.0E0"
-    },
-    {
-      "fname": "Bob",
-      "lname": "Smith",
-      "amount": "30.0E0"
-    }
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "ious.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:owes
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:template "http://example.com/{$.fname};{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob;Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob;Smith> <http://example.com/owes> "30.0E0" .
-<http://example.com/Sue;Jones> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Sue;Jones> <http://example.com/owes> "20.0E0" .
-
-
-
-

15. RMLTC0006a-JSON

-

Title: "Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Description: "Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:constant "Bad Student"
-        ];
-      rml:predicateMap [
-          rml:constant ex:description
-        ]
-    ];
-  rml:subjectMap [
-      rml:constant ex:BadStudent;
-      rml:graphMap [
-          rml:constant <http://example.com/graph/student>
-        ]
-    ] .
-
-

Output

-
<http://example.com/BadStudent> <http://example.com/description> "Bad Student" <http://example.com/graph/student> .
-
-
-

16. RMLTC0007a-JSON

-

Title: "Typing resources by relying on rdf:type predicate"

-

Description: "Tests the typing resources by relying on rdf:type predicate"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
 <http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-
-

17. RMLTC0007b-JSON

-

Title: "Assigning triples to Named Graphs"

-

Description: "Tests the generation of triples to a named graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  <http://example.com/PersonGraph> .
-
-
-
-

18. RMLTC0007c-JSON

-

Title: "One row mapping, using rml:class"

-

Description: "Tests subjectmap with more than one class IRIs, rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class ex:Student, foaf:Person;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> . 
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

19. RMLTC0007d-JSON

-

Title: "One column mapping, specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:object ex:Student;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" . 
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Student> .
-
-
-
-

20. RMLTC0007e-JSON

-

Title: "One column mapping, using rml:graphMap and rml:class"

-

Description: "Tests subjectmap with rml:graphMap and rml:class"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:class foaf:Person;
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-
-
-
-

21. RMLTC0007f-JSON

-

Title: "One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type"

-

Description: "Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph ex:PersonGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <http://example.com/PersonGraph> .
-<http://example.com/Student/10/Venus> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/PersonGraph> .
-
-
-
-

22. RMLTC0007g-JSON

-

Title: "Assigning triples to the default graph"

-

Description: "Tests the generation of triples to the default graph"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graph rml:defaultGraph;
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-
-

23. RMLTC0007h-JSON

-

Title: "Assigning triples to a non-IRI named graph"

-

Description: "Tests the generation of triples to a non-IRI named graph, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "FirstName":"Venus",
-    "LastName":"Williams"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:reference "$.ID";
-          rml:termType rml:Literal
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.FirstName}"
-    ] .
-
-
-

24. RMLTC0008a-JSON

-

Title: "Generation of triples to a target graph by using rml:graphMap and rml:template"

-

Description: "Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.Sport"
-        ];
-      rml:predicate ex:Sport
-    ];
-  rml:subjectMap [
-      rml:graphMap [
-          rml:template "http://example.com/graph/Student/{$.ID}/{$.Name}"
-        ];
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/Student/10/Venus%20Williams> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10" <http://example.com/graph/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> "Tennis" <http://example.com/graph/Student/10/Venus%20Williams> . 
-
-
-
-

25. RMLTC0008b-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map without join"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:Sport
-    ], [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ], [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:parentTriplesMap <http://example.com/base/TriplesMap2> .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object activity:Sport;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Sport}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>  .
-<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams" .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/id> "10"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/Sport> <http://example.com/Tennis> . 
-<http://example.com/Tennis> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/activity/Sport> .
-
-
-
-
-

26. RMLTC0008c-JSON

-

Title: "Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Description: "Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name, foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/name> "Venus Williams"  .
-
-
-
-

27. RMLTC0009a-JSON

-

Title: "Generation of triples from foreign key relations"

-

Description: "Test foreign key relationships among logical tables"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams"  .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore"  .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100>  .
-
-
-

28. RMLTC0009b-JSON

-

Title: "Generation of triples to multiple graphs"

-

Description: "Test that results from distinct parts of the mapping can be directed to different target graphs."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students" : [
-    { 
-      "ID": 10,
-      "Sport": 100,
-      "Name": "Venus Williams"
-    },
-    { 
-      "ID": 20,
-      "Name": "Demi Moore"
-    }
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {
-      "ID": 100,
-      "Name": "Tennis"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:graph <http://example.com/graph/students>;
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:graph <http://example.com/graph/practise>;
-      rml:objectMap [ a rml:RefObjectMap;
-          rml:joinCondition [
-              rml:child "$.Sport";
-              rml:parent "$.ID"
-            ];
-          rml:parentTriplesMap <http://example.com/base/TriplesMap2>
-        ];
-      rml:predicate <http://example.com/ontology/practises>
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Student>;
-      rml:graph <http://example.com/graph/students>;
-      rml:template "http://example.com/resource/student_{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:class <http://example.com/ontology/Sport>;
-      rml:graph <http://example.com/graph/sports>;
-      rml:template "http://example.com/resource/sport_{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/resource/student_10> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_10> <http://xmlns.com/foaf/0.1/name> "Venus Williams" <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Student> <http://example.com/graph/students> .
-<http://example.com/resource/student_20> <http://xmlns.com/foaf/0.1/name> "Demi Moore" <http://example.com/graph/students> .
-<http://example.com/resource/sport_100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/ontology/Sport> <http://example.com/graph/sports> .
-<http://example.com/resource/sport_100> <http://www.w3.org/2000/01/rdf-schema#label> "Tennis" <http://example.com/graph/sports> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/practise> .
-<http://example.com/resource/student_10> <http://example.com/ontology/practises> <http://example.com/resource/sport_100> <http://example.com/graph/students> .
-
-
-

29. RMLTC0010a-JSON

-

Title: "Template with table column with blank space"

-

Description: "Tests a template with blank space in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2> <http://example.com/name> "Ireland" .
-<http://example.com/3> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

30. RMLTC0010b-JSON

-

Title: "Template with table columns with special chars"

-

Description: "Tests a template with special chars in column value"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:name
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/name> "Bolivia, Plurinational State of" .
-<http://example.com/2/Ireland> <http://example.com/name> "Ireland" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/name> "Saint Martin (French part)" .
-
-
-
-

31. RMLTC0010c-JSON

-

Title: "Template with table columns with special chars and backslashes"

-

Description: "Tests a template with special chars in reference value and backslash escapes in string templates"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [{
-    "Country Code": 1,
-    "Name":"Bolivia, Plurinational State of",
-    "ISO 3166": "BO"
-  }, {
-    "Country Code": 2,
-    "Name":"Ireland",
-    "ISO 3166": "IE"
-  }, {
-    "Country Code": 3,
-    "Name":"Saint Martin (French part)",
-    "ISO 3166": "MF"
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_info.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:predicate ex:code;
-      rml:objectMap [
-          rml:template "\\{\\{\\{ {$.['ISO 3166']} \\}\\}\\}";
-          rml:termType rml:Literal
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.['Country Code']}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/1/Bolivia%2C%20Plurinational%20State%20of> <http://example.com/code> "{{{ BO }}}" .
-<http://example.com/2/Ireland> <http://example.com/code> "{{{ IE }}}" .
-<http://example.com/3/Saint%20Martin%20%28French%20part%29> <http://example.com/code> "{{{ MF }}}" .
-
-
-
-

32. RMLTC0011b-JSON

-

Title: "M to M relation, by using an additional Triples Map"

-

Description: "Tests, M to M relations, by using an additional Triples Map"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"ID":10, "FirstName":"Venus", "LastName":"Williams"},
-    {"ID":11, "FirstName":"Fernando", "LastName":"Alonso"},
-    {"ID":12, "FirstName":"David", "LastName":"Villa"}
-  ]
-}
-
-

Input 1

-
{
-  "sports": [
-    {"ID":110, "Description":"Tennis"},
-    {"ID":111, "Description":"Football"},
-    {"ID":112, "Description":"Formula1"}
-  ]
-}
-
-

Input 2

-
{
-  "links": [
-    {"ID_Student":10, "ID_Sport":110},
-    {"ID_Student":11, "ID_Sport":111},
-    {"ID_Student":11, "ID_Sport":112},
-    {"ID_Student":12, "ID_Sport":111}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/LinkMap_1_2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.links[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student_sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "http://example.com/sport/{$.ID_Sport}"
-        ];
-      rml:predicate ex:plays
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID_Student}"
-    ] .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate ex:firstName
-    ], [
-      rml:objectMap [
-          rml:reference "$.LastName"
-        ];
-      rml:predicate ex:lastName
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/student/{$.ID}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.sports[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "sport.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Description"
-        ];
-      rml:predicate ex:description
-    ], [
-      rml:objectMap [
-          rml:reference "$.ID"
-        ];
-      rml:predicate ex:id
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/sport/{$.ID}"
-    ] .
-
-

Output

-
<http://example.com/student/10> <http://example.com/lastName> "Williams" .
-<http://example.com/student/10> <http://example.com/firstName> "Venus" .
-<http://example.com/student/12> <http://example.com/lastName> "Villa" .
-<http://example.com/student/12> <http://example.com/firstName> "David" .
-<http://example.com/student/11> <http://example.com/lastName> "Alonso" .
-<http://example.com/student/11> <http://example.com/firstName> "Fernando" .
-<http://example.com/sport/110> <http://example.com/description> "Tennis" .
-<http://example.com/sport/110> <http://example.com/id> "110"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/111> <http://example.com/description> "Football" .
-<http://example.com/sport/111> <http://example.com/id> "111"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/sport/112> <http://example.com/description> "Formula1" .
-<http://example.com/sport/112> <http://example.com/id> "112"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/student/10> <http://example.com/plays> <http://example.com/sport/110> .
-<http://example.com/student/12> <http://example.com/plays> <http://example.com/sport/111> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112> .
-<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111> .
-
-
-
-

33. RMLTC0012a-JSON

-

Title: "Blank node referencing multiple columns"

-

Description: "Tests that blank nodes can be generated by referencing multiple columns"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}{$.amount}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith30 <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:BobSmith30 <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones20 <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:SueJones20 <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

34. RMLTC0012b-JSON

-

Title: "Duplicate tuples generate same blank node"

-

Description: "Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "lives": [
-    {"fname":"Bob","lname":"Smith","city":"London"},
-    {"fname":"Sue","lname":"Jones","city":"Madrid"},
-    {"fname":"Bob","lname":"Smith","city":"London"}
-  ]
-}
-
-

Input 1

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.lives[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "lives.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.city"
-        ];
-      rml:predicate ex:city
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-

Output

-
_:BobSmith <http://example.com/city> "London" .
-_:BobSmith <http://xmlns.com/foaf/0.1/name> "Bob Smith" .
-_:SueJones <http://example.com/city> "Madrid" .
-_:SueJones <http://xmlns.com/foaf/0.1/name> "Sue Jones" .
-
-
-
-

35. RMLTC0012c-JSON

-

Title: "TriplesMap without subjectMap"

-

Description: "Tests a RML with missing information, TriplesMap without subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ] .
-
-
-

36. RMLTC0012d-JSON

-

Title: "TriplesMap with two subjectMap"

-

Description: "Tests a RML with wrong information, TriplesMap with two subjectMap."

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20},
-    {"fname":"Bob","lname":"Smith","amount":30}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:template "{$.fname} {$.lname}";
-          rml:termType rml:Literal
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}_{$.lname}_{$.amount}";
-      rml:termType rml:BlankNode
-    ], [
-      rml:template "{$.amount}_{$.fname}_{$.lname}";
-      rml:termType rml:BlankNode
-    ] .
-
-
-

37. RMLTC0013a-JSON

-

Title: "Null value in JSON file"

-

Description: "Tests if null values in JSON files are handled correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"ID":"1","Name":"Alice","DateOfBirth":null},
-    {"ID":"2","Name":"Bob","DateOfBirth":"September, 2010"}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.DateOfBirth"
-        ];
-      rml:predicate ex:BirthDay
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.ID}/{$.Name}/{$.DateOfBirth}"
-    ] .
-
-

Output

-
<http://example.com/Person/2/Bob/September%2C%202010> <http://example.com/BirthDay> "September, 2010" .
-
-
-

38. RMLTC0015a-JSON

-

Title: "Generation of language tags from a table with language information"

-

Description: "Generation of language tags from a table with language information"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "en";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_es.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "es";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-

Output

-
<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Bolivia, Plurinational State of"@en .
-<http://example.com/BO> <http://www.w3.org/2000/01/rdf-schema#label> "Estado Plurinacional de Bolivia"@es .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Ireland"@en .
-<http://example.com/IE> <http://www.w3.org/2000/01/rdf-schema#label> "Irlanda"@es .
-
-
-
-
-

39. RMLTC0015b-JSON

-

Title: "Generation of language tags from a table with language information, and a term map with invalid rml:language value"

-

Description: "Tests a term map with an invalid rml:language value, which is an error"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "countries": [
-    {"Code": "BO", "Name": "Estado Plurinacional de Bolivia"},
-    {"Code": "IE", "Name": "Irlanda"}
-  ]
-}
-
-

Mapping

-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-english";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.countries[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "country_en.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:language "a-spanish";
-          rml:reference "$.Name"
-        ];
-      rml:predicate rdfs:label
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Code}"
-    ] .
-
-
-

40. RMLTC0019a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {
-      "ID": 10,
-      "FirstName": "http://example.com/ns#Jhon",
-      "LastName": "Smith"
-    },
-    {
-      "ID": 20,
-      "FirstName": "Carlos",
-      "LastName": "Mendoza"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-

Output

-
<http://example.com/ns#Jhon> <http://xmlns.com/foaf/0.1/name> "http://example.com/ns#Jhon" .
-<http://example.com/Carlos> <http://xmlns.com/foaf/0.1/name> "Carlos" .
-
-
-

41. RMLTC0019b-JSON

-

Title: "Generation of triples by using IRI value in columns, with data error"

-

Description: "Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {
-      "ID": 30,
-      "FirstName": "Juan Daniel",
-      "LastName": "Crespo"
-    }
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.FirstName"
-        ];
-      rml:predicate foaf:name
-    ];
-  rml:subjectMap [
-      rml:reference "$.FirstName"
-    ] .
-
-
-

42. RMLTC0020a-JSON

-

Title: "Generation of triples by using IRI value in columns"

-

Description: "Test the generation of triples by using IRI value in attributes"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "http://example.com/company/Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "path/../Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "{$.Name}";
-      rml:termType rml:IRI
-    ] .
-
-

Output

-
<http://example.com/http%3A%2F%2Fexample.com%2Fcompany%2FAlice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/path%2F..%2FDanny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

43. RMLTC0021a-JSON

-

Title: "Generation of triples referencing object map"

-

Description: "Tests the mapping specification referencing object map with same logical source and join condition"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 20,
-    "Name":"Serena Williams",
-    "Sport": "Tennis"
-  }, {
-    "ID": 30,
-    "Name":"Loena Hendrickx",
-    "Sport": "Figure skating"
-  }]
-}
-
-

Mapping

-
@prefix activity: <http://example.com/activity/> .
-@prefix ex: <http://example.com/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/RefObjectMap1> a rml:RefObjectMap;
-  rml:joinCondition [
-      rml:child "$.Sport";
-      rml:parent "$.Sport"
-    ];
-  rml:parentTriplesMap <http://example.com/base/TriplesMap1> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap <http://example.com/base/RefObjectMap1>;
-      rml:predicate ex:sameSportAs
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.ID}/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/10/Venus%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/20/Serena%20Williams> . 
-<http://example.com/Student/20/Serena%20Williams> <http://example.com/sameSportAs> <http://example.com/Student/10/Venus%20Williams> . 
-<http://example.com/Student/30/Loena%20Hendrickx> <http://example.com/sameSportAs> <http://example.com/Student/30/Loena%20Hendrickx> . 
-
-
-
-
-

44. RMLTC0022a-JSON

-

Title: "Generating of triples with constant datatype"

-

Description: "Test triples with a fixed constant datatype"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus",
-    "Age": 21
-  }]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatype xsd:string;
-          rml:reference "$.Name"
-        ];
-      rml:predicate foaf:name
-    ], [
-      rml:objectMap [
-          rml:datatype xsd:int;
-          rml:reference "$.Age"
-        ];
-      rml:predicate ex:age
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.Name}"
-    ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/Venus> <http://example.com/age> "21"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

45. RMLTC0022b-JSON

-

Title: "Generating of triples with datatypeMap"

-

Description: "Test triples with a XSD datatype generated from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "http://www.w3.org/2001/XMLSchema#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://www.w3.org/2001/XMLSchema#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://www.w3.org/2001/XMLSchema#int> .
-
-
-

46. RMLTC0022c-JSON

-

Title: "Generating of triples with datatypeMap with custom datatype"

-

Description: "Test triples with a custom datype from the data"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[
-    { "FOO": 1, "BAR": "string"},
-    { "FOO": 2, "BAR": "int"}
-]
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "data.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:datatypeMap [
-              rml:template "datatype#{$.BAR}"
-            ];
-          rml:reference "$.FOO"
-        ];
-      rml:predicate ex:x
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.FOO}"
-    ] .
-
-

Output

-
<http://example.com/1> <http://example.com/x> "1"^^<http://example.com/datatype#string> .
-<http://example.com/2> <http://example.com/x> "2"^^<http://example.com/datatype#int> .
-
-
-

47. RMLTC0023a-JSON

-

Title: "Invalid IRI template 1"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{{Name}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

48. RMLTC0023b-JSON

-

Title: "Invalid IRI template 2"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

49. RMLTC0023c-JSON

-

Title: "Invalid IRI template 3"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "Name":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{Name\}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

50. RMLTC0023d-JSON

-

Title: "Invalid IRI template 4"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\\\{Name\\\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-
-

51. RMLTC0023e-JSON

-

Title: "Invalid IRI template 5"

-

Description: "Test handling of invalid IRI template"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "N\ame":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:referenceFormulation rml:JSONPath;
-      rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{N\\\ame}";
-      rml:class foaf:Person;
-    ] .
-
-
-

52. RMLTC0023f-JSON

-

Title: "Valid IRI template with backslash-escape"

-

Description: "Test handling of a valid IRI template using backslash-escape"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [{
-    "ID": 10,
-    "{Name}":"Venus"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-     rml:referenceFormulation rml:JSONPath;
-     rml:iterator "$.students[*]";
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{\\{Name\\}}";
-      rml:class foaf:Person;
-    ] .
-
-
-

Output

-
<http://example.com/Venus> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

53. RMLTC0024a-JSON

-

Title: "Usage of constant term maps in combination with explicitly defined term types"

-

Description: "Tests the usage of constant term maps in combination with explicitly defined term types"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "students": [{
-    "Name":"Venus"
-  },
-  {
-    "Name":"Julio"
-  }]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example.com/>.
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.Name"
-        ];
-      rml:predicate ex:student
-    ];
-  rml:subjectMap [
-      rml:constant "School";
-      rml:termType rml:BlankNode
-  ] .
-
-
-

54. RMLTC0025a-JSON

-

Title: "Generation of triples from arrays"

-

Description: "Tests the generation of triples from array input data structures"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Student/Bob/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

55. RMLTC0025b-JSON

-

Title: "Generation of triples from arrays with wrong reference"

-

Description: "Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array"

-

Default Base IRI: http://example.com/

-

Error expected? Yes

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.fname}/{$.lname}"
-    ] .
-
-
-

56. RMLTC0025c-JSON

-

Title: "Generation of triples from arrays in subject and object"

-

Description: "Tests the generation of triples from array input data structures in subject and object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"names":["Bob", "Smith"],"amounts":[30, 40, 50]}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amounts[*]"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Student/{$.names[*]}"
-    ] .
-
-

Output

-
<http://example.com/Student/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Smith> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "40"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Student/Bob> <http://example.com/amount> "50"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

57. RMLTC0026a-JSON

-

Title: "Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs"

-

Description: "Tests the generation of triples from relative IRIs using base IRI"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

58. RMLTC0026b-JSON

-

Title: "Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter"

-

Description: "Tests the generation of triples from relative IRI using base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://tp1.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://tp1.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://tp1.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

59. RMLTC0026c-JSON

-

Title: "Two triples maps, both with rml:baseIRI defined"

-

Description: "Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

60. RMLTC0026d-JSON

-

Title: "Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined"

-

Description: "Tests the generation of triples by with base IRIs different than the base IRI parameter"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "persons": [
-    {"fname":"Bob","lname":"Smith","amount":30},
-    {"fname":"Sue","lname":"Jones","amount":20}
-  ]
-}
-
-

Mapping

-
@prefix ex: <http://example.com/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.fname}"
-    ] .
-
-<http://example.com/base/TriplesMap2> a rml:TriplesMap;
-  rml:baseIRI <http://example2.com/>;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.persons[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "persons.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:objectMap [
-          rml:reference "$.amount"
-        ];
-      rml:predicate ex:amount
-    ];
-  rml:subjectMap [
-      rml:template "{$.lname}"
-    ] .
-
-

Output

-
<http://example2.com/Bob> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Jones> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Smith> <http://example.com/amount> "30"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example2.com/Sue> <http://example.com/amount> "20"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

61. RMLTC0027a-JSON

-

Title: "Generation of triples using the URI term type"

-

Description: "Tests the generation of triples with a URI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:URI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

62. RMLTC0027b-JSON

-

Title: "Generation of triples using the UnsafeURI term type"

-

Description: "Tests the generation of triples with a UnsafeURI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeURI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

63. RMLTC0027c-JSON

-

Title: "Generation of triples using the UnsafeIRI term type"

-

Description: "Tests the generation of triples with a UnsafeIRI term type in the subject or object"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
{
-  "students": [
-    {"Name": "Alice"},
-    {"Name": "Bob"},
-    {"Name": "Bob/Charles"},
-    {"Name": "Danny"},
-    {"Name": "Emily Smith"}
-  ]
-}
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-      rml:iterator "$.students[*]";
-      rml:referenceFormulation rml:JSONPath;
-      rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.json"
-        ]
-    ];
-  rml:predicateObjectMap [
-      rml:object foaf:Person;
-      rml:predicate rdf:type
-    ];
-  rml:subjectMap [
-      rml:template "http://example.com/Person/{$.Name}";
-      rml:termType rml:UnsafeIRI
-    ] .
-
-

Output

-
<http://example.com/Person/Alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Bob%2FCharles> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Danny> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-<http://example.com/Person/Emily%20Smith> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-
-
-

64. RMLTC0028a-JSON

-

Title: "Generation of the right datatype for a constant in the mapping"

-

Description: "Test the honoring of the datatype specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object true ; # datatype is boolean
-    ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
-
-
-

65. RMLTC0028b-JSON

-

Title: "Generation of all named graphs when rml:defaultGraph is involved"

-

Description: "Test if the default graph is also generated correctly."

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "name": "Alice"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix s: <http://schema.org/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-      rml:class s:Person ;
-      rml:graph <graph:1> ;
-    ];
-    rml:predicateObjectMap [
-      rml:predicate s:givenName ;
-      rml:objectMap [ rml:reference "name" ] ;
-      rml:graph rml:defaultGraph ;
-    ].
-
-

Output

-
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
-<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
-<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
-
-
-

66. RMLTC0028c-JSON

-

Title: "Generation of the right language tag for a constant in the mapping"

-

Description: "Test the honoring of the language tag specified by the constant term in the mapping"

-

Default Base IRI: http://example.com/

-

Error expected? No

-

Input

-
[ { "id": "0", "foo": "bar"  } ] 
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-
-<http://example.com/base/TriplesMap1> a rml:TriplesMap;
-    rml:logicalSource [
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]";
-      rml:source [ a rml:RelativePathSource;
-        rml:root rml:MappingDirectory;
-        rml:path "data.json"
-      ]
-    ];
-    rml:subjectMap [
-      rml:template "https://example.org/instances/{id}";
-    ];
-    rml:predicateObjectMap [
-      rml:predicate <http://example.org/ns/p> ;
-      rml:object "train"@en ;
-    ] .
-
-

Output

-
<https://example.org/instances/0> <http://example.org/ns/p> "train"@en .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-core/list.sh b/src/test/resources/rml-core/list.sh deleted file mode 100755 index 12c3203..0000000 --- a/src/test/resources/rml-core/list.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -for i in RML*; do - echo "
" -done diff --git a/src/test/resources/rml-core/make-metadata.py b/src/test/resources/rml-core/make-metadata.py deleted file mode 100755 index 48374aa..0000000 --- a/src/test/resources/rml-core/make-metadata.py +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import glob -import csv - -def get_title_description(testcase: str): - with open ('descriptions.csv') as csvfile: - reader = csv.reader(csvfile) - for row in reader: - if row[0] == testcase: - return row[1], row[2] - print(f'{testcase} not found in descriptions.csv') - sys.exit(1) - -def main(spec: str): - with open ('metadata.csv', 'w') as csvfile: - writer = csv.writer(csvfile) - writer.writerow(['ID', 'title', 'description', 'specification','base_iri', - 'mapping', 'input_format1', 'input_format2', - 'input_format3', 'output_format1', 'output_format2', - 'output_format3', 'input1', 'input2', 'input3', - 'output1', 'output2', 'output3', 'error']) - testcases = sorted(glob.glob("RML*")) - for testcase in testcases: - print(f'Generating the description of {testcase}') - title, description = get_title_description(testcase) - title = '"' + title + '"' - description = '"' + description + '"' - error = 'false' - base_iri = 'http://example.org/' - input1 = '' - input2 = '' - input3 = '' - input_format1 = '' - input_format2 = '' - input_format3 = '' - output1 = '' - output2 = '' - output3 = '' - output_format1 = '' - output_format2 = '' - output_format3 = '' - - # Input file - if os.path.exists(os.path.join(testcase, 'student.json')): - input1 = 'student.json' - input_format1 = 'application/json' - - if os.path.exists(os.path.join(testcase, 'student_sport.json')): - if testcase == 'RMLTC0009a-JSON' or testcase == 'RMLTC0009b-JSON' or testcase == 'RMLTC0011b-JSON': - input3 = 'student_sport.json' - input_format3 = 'application/json' - else: - input1 = 'student_sport.json' - input_format1 = 'application/json' - if os.path.exists(os.path.join(testcase, 'sport.json')): - input2 = 'sport.json' - input_format2 = 'application/json' - if os.path.exists(os.path.join(testcase, 'ious.json')): - input1 = 'ious.json' - input_format1 = 'application/json' - if os.path.exists(os.path.join(testcase, 'country_info.json')): - input1 = 'country_info.json' - input_format1 = 'application/json' - if os.path.exists(os.path.join(testcase, 'persons.json')): - if testcase == 'RMLTC0012b-JSON': - input2 = 'persons.json' - input_format2 = 'application/json' - else: - input1 = 'persons.json' - input_format1 = 'application/json' - if os.path.exists(os.path.join(testcase, 'country_en.json')): - input1 = 'country_en.json' - input_format1 = 'application/json' - if os.path.exists(os.path.join(testcase, 'country_es.json')): - input1 = 'country_es.json' - input_format1 = 'application/json' - if os.path.exists(os.path.join(testcase, 'data.json')): - input1 = 'data.json' - input_format1 = 'application/json' - if os.path.exists(os.path.join(testcase, 'lives.json')): - input1 = 'lives.json' - input_format1 = 'application/json' - - #print(input1, input2, input3) - - # Mapping file - if os.path.exists(os.path.join(testcase, 'mapping.ttl')): - mapping_file = 'mapping.ttl' - else: - raise ValueError('Mapping file missing!') - - # Output files - if os.path.exists(os.path.join(testcase, 'output.nq')): - output1 = 'output.nq' - output_format1 = 'application/n-quads' - else: - error = 'true' - - writer.writerow([testcase, title, description, spec, base_iri, mapping_file, - input_format1, input_format2, input_format3, - output_format1, output_format2, output_format3, - input1, input2, input3, output1, output2, - output3, error]) - lines = [] - # Title and description - lines.append(f'## {testcase}\n\n') - lines.append(f'**Title**: {title}\n\n') - lines.append(f'**Description**: {description}\n\n') - lines.append(f'**Default Base IRI**: http://example.com/\n\n') - if error == 'true': - error_html = 'Yes' - else: - error_html = 'No' - lines.append(f'**Error expected?** {error_html}\n\n') - - # Input - inputCount = '' - - for index, i in enumerate([input1, input2, input3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - input_html = f'**Input{inputCount}**\n `{i}`\n\n' - - lines.append(input_html) - inputCount = f' {index + 1}' - - # Mapping - with open(os.path.join(testcase, mapping_file)) as f: - mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' - lines.append(mapping_html) - - # Output - outputCount = '' - if output2 or output3: - outputCount = ' 1' - - for index, i in enumerate([output1, output2, output3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - output_html = f'**Output{outputCount}**\n `{i}`\n\n' - - lines.append(output_html) - outputCount = f' {index + 2}' - - - with open(os.path.join(testcase, 'README.md'), 'w') as f: - f.writelines(lines) - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('Usage: ./make-metadata.py ') - sys.exit(1) - main(sys.argv[1]) diff --git a/src/test/resources/rml-core/manifest.rml.ttl b/src/test/resources/rml-core/manifest.rml.ttl deleted file mode 100644 index 9f6175d..0000000 --- a/src/test/resources/rml-core/manifest.rml.ttl +++ /dev/null @@ -1,274 +0,0 @@ -@prefix xsd: . -@prefix dcterms: . -@prefix rml: . -@prefix rmltest: . -@prefix test: . -@base . - -# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/core/test/ - -_:source - rml:source [ - a rml:RelativePathSource ; - rml:path "metadata.csv" ; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; -. - -<#TriplesMapTestcase> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:reference "ID"; - rml:class test:TestCase; - ]; - - rml:predicateObjectMap [ - rml:predicate dcterms:identifier; - rml:objectMap [ - rml:reference "ID"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:hasError; - rml:objectMap [ - rml:reference "error"; - rml:datatype xsd:boolean; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:mappingDocument; - rml:objectMap [ - rml:reference "mapping"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:defaultBaseIRI; - rml:objectMap [ - rml:constant ; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; -. - -<#TriplesMapInput1> - a rml:TriplesMap; - - rml:logicalSource _:source ; - - rml:subjectMap [ - rml:template "{ID}/input/{input1}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format1"; - ]; - ]; -. - -<#TriplesMapInput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input2}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format2"; - ]; - ]; -. - -<#TriplesMapInput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input3}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format3"; - ]; - ]; -. - -<#TriplesMapOutput1> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output1}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format1"; - ]; - ]; -. - -<#TriplesMapOutput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output2}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format2"; - ]; - ]; -. - -<#TriplesMapOutput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output3}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format3"; - ]; - ]; -. - diff --git a/src/test/resources/rml-core/manifest.ttl b/src/test/resources/rml-core/manifest.ttl deleted file mode 100644 index a5ed034..0000000 --- a/src/test/resources/rml-core/manifest.ttl +++ /dev/null @@ -1,779 +0,0 @@ - "country_info.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0008b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0021a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0023c-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0023f-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "persons.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0010c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0023b-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0025a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0012a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "sport.json" . - "application/json" . - . - . - "RMLTC0012d-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - "persons.json" . - "application/json" . - . - "persons.json" . - "application/json" . - . - . - "RMLTC0027b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "data.json" . - "application/json" . - . - "student_sport.json" . - "application/json" . - . - . - "RMLTC0027a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "country_es.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "persons.json" . - "application/json" . - . - "persons.json" . - "application/json" . - . - . - "RMLTC0007e-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0007h-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - "data.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0007a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0007d-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "country_info.json" . - "application/json" . - . - "persons.json" . - "application/json" . - . - . - "RMLTC0009b-JSON" . - . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "ious.json" . - "application/json" . - . - . - "RMLTC0009a-JSON" . - . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0022a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "persons.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "persons.json" . - "application/json" . - . - "country_es.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0026d-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - . - . - "RMLTC0011b-JSON" . - . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "persons.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0002g-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0013a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0026c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "country_info.json" . - "application/json" . - . - . - "RMLTC0028b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student_sport.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0015b-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0028a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0002b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0004a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0019b-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - "lives.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "data.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0008a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0019a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "persons.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0023e-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0010b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0023a-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0023d-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0025c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0000-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0010a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0012c-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - "student.json" . - "application/json" . - . - . - "RMLTC0025b-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "persons.json" . - "application/json" . - . - . - "RMLTC0001b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0012b-JSON" . - . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0027c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0001a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - . - "RMLTC0003c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0007g-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "persons.json" . - "application/json" . - . - "persons.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0005a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0007c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0007f-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "sport.json" . - "application/json" . - . - . - "RMLTC0007b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "persons.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0020a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0022c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - "sport.json" . - "application/json" . - . - . - "RMLTC0022b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0024a-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0026b-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "data.json" . - "application/json" . - . - . - "RMLTC0002e-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0015a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - . - "RMLTC0026a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0028c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - . - "RMLTC0002a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "output.nq" . - "application/n-quads" . - . - "student.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - . - "RMLTC0004b-JSON" . - . - "mapping.ttl" . - "true"^^ . - . - . - "RMLTC0006a-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . - "data.json" . - "application/json" . - . - . - "RMLTC0008c-JSON" . - . - . - "mapping.ttl" . - "false"^^ . - . diff --git a/src/test/resources/rml-core/metadata.csv b/src/test/resources/rml-core/metadata.csv deleted file mode 100644 index 23b4997..0000000 --- a/src/test/resources/rml-core/metadata.csv +++ /dev/null @@ -1,64 +0,0 @@ -ID,title,description,specification,base_iri,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error -RMLTC0000-JSON,"""one table, one column, zero rows""","""Tests if an empty table produces an empty RDF graph""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0001a-JSON,"""One column mapping, subject URI generation by using rml:template""","""Tests: (1) one column mapping; (2) subject URI generation by using rml:template; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0001b-JSON,"""One column mapping, generation of a BlankNode subject by using rml:termType""","""Tests: (1) one column mapping; (2) generation of a BlankNode subject by using rml:termType; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0002a-JSON,"""Two columns mapping, generation of a subject URI by the concatenation of two column values""","""Tests: (1) two column mapping, no primary key; (2) subject URI generated by the concatenation of two column values; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0002b-JSON,"""Two columns mapping, generation of a BlankNode subject by using rml:template and rml:termType""","""Tests: (1) two column mapping, no primary key; (2) generation of a BlankNode subject by using rml:template; (3) one column to one property""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0002e-JSON,"""Two columns mapping, an undefined rml:path""","""Tests the presence of an undefined rml:path""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0002g-JSON,"""Two columns mapping, invalid JSONPath""","""Test the presence of an invalid JSONPath""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0003c-JSON,"""Three columns mapping, by using a rml:template to produce literal""","""Tests: (1) three column mapping; and (2) the use of rml:template to produce literal""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0004a-JSON,"""Two column mapping, from one row table to two different triples""","""Tests: (1) two column mapping, (2) subject URI generated by a column value; (3) from one row table to two different triples (4) typing by using rml:class""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student_sport.json,,,output.nq,,,false -RMLTC0004b-JSON,"""One column mapping, presence of rml:termType rml:Literal on rml:subjectMap""","""Tests: (1) one column mapping (2) the presence of rml:termType rml:Literal on rml:subjectMap, which is invalid""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0005a-JSON,"""Typing of resources""","""Tests the typing of resources""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,ious.json,,,output.nq,,,false -RMLTC0006a-JSON,"""Use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap""","""Tests the use of rml:constant in rml:subjectMap, rml:predicateMap, rml:objectMap and rml:graphMap""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007a-JSON,"""Typing resources by relying on rdf:type predicate""","""Tests the typing resources by relying on rdf:type predicate""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007b-JSON,"""Assigning triples to Named Graphs""","""Tests the generation of triples to a named graph""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007c-JSON,"""One row mapping, using rml:class""","""Tests subjectmap with more than one class IRIs, rml:class""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007d-JSON,"""One column mapping, specifying an rml:predicateObjectMap with rdf:type""","""Tests subjectmap with an alternative of having rml:class, i.e., by specifying an rml:predicateObjectMap with predicate rdf:type""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007e-JSON,"""One column mapping, using rml:graphMap and rml:class""","""Tests subjectmap with rml:graphMap and rml:class""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007f-JSON,"""One column mapping, using rml:graphMap and specifying an rml:predicateObjectMap with rdf:type""","""Tests subjectmap with rml:graphMap and specifying an rml:predicateObjectMap with predicate rdf:type""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007g-JSON,"""Assigning triples to the default graph""","""Tests the generation of triples to the default graph""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0007h-JSON,"""Assigning triples to a non-IRI named graph""","""Tests the generation of triples to a non-IRI named graph, which is an error""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0008a-JSON,"""Generation of triples to a target graph by using rml:graphMap and rml:template""","""Test that results of the mapping can be directed to a target graph by using rml:graphMap and rml:template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0008b-JSON,"""Generation of triples referencing object map""","""Tests the mapping specification referencing object map without join""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0008c-JSON,"""Generation of triples by using multiple predicateMaps within a rml:predicateObjectMap""","""Tests the generation of triples by using multiple predicateMaps within a rml:predicateObjectMap""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0009a-JSON,"""Generation of triples from foreign key relations""","""Test foreign key relationships among logical tables""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,,application/n-quads,,,student.json,sport.json,,output.nq,,,false -RMLTC0009b-JSON,"""Generation of triples to multiple graphs""","""Test that results from distinct parts of the mapping can be directed to different target graphs.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,,application/n-quads,,,student.json,sport.json,,output.nq,,,false -RMLTC0010a-JSON,"""Template with table column with blank space""","""Tests a template with blank space in column value""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_info.json,,,output.nq,,,false -RMLTC0010b-JSON,"""Template with table columns with special chars""","""Tests a template with special chars in column value""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_info.json,,,output.nq,,,false -RMLTC0010c-JSON,"""Template with table columns with special chars and backslashes""","""Tests a template with special chars in reference value and backslash escapes in string templates""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_info.json,,,output.nq,,,false -RMLTC0011b-JSON,"""M to M relation, by using an additional Triples Map""","""Tests, M to M relations, by using an additional Triples Map""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,application/json,application/n-quads,,,student.json,sport.json,student_sport.json,output.nq,,,false -RMLTC0012a-JSON,"""Blank node referencing multiple columns""","""Tests that blank nodes can be generated by referencing multiple columns""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0012b-JSON,"""Duplicate tuples generate same blank node""","""Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,application/json,,application/n-quads,,,lives.json,persons.json,,output.nq,,,false -RMLTC0012c-JSON,"""TriplesMap without subjectMap""","""Tests a RML with missing information, TriplesMap without subjectMap.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true -RMLTC0012d-JSON,"""TriplesMap with two subjectMap""","""Tests a RML with wrong information, TriplesMap with two subjectMap.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true -RMLTC0013a-JSON,"""Null value in JSON file""","""Tests if null values in JSON files are handled correctly.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0015a-JSON,"""Generation of language tags from a table with language information""","""Generation of language tags from a table with language information""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,country_es.json,,,output.nq,,,false -RMLTC0015b-JSON,"""Generation of language tags from a table with language information, and a term map with invalid rml:language value""","""Tests a term map with an invalid rml:language value, which is an error""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,country_es.json,,,,,,true -RMLTC0019a-JSON,"""Generation of triples by using IRI value in columns""","""Test the generation of triples by using IRI value in attributes""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0019b-JSON,"""Generation of triples by using IRI value in columns, with data error""","""Test the generation of triples by using IRI value in attributes, conforming RML mapping with data error (and limited results)""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true -RMLTC0020a-JSON,"""Generation of triples by using IRI value in columns""","""Test the generation of triples by using IRI value in attributes""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0021a-JSON,"""Generation of triples referencing object map""","""Tests the mapping specification referencing object map with same logical source and join condition""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0022a-JSON,"""Generating of triples with constant datatype""","""Test triples with a fixed constant datatype""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0022b-JSON,"""Generating of triples with datatypeMap""","""Test triples with a XSD datatype generated from the data""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false -RMLTC0022c-JSON,"""Generating of triples with datatypeMap with custom datatype""","""Test triples with a custom datype from the data""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false -RMLTC0023a-JSON,"""Invalid IRI template 1""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0023b-JSON,"""Invalid IRI template 2""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0023c-JSON,"""Invalid IRI template 3""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0023d-JSON,"""Invalid IRI template 4""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0023e-JSON,"""Invalid IRI template 5""","""Test handling of invalid IRI template""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0023f-JSON,"""Valid IRI template with backslash-escape""","""Test handling of a valid IRI template using backslash-escape""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0024a-JSON,"""Usage of constant term maps in combination with explicitly defined term types""","""Tests the usage of constant term maps in combination with explicitly defined term types""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,student.json,,,,,,true -RMLTC0025a-JSON,"""Generation of triples from arrays""","""Tests the generation of triples from array input data structures""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0025b-JSON,"""Generation of triples from arrays with wrong reference""","""Tests the generation of triples from array input data structures. Test should fail as reference points to the array and not the values of the array""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,,,,persons.json,,,,,,true -RMLTC0025c-JSON,"""Generation of triples from arrays in subject and object""","""Tests the generation of triples from array input data structures in subject and object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0026a-JSON,"""Two triples maps, one with rml:baseIRI and one without and generating absolute IRIs""","""Tests the generation of triples from relative IRIs using base IRI""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0026b-JSON,"""Two triples maps, one with rml:baseIRI one one without and generating relative IRIs using baseIRI parameter""","""Tests the generation of triples from relative IRI using base IRI parameter""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0026c-JSON,"""Two triples maps, both with rml:baseIRI defined""","""Tests the generation of triples using relative IRIs with base IRIs defined only in triples maps, without base IRI parameter""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0026d-JSON,"""Two triples maps,both with rml:bseIRI defined and baseIRI parameter defined""","""Tests the generation of triples by with base IRIs different than the base IRI parameter""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,persons.json,,,output.nq,,,false -RMLTC0027a-JSON,"""Generation of triples using the URI term type""","""Tests the generation of triples with a URI term type in the subject or object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0027b-JSON,"""Generation of triples using the UnsafeURI term type""","""Tests the generation of triples with a UnsafeURI term type in the subject or object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0027c-JSON,"""Generation of triples using the UnsafeIRI term type""","""Tests the generation of triples with a UnsafeIRI term type in the subject or object""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,student.json,,,output.nq,,,false -RMLTC0028a-JSON,"""Generation of the right datatype for a constant in the mapping""","""Test the honoring of the datatype specified by the constant term in the mapping""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false -RMLTC0028b-JSON,"""Generation of all named graphs when rml:defaultGraph is involved""","""Test if the default graph is also generated correctly.""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false -RMLTC0028c-JSON,"""Generation of the right language tag for a constant in the mapping""","""Test the honoring of the language tag specified by the constant term in the mapping""",http://w3id.org/rml/core,http://example.org/,mapping.ttl,application/json,,,application/n-quads,,,data.json,,,output.nq,,,false diff --git a/src/test/resources/rml-core/section/abstract.md b/src/test/resources/rml-core/section/abstract.md deleted file mode 100644 index e729844..0000000 --- a/src/test/resources/rml-core/section/abstract.md +++ /dev/null @@ -1 +0,0 @@ -This document defines the RML-Core test cases to the determine the RML-Core specification conformance of tools. diff --git a/src/test/resources/rml-core/section/data-model.md b/src/test/resources/rml-core/section/data-model.md deleted file mode 100644 index f4c3ad6..0000000 --- a/src/test/resources/rml-core/section/data-model.md +++ /dev/null @@ -1,12 +0,0 @@ -# Data model - -The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). -Each `test:Testcase` as the following properties: - -- `dcterms:identifier`: unique ID of the test case. -- `rmltest:hasError`: if an error of the RML Processor is expected or not. -- `rmltest:input`: One or more input data of the test case. -- `rmltest:output`: One or more output data of the test case. -- `rmltest:inputFormat`: the input data format. -- `rmltest:outputFormat`: the output data format. -- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-core/section/introduction.md b/src/test/resources/rml-core/section/introduction.md deleted file mode 100644 index caad449..0000000 --- a/src/test/resources/rml-core/section/introduction.md +++ /dev/null @@ -1,4 +0,0 @@ -# Introduction - -This document defines the RML-Core test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Core specification. diff --git a/src/test/resources/rml-core/section/test-cases.md b/src/test/resources/rml-core/section/test-cases.md deleted file mode 100644 index 63cd427..0000000 --- a/src/test/resources/rml-core/section/test-cases.md +++ /dev/null @@ -1,10 +0,0 @@ -# Test cases - -This section describes the RML-Core test cases. These descriptions are also available as RDF. -The files are available on [GitHub](https://github.com/kg-construct/rml-core/tree/main/test-cases) in the folder `test-cases`. -Each test case is contained in a single folder, containing three types of files: - - - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. - - One file with the RML rules, called `mapping.ttl`, in the Turtle format. - - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. - diff --git a/src/test/resources/rml-fnml-burp/README.md b/src/test/resources/rml-fnml-burp/README.md deleted file mode 100644 index e9dccf3..0000000 --- a/src/test/resources/rml-fnml-burp/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# FNML Test Cases - -Each test case is within a subfolder of this folder. - -If no output.nq file is present, an error is expected. - -All function descriptions are locally available under [functions.ttl](./functions.ttl). - -Some test cases are under discussion, proposed alternatives are noted via a suffix `b`. - -## Open issues for which there are no test cases - -| title | purpose | -|:---------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------:| -| Function on object, 1 constant parameter | Tests if a constant parameter can be used | -| Function on object, wrong type parameter | Tests a function with a wrong type parameter cannot be used | -| Function on object returns null | Tests that no triple should be generated when the result is null. | -| Function on object returns empty string | Tests that a triple is generated when the results is an empty string. | -| Function on object, the output termType is Literal | Tests if the output of the function is assigned the correct termType | -| Function on subject returns invalid IRI | Tests that no triples are generated for a subject that gets an invalid IRI as the result from a function. | -| Function on predicate returns invalid IRI | Tests that no triples are generated for a predicate that gets an invalid IRI as the result from a function. | -| Nested function - Test B | Tests if a composite function of form f(g(x1),h(x2)) works (i.e., two different inner functions are the arguments of the outer function) | -| Nested function - Test C | Tests if a composite function of form f(g(h(x1),x2),x3) works (i.e., the inner function is also a composite function) | -| Function on graph, 1 parameter | Tests if a function can be used on a graph | -| Function on languageMap | Tests that function on LanguageMap is handled | -| Function on graph returns invalid IRI | Tests that no triples are generated for a graph that gets an invalid IRI as the result from a function. | -| Function using non-constant shortcut property function | Tests that a non-constant FNML Function map also works | -| Function using non-constant shortcut property return | Tests that a non-constant FNML Return map also works | -| Function as equal join condition | Tests that functions can be used similar to R2RML (equal) join conditions | -| Function as other type of join condition | Tests that functions can be used for other types of join conditions (eg. string_contains or listContainsElement) | -| Function, parameter as array | Tests that list-style parameters are handled | -| Function, array_get | Tests that list-style of returned data values are handled correctly by FnO | - -## Table - -| new_id | title | purpose | data format | error expected? | input file 1 | -|:------:|:---------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------:|:-----------:|:---------------:|:-----------------:| -| 0000 | Function on object, 0 parameters | Tests (1) if a function without parameters can be used (FnO) (2) if a function on an object map can be used (Term) | CSV | FALSE | student.csv | -| 0000b | Function on object, 0 parameters (replaces 0000) | Tests (1) if a function without parameters can be used (FnO) (2) if a function on an object map can be used (Term) | CSV | FALSE | student.csv | -| 0000 | Function on object, default termType | Tests if the output of the function is assigned the correct termType by default | | | | -| 0001 | Function on object, 1 reference parameter | Tests: (1) if a function with one parameter can be used, (FnO) (2) a reference parameter can be used (Term) | CSV | FALSE | student.csv | -| 0001 | Function using non-constant shortcut property parameter | Tests that a non-constant FNML Parameter map also works | CSV | FALSE | student_param.csv | -| 0002 | Function on object, 1 false reference parameter | Tests if a false reference parameters is caught | CSV | TRUE | student.csv | -| 0003 | Function on object, 1 reference parameter, 1 constant parameter | Tests if a function with multiple parameters can be used | CSV | FALSE | student.csv | -| 0004 | Function on predicate, 1 parameter | Tests if a function can be used on a predicate | CSV | FALSE | student.csv | -| 0004b | Function on predicate, 1 parameter (replaces 0004) | Tests if a function can be used on a predicate | CSV | FALSE | student.csv | -| 0005 | Function on subject, 1 parameter | Tests if a function can be used on a subject | CSV | FALSE | student.csv | -| 0005 | Function on subject, default termType | Tests if the default termType assigned to the output of the function to be correct | | | | -| 0005b | Function on subject, default termType (replaces 0005) | Tests if the default termType assigned to the output of the function to be correct | | | | -| 0006 | Function on object, the output termType is IRI | Tests if the output of the function is assigned the correct termType | | | | -| 0006b | Function on object, the output termType is IRI (replaces 0006) | Tests if the output of the function is assigned the correct termType | | | | -| 0008 | Function on object, 1 template parameter | Tests if a function with a template parameter can be used | CSV | FALSE | student.csv | -| 0009 | Nested function - Test A | Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function) | CSV | FALSE | student.csv | -| 0010 | Function on object, specified return output | Tests if a specific return output can be used | CSV | TRUE | student.csv | diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/mapping.ttl deleted file mode 100644 index 0a99649..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ] - ] . - -<#Execution> - rml:function morph-kgc:uuid . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/output.nq deleted file mode 100644 index 1ef0cd6..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0000-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/mapping.ttl deleted file mode 100644 index 625dc2e..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix fns: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ] - ] . - -<#Execution> - rml:function fns:helloworld . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/output.nq deleted file mode 100644 index 4060b2d..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Hello World!" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0000b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/mapping.ttl deleted file mode 100644 index 34c0372..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/output.nq deleted file mode 100644 index b036969..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "VENUS" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0001-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/mapping.ttl deleted file mode 100644 index ec74a6b..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0002-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/mapping.ttl deleted file mode 100644 index b34ac26..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ] - ] . - -<#Execution> - rml:function grel:escape ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Comment" - ] - ] , - [ - rml:parameter grel:modeParam ; - rml:inputValue "html" - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/output.nq deleted file mode 100644 index af03220..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "A&B" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0003-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/mapping.ttl deleted file mode 100644 index 2a4a66f..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicateMap [ - rml:functionExecution <#Execution> ; - ]; - rml:object foaf:name; - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/output.nq deleted file mode 100644 index 4aa4759..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0004-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/mapping.ttl deleted file mode 100644 index 151932e..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix fns: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicateMap [ - rml:functionExecution <#Execution> ; - ]; - rml:object foaf:name; - ] . - -<#Execution> - rml:function fns:schema ; - rml:input - [ - rml:parameter fns:stringParameter ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/output.nq deleted file mode 100644 index 129b5d7..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0004b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/mapping.ttl deleted file mode 100644 index a929701..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:functionExecution <#Execution> ; - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:reference "Name"] - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" - ]; - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/output.nq deleted file mode 100644 index 8049363..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/student.csv deleted file mode 100644 index c33048c..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0005-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,url -1,Venus,www.example.com diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/mapping.ttl deleted file mode 100644 index d555b3d..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix fns: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:functionExecution <#Execution> ; - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:reference "Name"] - ] . - -<#Execution> - rml:function fns:schema ; - rml:input - [ - rml:parameter fns:stringParameter ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/output.nq deleted file mode 100644 index e52c6cd..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/student.csv deleted file mode 100644 index c33048c..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0005b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,url -1,Venus,www.example.com diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/mapping.ttl deleted file mode 100644 index 6e6eb01..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:termType rml:IRI - ]; - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" - ]; - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/output.nq deleted file mode 100644 index 5556ec5..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/student.csv deleted file mode 100644 index 5c20b3c..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0006-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/mapping.ttl deleted file mode 100644 index e599e66..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix fns: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:termType rml:IRI - ]; - ] . - -<#Execution> - rml:function fns:schema ; - rml:input - [ - rml:parameter fns:stringParameter ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/output.nq deleted file mode 100644 index c8c94db..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/student.csv deleted file mode 100644 index 5c20b3c..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0006b-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/mapping.ttl deleted file mode 100644 index aea3105..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:template "Name: {Name}" - ]; - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/output.nq deleted file mode 100644 index 9020be0..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "NAME: VENUS" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0008-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/mapping.ttl deleted file mode 100644 index 88a7687..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/mapping.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - -<#Person_Mapping> - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap <#NameMapping> . - -<#NameMapping> - rml:predicate foaf:name ; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ]; . - -<#Execution> a rml:FunctionExecution ; - rml:function grel:toUpperCase ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:functionExecution <#Execution2> ; - rml:return grel:stringOut - ] - ] . - -<#Execution2> a rml:Execution ; - rml:function grel:string_replace ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ] - ] , - [ - a rml:Input ; - rml:parameter grel:param_find ; - rml:inputValue " " - ] , - [ - a rml:Input ; - rml:parameter grel:param_replace ; - rml:inputValue "-" - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/output.nq deleted file mode 100644 index c8e1596..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "M-VENUS" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/student.csv deleted file mode 100644 index e5f249e..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0009-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,M Venus,A&B,A diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/mapping.ttl b/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/mapping.ttl deleted file mode 100644 index 17d75d7..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix fns: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:returnMap [ - rml:constant fns:domainOutput - ] - ] - ] . - -<#Execution> - rml:function fns:parseURL ; - rml:input - [ - rml:parameter fns:stringParameter ; - rml:inputValueMap [ - rml:reference "url" ; - ] - ] . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/output.nq b/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/output.nq deleted file mode 100644 index 3c0e8a7..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "example.com" . diff --git a/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/student.csv b/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/student.csv deleted file mode 100644 index 5c20b3c..0000000 --- a/src/test/resources/rml-fnml-burp/RMLFNOTC0010-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml-burp/functions.ttl b/src/test/resources/rml-fnml-burp/functions.ttl deleted file mode 100644 index ce6664f..0000000 --- a/src/test/resources/rml-fnml-burp/functions.ttl +++ /dev/null @@ -1,231 +0,0 @@ -@prefix dcterms: . -@prefix fno: . -@prefix fns: . -@prefix grel: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - -grel:toLowerCase - a fno:Function ; - fno:name "to Lowercase" ; - rdfs:label "to Lowercase" ; - dcterms:description "Returns the input with all letters in lower case." ; - fno:expects ( grel:valueParam ) ; - fno:returns ( grel:stringOut ) . - -grel:toUpperCase - a fno:Function ; - fno:name "to Uppercase" ; - rdfs:label "to Uppercase" ; - dcterms:description "Returns the input with all letters in upper case." ; - fno:expects ( grel:valueParam ) ; - fno:returns ( grel:stringOut ) . - -grel:toTitleCase - a fno:Function ; - fno:name "to Titlecase" ; - rdfs:label "to Titlecase" ; - dcterms:description "Returns string s converted into titlecase: a capital letter starting each word, and the rest of the letters lowercase." ; - fno:expects ( grel:valueParam ) ; - fno:returns ( grel:stringOut ) . - -grel:length - a fno:Function ; - fno:name "length" ; - rdfs:label "length" ; - dcterms:description "Returns the length of string s as a number." ; - fno:expects ( grel:valueParam ) ; - fno:returns ( grel:output_number ) . - -grel:valueParam - a fno:Parameter ; - fno:name "input value" ; - rdfs:label "input value" ; - fno:predicate grel:valueParameter ; - fno:type xsd:string ; - fno:required "true"^^xsd:boolean . - -grel:stringOut - a fno:Output ; - fno:name "output string" ; - rdfs:label "output string" ; - fno:predicate grel:stringOutput ; - fno:type xsd:string . - -grel:string_replace - a fno:Function ; - fno:name "replace" ; - dcterms:description "replace" ; - fno:expects ( grel:valueParam grel:param_find grel:param_replace ) ; - fno:returns ( grel:stringOut ) . - -grel:startsWith - a fno:Function ; - fno:name "starts with" ; - dcterms:description "starts with" ; - fno:expects ( grel:valueParam grel:param_string_sub ) ; - fno:returns ( grel:output_bool ) . - -grel:endsWith - a fno:Function ; - fno:name "ends with" ; - dcterms:description "ends with" ; - fno:expects ( grel:valueParam grel:param_string_sub ) ; - fno:returns ( grel:output_bool ) . - -grel:param_find - a fno:Parameter ; - fno:name "f" ; - rdfs:label "f" ; - fno:predicate grel:p_string_find ; - fno:type xsd:string ; - fno:required "true"^^xsd:boolean . - -grel:param_replace - a fno:Parameter ; - fno:name "r" ; - rdfs:label "r" ; - fno:predicate grel:p_string_replace ; - fno:type xsd:string ; - fno:required "true"^^xsd:boolean . - -fns:helloworld - a fno:Function ; - fno:name "hello world" ; - dcterms:description "The hello world function has no parameters and always returns the string 'Hello World!'" ; - fno:expects ( ) ; - fno:returns ( fns:stringOutput ) . - -fns:stringOutput - a fno:Output ; - fno:name "output string" ; - rdfs:label "output string" ; - fno:predicate fns:hasStringOutput ; - fno:type xsd:string . - -fns:schema - a fno:Function ; - fno:name "schema term generator" ; - dcterms:description "The schema term generator function returns a string of the form 'https://schema.org/{stringParameter}'" ; - fno:expects ( fns:stringParameter ) ; - fno:returns ( fns:stringOutput ) . - -fns:stringParameter - a fno:Parameter ; - fno:name "input string" ; - rdfs:label "input string" ; - fno:predicate fns:hasStringParameter ; - fno:type xsd:string . - -fns:parseURL - a fno:Function ; - fno:name "parse URL" ; - dcterms:description "The parse URL function returns the protocol, domain, and path as strings of a URL of the form '{protocolOutput}://{domainOutput}/{stringOutput}'" ; - fno:expects ( fns:stringParameter ) ; - fno:returns ( fns:protocolOutput fns:domainOutput fns:stringOutput ) . - -fns:protocolOutput - a fno:Output ; - fno:name "protocol output string" ; - rdfs:label "protocol output string" ; - fno:predicate fns:hasProtocolOutput ; - fno:type xsd:string . - -fns:domainOutput - a fno:Output ; - fno:name "domain output string" ; - rdfs:label "domain output string" ; - fno:predicate fns:hasDomainOutput ; - fno:type xsd:string . - -grel:string_trim - a fno:Function ; - fno:name "trim" ; - dcterms:description "trim" ; - fno:expects ( grel:valueParam ) ; - fno:returns ( grel:stringOut ) . - -grel:string_strip - a fno:Function ; - fno:name "strip" ; - dcterms:description "strip" ; - fno:expects ( grel:valueParam ) ; - fno:returns ( grel:stringOut ) . - -grel:string_chomp - a fno:Function ; - fno:name "chomp" ; - dcterms:description "chomp" ; - fno:expects ( grel:valueParam grel:param_string_sep ) ; - fno:returns ( grel:stringOut ) . - -grel:math_abs - a fno:Function ; - fno:name "abs" ; - dcterms:description "abs" ; - fno:expects ( grel:param_dec_n ); - fno:returns ( grel:output_decimal ) . - -grel:math_ceil - a fno:Function ; - fno:name "ceil" ; - dcterms:description "ceil" ; - fno:expects ( grel:param_dec_n ) ; - fno:returns ( grel:output_number ) . - -grel:math_floor - a fno:Function ; - fno:name "floor" ; - dcterms:description "floor" ; - fno:expects ( grel:param_dec_n ) ; - fno:returns ( grel:output_number ) . - -grel:string_contains - a fno:Function ; - fno:name "contains" ; - dcterms:description "contains" ; - fno:expects ( grel:valueParam grel:param_string_sub ) ; - fno:returns ( grel:output_bool ) . - -grel:string_contains_pattern - a fno:Function ; - fno:name "contains" ; - dcterms:description "contains" ; - fno:expects ( grel:valueParam grel:param_regex ) ; - fno:returns ( grel:output_bool ) . - -grel:string_substring - a fno:Function ; - fno:name "substring" ; - dcterms:description "substring" ; - fno:expects ( grel:valueParam grel:p_int_i_from grel:p_int_i_opt_to ) ; - fno:returns ( grel:stringOut ) . - -grel:string_get - a fno:Function ; - fno:name "get" ; - dcterms:description "get" ; - fno:expects ( grel:valueParam grel:p_int_i_from grel:p_int_i_opt_to ) ; - fno:returns ( grel:stringOut ) . - -grel:boolean_and - a fno:Function ; - fno:name "and" ; - dcterms:description "and" ; - fno:expects ( grel:param_bool_a grel:param_bool_b ) ; - fno:returns ( grel:output_bool ) . - -grel:boolean_or - a fno:Function ; - fno:name "or" ; - dcterms:description "or" ; - fno:expects ( grel:param_bool_a grel:param_bool_b ) ; - fno:returns ( grel:output_bool ) . - -grel:boolean_xor - a fno:Function ; - fno:name "xor" ; - dcterms:description "xor" ; - fno:expects ( grel:param_bool_a grel:param_bool_b ) ; - fno:returns ( grel:output_bool ) . \ No newline at end of file diff --git a/src/test/resources/rml-fnml-grel/README.md b/src/test/resources/rml-fnml-grel/README.md deleted file mode 100644 index 62ff218..0000000 --- a/src/test/resources/rml-fnml-grel/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# GREL functions -## Boolean functions -- [x] and(bool a, bool b) -- [x] or(bool a, bool b) -- [x] not(bool a) -- [x] xor(bool a, bool b) - -## String functions -- [X] length(s) -- [ ] toString(o, string format (optional)) - -## Testing string characteristics -- [X] startsWith(s, sub) -- [X] endsWith(s, sub) -- [X] contains(s, sub or p) - -## Basic string modification -- [X] toLowercase(s) -- [X] toUppercase(s) -- [X] toTitlecase(s) - -## Trimming -- [X] trim(s) -- [X] strip(s) -- [X] chomp(s, sep) - -## Substring -- [x] substring(s, n from, n to (optional)) -- [ ] slice(s, n from, n to (optional)) -- same as substring, leave out -- [x] get(s, n from, n to (optional)) - -## Find and replace -- [ ] indexOf(s, sub) -- [ ] lastIndexOf(s, sub) -- [x] replace(s, s find, s replace) -- [ ] replace(s, p find, s replace) -- [ ] replaceChars(s, s find, s replace) -- [ ] replaceEach(s, a find, a replace) -- [ ] find(s, sub or p) -- [ ] match(s, p) - -## String parsing and splitting -- [ ] toNumber(s) -- [ ] split(s, s or p sep, b preserveTokens (optional)) -- [ ] splitByLengths(s, n1, n2, ...) -- [ ] smartSplit(s, s or p sep (optional)) -- [ ] splitByCharType(s) -- [ ] partition(s, s or p fragment, b omitFragment (optional)) -- [ ] rpartition(s, s or p fragment, b omitFragment (optional)) - -## Encoding and hashing -- [ ] diff(s1, s2, s timeUnit (optional)) -- [X] escape(s, s mode) -- [ ] unescape(s, s mode) -- [ ] encode(s, s encoding) -- [ ] decode(s, s encoding) -- [ ] md5(o) -- [ ] sha1(o) -- [ ] phonetic(s, s encoding) -- [ ] reinterpret(s, s encoderTarget, s encoderSource) -- [ ] fingerprint(s) -- [ ] ngram(s, n) -- [ ] ngramFingerprint(s, n) -- [ ] unicode(s) -- [ ] unicodeType(s) - -## Translating -- [ ] detectLanguage(s) - -## URI parsing -- [ ] parseUri(s) - -## Array functions -- [ ] length(a) -- [ ] slice(a, n from, n to (optional)) -- [ ] get(a, n from, n to (optional)) -- [ ] inArray(a, s) -- [ ] reverse(a) -- [ ] sort(a) -- [ ] sum(a) -- [ ] join(a, sep) -- [ ] uniques(a) - -## Date functions -- [ ] now() -- [ ] toDate(o, b monthFirst, s format1, s format2, ...) -- [ ] diff(d1, d2, s timeUnit) -- [ ] inc(d, n, s timeUnit) -- [ ] datePart(d, s timeUnit) - -## Math functions -- [X] abs(n) Returns the absolute value of a number. abs(-6) returns 6. -- [ ] acos(n) Returns the arc cosine of an angle, in the range 0 through PI. acos(0.345) returns 1.218557541697832. -- [ ] asin(n) Returns the arc sine of an angle in the range of -PI/2 through PI/2. asin(0.345) returns 0.35223878509706474. -- [ ] atan(n) Returns the arc tangent of an angle in the range of -PI/2 through PI/2. atan(0.345) returns 0.3322135507465967. -- [ ] atan2(n1, n2) Converts rectangular coordinates (n1, n2) to polar (r, theta). Returns number theta. atan2(0.345,0.6) returns 0.5218342798144103. -- [X] ceil(n) Returns the ceiling of a number. 3.7.ceil() returns 4 and -3.7.ceil() returns -3. -- [ ] combin(n1, n2) Returns the number of combinations for n2 elements as divided into n1. combin(20,2) returns 190. -- [ ] cos(n) Returns the trigonometric cosine of a value. cos(5) returns 0.28366218546322625. -- [ ] cosh(n) Returns the hyperbolic cosine of a value. cosh(5) returns 74.20994852478785. -- [ ] degrees(n) Converts an angle from radians to degrees. degrees(5) returns 286.4788975654116. -- [ ] even(n) Rounds the number up to the nearest even integer. even(5) returns 6. -- [ ] exp(n) Returns e raised to the power of n. exp(5) returns 148.4131591025766. -- [ ] fact(n) Returns the factorial of a number, starting from 1. fact(5) returns 120. -- [ ] factn(n1, n2) Returns the factorial of n1, starting from n2. factn(10,3) returns 280. -- [X] floor(n) Returns the floor of a number. 3.7.floor() returns 3 and -3.7.floor() returns -4. -- [ ] gcd(n1, n2) Returns the greatest common denominator of two numbers. gcd(95,135) returns 5. -- [ ] lcm(n1, n2) Returns the least common multiple of two numbers. lcm(95,135) returns 2565. -- [ ] ln(n) Returns the natural logarithm of n. ln(5) returns 1.6094379124341003. -- [ ] log(n) Returns the base 10 logarithm of n. log(5) returns 0.6989700043360189. -- [ ] max(n1, n2) Returns the larger of two numbers. max(3,10) returns 10. -- [ ] min(n1, n2) Returns the smaller of two numbers. min(3,10) returns 3. -- [ ] mod(n1, n2) Returns n1 modulus n2. Note: value.mod(9) will work, whereas 74.mod(9) will not work. mod(74, 9) returns 2. -- [ ] multinomial(n1, n2 …(optional)) Calculates the multinomial of one number or a series of numbers. multinomial(2,3) returns 10. -- [ ] odd(n) Rounds the number up to the nearest odd integer. odd(10) returns 11. -- [ ] pow(n1, n2) Returns n1 raised to the power of n2. Note: value.pow(3)will work, whereas2.pow(3)` will not work. pow(2, 3) returns 8 (2 cubed) and pow(3, 2) returns 9 (3 squared). The square root of any numeric value can be called with value.pow(0.5). -- [ ] quotient(n1, n2) Returns the integer portion of a division (truncated, not rounded), when supplied with a numerator and denominator. quotient(9,2) returns 4. -- [ ] radians(n) Converts an angle in degrees to radians. radians(10) returns 0.17453292519943295. -- [ ] random(n lowerBound, n upperBound) Returns a random integer in the interval between the lower and upper bounds (inclusively). Will output a different random number in each cell in a column. If no arguments are provided, returns a number in the range 0.0 <= x < 1.0 -- [ ] round(n) Rounds a number to the nearest integer. 3.7.round() returns 4 and -3.7.round() returns -4. -- [ ] sin(n) Returns the trigonometric sine of an angle. sin(10) returns -0.5440211108893698. -- [ ] sinh(n) Returns the hyperbolic sine of an angle. sinh(10) returns 11013.232874703393. -- [ ] sum(a) Sums the numbers in an array. Ignores non-number items. Returns 0 if the array does not contain numbers. sum([ 10, 2, three ]) returns 12. -- [ ] tan(n) Returns the trigonometric tangent of an angle. tan(10) returns 0.6483608274590866. -- [ ] tanh(n) Returns the hyperbolic tangent of a value. tanh(10) returns 0.9999999958776927. - -## Other functions -- [ ] type(o) -- [ ] facetCount(choiceValue, s facetExpression, s columnName) -- [ ] hasField(o, s name) -- [ ] coalesce(o1, o2, o3, ...) -- [ ] cross(cell, s projectName (optional), s columnName (optional)) \ No newline at end of file diff --git a/src/test/resources/rml-fnml-grel/boolean-and-false/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-and-false/mapping.ttl deleted file mode 100644 index 23da556..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-and-false/mapping.ttl +++ /dev/null @@ -1,89 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_and ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#ExecutionB> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#ExecutionB> - rml:function grel:boolean_and ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#Execution2> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution3> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve" - ]. - -<#Execution2> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve123" - ]. - - <#Execution3> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Venu" - ]. diff --git a/src/test/resources/rml-fnml-grel/boolean-and-false/output.nq b/src/test/resources/rml-fnml-grel/boolean-and-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-and-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-and-false/student.csv b/src/test/resources/rml-fnml-grel/boolean-and-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-and-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/boolean-and-true/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-and-true/mapping.ttl deleted file mode 100644 index 34245b8..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-and-true/mapping.ttl +++ /dev/null @@ -1,89 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_and ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#ExecutionB> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#ExecutionB> - rml:function grel:boolean_and ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#Execution2> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution3> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve" - ]. - -<#Execution2> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ven" - ]. - - <#Execution3> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Venu" - ]. diff --git a/src/test/resources/rml-fnml-grel/boolean-and-true/output.nq b/src/test/resources/rml-fnml-grel/boolean-and-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-and-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-and-true/student.csv b/src/test/resources/rml-fnml-grel/boolean-and-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-and-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/boolean-not-false/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-not-false/mapping.ttl deleted file mode 100644 index 67bb690..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-not-false/mapping.ttl +++ /dev/null @@ -1,47 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_not ; - rml:input - [ - rml:parameter grel:param_bool ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve" - ]. \ No newline at end of file diff --git a/src/test/resources/rml-fnml-grel/boolean-not-false/output.nq b/src/test/resources/rml-fnml-grel/boolean-not-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-not-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-not-false/student.csv b/src/test/resources/rml-fnml-grel/boolean-not-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-not-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/boolean-not-true/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-not-true/mapping.ttl deleted file mode 100644 index 91917c0..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-not-true/mapping.ttl +++ /dev/null @@ -1,47 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_not ; - rml:input - [ - rml:parameter grel:param_bool ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve123" - ]. \ No newline at end of file diff --git a/src/test/resources/rml-fnml-grel/boolean-not-true/output.nq b/src/test/resources/rml-fnml-grel/boolean-not-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-not-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-not-true/student.csv b/src/test/resources/rml-fnml-grel/boolean-not-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-not-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/boolean-or-false/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-or-false/mapping.ttl deleted file mode 100644 index b2a648c..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-or-false/mapping.ttl +++ /dev/null @@ -1,89 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_or ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#ExecutionB> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#ExecutionB> - rml:function grel:boolean_or ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#Execution2> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution3> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve123" - ]. - -<#Execution2> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve123" - ]. - - <#Execution3> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Venu123" - ]. diff --git a/src/test/resources/rml-fnml-grel/boolean-or-false/output.nq b/src/test/resources/rml-fnml-grel/boolean-or-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-or-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-or-false/student.csv b/src/test/resources/rml-fnml-grel/boolean-or-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-or-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/boolean-or-true/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-or-true/mapping.ttl deleted file mode 100644 index 2043ff7..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-or-true/mapping.ttl +++ /dev/null @@ -1,89 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_or ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#ExecutionB> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#ExecutionB> - rml:function grel:boolean_or ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#Execution2> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution3> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve" - ]. - -<#Execution2> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve123" - ]. - - <#Execution3> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Venu" - ]. diff --git a/src/test/resources/rml-fnml-grel/boolean-or-true/output.nq b/src/test/resources/rml-fnml-grel/boolean-or-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-or-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-or-true/student.csv b/src/test/resources/rml-fnml-grel/boolean-or-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-or-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/boolean-xor-false/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-xor-false/mapping.ttl deleted file mode 100644 index bc75c73..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-xor-false/mapping.ttl +++ /dev/null @@ -1,89 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_xor ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#ExecutionB> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#ExecutionB> - rml:function grel:boolean_xor ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#Execution2> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution3> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve" - ]. - -<#Execution2> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve123" - ]. - - <#Execution3> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Venu" - ]. diff --git a/src/test/resources/rml-fnml-grel/boolean-xor-false/output.nq b/src/test/resources/rml-fnml-grel/boolean-xor-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-xor-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-xor-false/student.csv b/src/test/resources/rml-fnml-grel/boolean-xor-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-xor-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/boolean-xor-true/mapping.ttl b/src/test/resources/rml-fnml-grel/boolean-xor-true/mapping.ttl deleted file mode 100644 index c0a2618..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-xor-true/mapping.ttl +++ /dev/null @@ -1,89 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#ExecutionA> ] ; - ] . - -<#ExecutionA> - rml:function grel:boolean_xor ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#ExecutionB> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution1> ]; - ]. - -<#ExecutionB> - rml:function grel:boolean_xor ; - rml:input - [ - rml:parameter grel:param_bool_a ; - rml:inputValueMap [ rml:functionExecution <#Execution2> ]; - ] , - [ - rml:parameter grel:param_bool_b ; - rml:inputValueMap [ rml:functionExecution <#Execution3> ]; - ]. - -<#Execution1> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve" - ]. - -<#Execution2> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve123" - ]. - - <#Execution3> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Venuxxx" - ]. diff --git a/src/test/resources/rml-fnml-grel/boolean-xor-true/output.nq b/src/test/resources/rml-fnml-grel/boolean-xor-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-xor-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/boolean-xor-true/student.csv b/src/test/resources/rml-fnml-grel/boolean-xor-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/boolean-xor-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/math-abs/data.csv b/src/test/resources/rml-fnml-grel/math-abs/data.csv deleted file mode 100644 index a09c6e6..0000000 --- a/src/test/resources/rml-fnml-grel/math-abs/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,VAL -1,-6 diff --git a/src/test/resources/rml-fnml-grel/math-abs/mapping.ttl b/src/test/resources/rml-fnml-grel/math-abs/mapping.ttl deleted file mode 100644 index 91db96b..0000000 --- a/src/test/resources/rml-fnml-grel/math-abs/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.csv" - ]; - rml:referenceFormulation rml:CSV ; - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:math_abs ; - rml:input - [ - rml:parameter grel:param_dec_n ; - rml:inputValueMap [ rml:reference "VAL" ; rml:datatype xsd:integer ]; - ]. diff --git a/src/test/resources/rml-fnml-grel/math-abs/output.nq b/src/test/resources/rml-fnml-grel/math-abs/output.nq deleted file mode 100644 index 0eac51d..0000000 --- a/src/test/resources/rml-fnml-grel/math-abs/output.nq +++ /dev/null @@ -1 +0,0 @@ - "6"^^ . diff --git a/src/test/resources/rml-fnml-grel/math-ceil/data.csv b/src/test/resources/rml-fnml-grel/math-ceil/data.csv deleted file mode 100644 index 840df8a..0000000 --- a/src/test/resources/rml-fnml-grel/math-ceil/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,VAL -1,6.5 diff --git a/src/test/resources/rml-fnml-grel/math-ceil/mapping.ttl b/src/test/resources/rml-fnml-grel/math-ceil/mapping.ttl deleted file mode 100644 index 1d433e6..0000000 --- a/src/test/resources/rml-fnml-grel/math-ceil/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.csv" - ]; - rml:referenceFormulation rml:CSV ; - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:math_ceil ; - rml:input - [ - rml:parameter grel:param_dec_n ; - rml:inputValueMap [ rml:reference "VAL" ; rml:datatype xsd:float ]; - ]. diff --git a/src/test/resources/rml-fnml-grel/math-ceil/output.nq b/src/test/resources/rml-fnml-grel/math-ceil/output.nq deleted file mode 100644 index c628656..0000000 --- a/src/test/resources/rml-fnml-grel/math-ceil/output.nq +++ /dev/null @@ -1 +0,0 @@ - "7"^^ . diff --git a/src/test/resources/rml-fnml-grel/math-floor/data.csv b/src/test/resources/rml-fnml-grel/math-floor/data.csv deleted file mode 100644 index 840df8a..0000000 --- a/src/test/resources/rml-fnml-grel/math-floor/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -ID,VAL -1,6.5 diff --git a/src/test/resources/rml-fnml-grel/math-floor/mapping.ttl b/src/test/resources/rml-fnml-grel/math-floor/mapping.ttl deleted file mode 100644 index 23d95a4..0000000 --- a/src/test/resources/rml-fnml-grel/math-floor/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "data.csv" - ]; - rml:referenceFormulation rml:CSV ; - ]; - rml:subjectMap [ - rml:template "http://example.com/{ID}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:math_floor ; - rml:input - [ - rml:parameter grel:param_dec_n ; - rml:inputValueMap [ rml:reference "VAL" ; rml:datatype xsd:float ]; - ]. diff --git a/src/test/resources/rml-fnml-grel/math-floor/output.nq b/src/test/resources/rml-fnml-grel/math-floor/output.nq deleted file mode 100644 index 0eac51d..0000000 --- a/src/test/resources/rml-fnml-grel/math-floor/output.nq +++ /dev/null @@ -1 +0,0 @@ - "6"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-chomp-a/mapping.ttl b/src/test/resources/rml-fnml-grel/string-chomp-a/mapping.ttl deleted file mode 100644 index b6554e1..0000000 --- a/src/test/resources/rml-fnml-grel/string-chomp-a/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_chomp ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sep ; - rml:inputValue "us" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-chomp-a/output.nq b/src/test/resources/rml-fnml-grel/string-chomp-a/output.nq deleted file mode 100644 index f4c7208..0000000 --- a/src/test/resources/rml-fnml-grel/string-chomp-a/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Ven" . \ No newline at end of file diff --git a/src/test/resources/rml-fnml-grel/string-chomp-a/student.csv b/src/test/resources/rml-fnml-grel/string-chomp-a/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-chomp-a/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-chomp-b/mapping.ttl b/src/test/resources/rml-fnml-grel/string-chomp-b/mapping.ttl deleted file mode 100644 index 45ce82f..0000000 --- a/src/test/resources/rml-fnml-grel/string-chomp-b/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_chomp ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sep ; - rml:inputValue "x" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-chomp-b/output.nq b/src/test/resources/rml-fnml-grel/string-chomp-b/output.nq deleted file mode 100644 index d62d0bc..0000000 --- a/src/test/resources/rml-fnml-grel/string-chomp-b/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . \ No newline at end of file diff --git a/src/test/resources/rml-fnml-grel/string-chomp-b/student.csv b/src/test/resources/rml-fnml-grel/string-chomp-b/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-chomp-b/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-contains-p-false/mapping.ttl b/src/test/resources/rml-fnml-grel/string-contains-p-false/mapping.ttl deleted file mode 100644 index 43aaba5..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-p-false/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_contains_pattern ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_regex ; - rml:inputValue "(.*)anu(.*)" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-contains-p-false/output.nq b/src/test/resources/rml-fnml-grel/string-contains-p-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-p-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-contains-p-false/student.csv b/src/test/resources/rml-fnml-grel/string-contains-p-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-p-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-contains-p-true/mapping.ttl b/src/test/resources/rml-fnml-grel/string-contains-p-true/mapping.ttl deleted file mode 100644 index d705c2c..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-p-true/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_contains_pattern ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_regex ; - rml:inputValue "(.*)enu(.*)" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-contains-p-true/output.nq b/src/test/resources/rml-fnml-grel/string-contains-p-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-p-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-contains-p-true/student.csv b/src/test/resources/rml-fnml-grel/string-contains-p-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-p-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-contains-s-false/mapping.ttl b/src/test/resources/rml-fnml-grel/string-contains-s-false/mapping.ttl deleted file mode 100644 index d7791bd..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-s-false/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_contains ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "an" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-contains-s-false/output.nq b/src/test/resources/rml-fnml-grel/string-contains-s-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-s-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-contains-s-false/student.csv b/src/test/resources/rml-fnml-grel/string-contains-s-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-s-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-contains-s-true/mapping.ttl b/src/test/resources/rml-fnml-grel/string-contains-s-true/mapping.ttl deleted file mode 100644 index 5178763..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-s-true/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_contains ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "en" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-contains-s-true/output.nq b/src/test/resources/rml-fnml-grel/string-contains-s-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-s-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-contains-s-true/student.csv b/src/test/resources/rml-fnml-grel/string-contains-s-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-contains-s-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-endswith-false/mapping.ttl b/src/test/resources/rml-fnml-grel/string-endswith-false/mapping.ttl deleted file mode 100644 index 02e9261..0000000 --- a/src/test/resources/rml-fnml-grel/string-endswith-false/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:endsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "X" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-endswith-false/output.nq b/src/test/resources/rml-fnml-grel/string-endswith-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/string-endswith-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-endswith-false/student.csv b/src/test/resources/rml-fnml-grel/string-endswith-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-endswith-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-endswith-true/mapping.ttl b/src/test/resources/rml-fnml-grel/string-endswith-true/mapping.ttl deleted file mode 100644 index 6615522..0000000 --- a/src/test/resources/rml-fnml-grel/string-endswith-true/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:endsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "us" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-endswith-true/output.nq b/src/test/resources/rml-fnml-grel/string-endswith-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/string-endswith-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-endswith-true/student.csv b/src/test/resources/rml-fnml-grel/string-endswith-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-endswith-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-get-a/mapping.ttl b/src/test/resources/rml-fnml-grel/string-get-a/mapping.ttl deleted file mode 100644 index ccead51..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-a/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_get ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1" - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_opt_to ; - rml:inputValue "3" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-get-a/output.nq b/src/test/resources/rml-fnml-grel/string-get-a/output.nq deleted file mode 100644 index 611cba8..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-a/output.nq +++ /dev/null @@ -1 +0,0 @@ - "en" . diff --git a/src/test/resources/rml-fnml-grel/string-get-a/student.csv b/src/test/resources/rml-fnml-grel/string-get-a/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-a/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-get-b/mapping.ttl b/src/test/resources/rml-fnml-grel/string-get-b/mapping.ttl deleted file mode 100644 index 6531add..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-b/mapping.ttl +++ /dev/null @@ -1,41 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_get ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-get-b/output.nq b/src/test/resources/rml-fnml-grel/string-get-b/output.nq deleted file mode 100644 index 4a129e8..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-b/output.nq +++ /dev/null @@ -1 +0,0 @@ - "e" . diff --git a/src/test/resources/rml-fnml-grel/string-get-b/student.csv b/src/test/resources/rml-fnml-grel/string-get-b/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-b/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-get-c/mapping.ttl b/src/test/resources/rml-fnml-grel/string-get-c/mapping.ttl deleted file mode 100644 index 6fdb224..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-c/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_get ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1" - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_opt_to ; - rml:inputValue "-1" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-get-c/output.nq b/src/test/resources/rml-fnml-grel/string-get-c/output.nq deleted file mode 100644 index 87f17a7..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-c/output.nq +++ /dev/null @@ -1 +0,0 @@ - "enu" . diff --git a/src/test/resources/rml-fnml-grel/string-get-c/student.csv b/src/test/resources/rml-fnml-grel/string-get-c/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-get-c/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-length/mapping.ttl b/src/test/resources/rml-fnml-grel/string-length/mapping.ttl deleted file mode 100644 index 37f2218..0000000 --- a/src/test/resources/rml-fnml-grel/string-length/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - -<#Person_Mapping> - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:length ; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ]; - ]; . - -<#Execution> a rml:FunctionExecution ; - rml:function grel:length ; - rml:input [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ] - ] . \ No newline at end of file diff --git a/src/test/resources/rml-fnml-grel/string-length/output.nq b/src/test/resources/rml-fnml-grel/string-length/output.nq deleted file mode 100644 index f1c8e58..0000000 --- a/src/test/resources/rml-fnml-grel/string-length/output.nq +++ /dev/null @@ -1 +0,0 @@ - "5"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-length/student.csv b/src/test/resources/rml-fnml-grel/string-length/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-length/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-replace/mapping.ttl b/src/test/resources/rml-fnml-grel/string-replace/mapping.ttl deleted file mode 100644 index 88a7687..0000000 --- a/src/test/resources/rml-fnml-grel/string-replace/mapping.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - -<#Person_Mapping> - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap <#NameMapping> . - -<#NameMapping> - rml:predicate foaf:name ; - rml:objectMap [ - rml:functionExecution <#Execution> ; - ]; . - -<#Execution> a rml:FunctionExecution ; - rml:function grel:toUpperCase ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:functionExecution <#Execution2> ; - rml:return grel:stringOut - ] - ] . - -<#Execution2> a rml:Execution ; - rml:function grel:string_replace ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ] - ] , - [ - a rml:Input ; - rml:parameter grel:param_find ; - rml:inputValue " " - ] , - [ - a rml:Input ; - rml:parameter grel:param_replace ; - rml:inputValue "-" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-replace/output.nq b/src/test/resources/rml-fnml-grel/string-replace/output.nq deleted file mode 100644 index c8e1596..0000000 --- a/src/test/resources/rml-fnml-grel/string-replace/output.nq +++ /dev/null @@ -1 +0,0 @@ - "M-VENUS" . diff --git a/src/test/resources/rml-fnml-grel/string-replace/student.csv b/src/test/resources/rml-fnml-grel/string-replace/student.csv deleted file mode 100644 index e5f249e..0000000 --- a/src/test/resources/rml-fnml-grel/string-replace/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,M Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-startswith-false/mapping.ttl b/src/test/resources/rml-fnml-grel/string-startswith-false/mapping.ttl deleted file mode 100644 index 134e871..0000000 --- a/src/test/resources/rml-fnml-grel/string-startswith-false/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "X" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-startswith-false/output.nq b/src/test/resources/rml-fnml-grel/string-startswith-false/output.nq deleted file mode 100644 index b5028b6..0000000 --- a/src/test/resources/rml-fnml-grel/string-startswith-false/output.nq +++ /dev/null @@ -1 +0,0 @@ - "false"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-startswith-false/student.csv b/src/test/resources/rml-fnml-grel/string-startswith-false/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-startswith-false/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-startswith-true/mapping.ttl b/src/test/resources/rml-fnml-grel/string-startswith-true/mapping.ttl deleted file mode 100644 index c024dac..0000000 --- a/src/test/resources/rml-fnml-grel/string-startswith-true/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:test; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:startsWith ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ rml:reference "Name" ]; - ] , - [ - a rml:Input ; - rml:parameter grel:param_string_sub ; - rml:inputValue "Ve" - ]. diff --git a/src/test/resources/rml-fnml-grel/string-startswith-true/output.nq b/src/test/resources/rml-fnml-grel/string-startswith-true/output.nq deleted file mode 100644 index 09f2b3e..0000000 --- a/src/test/resources/rml-fnml-grel/string-startswith-true/output.nq +++ /dev/null @@ -1 +0,0 @@ - "true"^^ . diff --git a/src/test/resources/rml-fnml-grel/string-startswith-true/student.csv b/src/test/resources/rml-fnml-grel/string-startswith-true/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-startswith-true/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-strip/mapping.ttl b/src/test/resources/rml-fnml-grel/string-strip/mapping.ttl deleted file mode 100644 index 87c29c0..0000000 --- a/src/test/resources/rml-fnml-grel/string-strip/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Id}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_strip ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml-grel/string-strip/output.nq b/src/test/resources/rml-fnml-grel/string-strip/output.nq deleted file mode 100644 index 511ac7e..0000000 --- a/src/test/resources/rml-fnml-grel/string-strip/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-fnml-grel/string-strip/student.csv b/src/test/resources/rml-fnml-grel/string-strip/student.csv deleted file mode 100644 index 41a5eeb..0000000 --- a/src/test/resources/rml-fnml-grel/string-strip/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1, Venus ,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-substring-a/mapping.ttl b/src/test/resources/rml-fnml-grel/string-substring-a/mapping.ttl deleted file mode 100644 index 055dfdf..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-a/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1" - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_opt_to ; - rml:inputValue "3" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-substring-a/output.nq b/src/test/resources/rml-fnml-grel/string-substring-a/output.nq deleted file mode 100644 index 611cba8..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-a/output.nq +++ /dev/null @@ -1 +0,0 @@ - "en" . diff --git a/src/test/resources/rml-fnml-grel/string-substring-a/student.csv b/src/test/resources/rml-fnml-grel/string-substring-a/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-a/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-substring-b/mapping.ttl b/src/test/resources/rml-fnml-grel/string-substring-b/mapping.ttl deleted file mode 100644 index a9fd4fc..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-b/mapping.ttl +++ /dev/null @@ -1,41 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-substring-b/output.nq b/src/test/resources/rml-fnml-grel/string-substring-b/output.nq deleted file mode 100644 index 7ae52c0..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-b/output.nq +++ /dev/null @@ -1 +0,0 @@ - "enus" . diff --git a/src/test/resources/rml-fnml-grel/string-substring-b/student.csv b/src/test/resources/rml-fnml-grel/string-substring-b/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-b/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-substring-c/mapping.ttl b/src/test/resources/rml-fnml-grel/string-substring-c/mapping.ttl deleted file mode 100644 index 3ce14e6..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-c/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1" - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_opt_to ; - rml:inputValue "-1" - ] . diff --git a/src/test/resources/rml-fnml-grel/string-substring-c/output.nq b/src/test/resources/rml-fnml-grel/string-substring-c/output.nq deleted file mode 100644 index 87f17a7..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-c/output.nq +++ /dev/null @@ -1 +0,0 @@ - "enu" . diff --git a/src/test/resources/rml-fnml-grel/string-substring-c/student.csv b/src/test/resources/rml-fnml-grel/string-substring-c/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-substring-c/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-tolowercase/mapping.ttl b/src/test/resources/rml-fnml-grel/string-tolowercase/mapping.ttl deleted file mode 100644 index 592f100..0000000 --- a/src/test/resources/rml-fnml-grel/string-tolowercase/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:toLowerCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:template "Name: {Name}" - ]; - ] . diff --git a/src/test/resources/rml-fnml-grel/string-tolowercase/output.nq b/src/test/resources/rml-fnml-grel/string-tolowercase/output.nq deleted file mode 100644 index 5d5b743..0000000 --- a/src/test/resources/rml-fnml-grel/string-tolowercase/output.nq +++ /dev/null @@ -1 +0,0 @@ - "name: venus" . diff --git a/src/test/resources/rml-fnml-grel/string-tolowercase/student.csv b/src/test/resources/rml-fnml-grel/string-tolowercase/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-tolowercase/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-totitlecase-a/mapping.ttl b/src/test/resources/rml-fnml-grel/string-totitlecase-a/mapping.ttl deleted file mode 100644 index 1f66b20..0000000 --- a/src/test/resources/rml-fnml-grel/string-totitlecase-a/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:toTitleCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:template "name: {Name}" - ]; - ] . diff --git a/src/test/resources/rml-fnml-grel/string-totitlecase-a/output.nq b/src/test/resources/rml-fnml-grel/string-totitlecase-a/output.nq deleted file mode 100644 index d20b57e..0000000 --- a/src/test/resources/rml-fnml-grel/string-totitlecase-a/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Name: Venus" . diff --git a/src/test/resources/rml-fnml-grel/string-totitlecase-a/student.csv b/src/test/resources/rml-fnml-grel/string-totitlecase-a/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-totitlecase-a/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-totitlecase-b/mapping.ttl b/src/test/resources/rml-fnml-grel/string-totitlecase-b/mapping.ttl deleted file mode 100644 index 98a1963..0000000 --- a/src/test/resources/rml-fnml-grel/string-totitlecase-b/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:toTitleCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:constant "Once upon a midnight DREARY" - ]; - ] . diff --git a/src/test/resources/rml-fnml-grel/string-totitlecase-b/output.nq b/src/test/resources/rml-fnml-grel/string-totitlecase-b/output.nq deleted file mode 100644 index f04f4ec..0000000 --- a/src/test/resources/rml-fnml-grel/string-totitlecase-b/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Once Upon A Midnight Dreary" . diff --git a/src/test/resources/rml-fnml-grel/string-totitlecase-b/student.csv b/src/test/resources/rml-fnml-grel/string-totitlecase-b/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-totitlecase-b/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-touppercase/mapping.ttl b/src/test/resources/rml-fnml-grel/string-touppercase/mapping.ttl deleted file mode 100644 index aea3105..0000000 --- a/src/test/resources/rml-fnml-grel/string-touppercase/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:template "Name: {Name}" - ]; - ] . diff --git a/src/test/resources/rml-fnml-grel/string-touppercase/output.nq b/src/test/resources/rml-fnml-grel/string-touppercase/output.nq deleted file mode 100644 index 9020be0..0000000 --- a/src/test/resources/rml-fnml-grel/string-touppercase/output.nq +++ /dev/null @@ -1 +0,0 @@ - "NAME: VENUS" . diff --git a/src/test/resources/rml-fnml-grel/string-touppercase/student.csv b/src/test/resources/rml-fnml-grel/string-touppercase/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml-grel/string-touppercase/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml-grel/string-trim/mapping.ttl b/src/test/resources/rml-fnml-grel/string-trim/mapping.ttl deleted file mode 100644 index 4c2e287..0000000 --- a/src/test/resources/rml-fnml-grel/string-trim/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix morph-kgc: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Id}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:functionExecution <#Execution> ] ; - ] . - -<#Execution> - rml:function grel:string_trim ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml-grel/string-trim/output.nq b/src/test/resources/rml-fnml-grel/string-trim/output.nq deleted file mode 100644 index 511ac7e..0000000 --- a/src/test/resources/rml-fnml-grel/string-trim/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-fnml-grel/string-trim/student.csv b/src/test/resources/rml-fnml-grel/string-trim/student.csv deleted file mode 100644 index 41a5eeb..0000000 --- a/src/test/resources/rml-fnml-grel/string-trim/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1, Venus ,A&B,A diff --git a/src/test/resources/rml-fnml/README.md b/src/test/resources/rml-fnml/README.md deleted file mode 100644 index 1f7ff70..0000000 --- a/src/test/resources/rml-fnml/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# FNML Test Cases - -Each test case is within a subfolder of this folder. - -If no output.nq file is present, an error is expected. - -All function descriptions are locally available under [functions.ttl](./functions.ttl). - -A nicely rendered HTML page of all test cases is available at https://w3id.org/rml/fnml/test-cases. - -## Functions that are used in these test cases - -`@prefix idlab-fn: .` -`@prefix grel: .` - -## Updating the metadata - -The test cases publication (html pages) can be generated as followed: - -1. Add the testcase description in `descriptions.csv` or fetch it from the [Google spreadsheet](https://docs.google.com/spreadsheets/d/1Ui216z2cF8bNAbdZvws-JoAhcjj4M2k_NlfzmCh1jh8/edit?gid=1793408313#gid=1793408313). -2. Execute the `make-metadata.py` script: `./make-metadata.py http://w3id.org/rml/fnml/` - (This is based on the content of the folders with the test cases, and on the file descriptions.csv for the descriptions of the cases) -3. Download burp: `curl -LO https://github.com/kg-construct/BURP/releases/download/v0.1.1/burp.jar` -4. Generate the manifest with [Burp](https://github.com/kg-construct/BURP): `java -jar burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/fnml/test/` -5. Run list.sh and insert output in dev.html -6. Set the `prevVersion` in config.js -7. To publish the new HTML verson of the test cases, export `dev.html` as `index.html` in ./docs and in a subfolder with the date of the publication (maybe adapt the publication date) - -## Open issues for which there are no test cases - -| title | purpose | -| - | - | -| Function on object, default termType | Tests if the default termType assigned to the output of the function in an object position to be correct | -| Function on subject, default termType | Tests if the default termType assigned to the output of the function in a subject position to be correct | -| Function using non-constant shortcut property function | Tests that a non-constant FNML Function map also works | -| Function using non-constant shortcut property return | Tests that a non-constant FNML Return map also works | -| Nested function - Test B | Tests if a composite function of form f(g(x1),h(x2)) works (i.e., two different inner functions are the arguments of the outer function) | -| Nested function - Test C | Tests if a composite function of form f(g(h(x1),x2),x3) works (i.e., the inner function is also a composite function) | diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/README.md deleted file mode 100644 index 625a34d..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/README.md +++ /dev/null @@ -1,59 +0,0 @@ -## RMLFNMLTC0001-CSV - -**Title**: Function on object, 0 parameters - -**Description**: Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term) -(3) if the output of the function is assigned the correct termType by default - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - ] - ] . - -<#Execution> - rml:function idlab-fn:random . - -``` - -**Output** -``` - "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl deleted file mode 100644 index ff9e9cc..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - ] - ] . - -<#Execution> - rml:function idlab-fn:random . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/output.nq deleted file mode 100644 index a76f685..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/student.csv deleted file mode 100644 index cb323e9..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0001-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/README.md deleted file mode 100644 index 6fee2cd..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLFNMLTC0002-CSV - -**Title**: Function on object, 1 reference parameter - -**Description**: Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term) - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . - -``` - -**Output** -``` - "VENUS" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl deleted file mode 100644 index 381bac4..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/output.nq deleted file mode 100644 index d7e35a2..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/student.csv deleted file mode 100644 index cb323e9..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0002-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/README.md deleted file mode 100644 index 1452673..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLFNMLTC0003-CSV - -**Title**: Function on object, 1 reference parameter, the output termType is IRI - -**Description**: Tests if the output of the function is assigned the correct termType - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut ; - rml:termType rml:IRI - ]; - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" - ]; - ] . - -``` - -**Output** -``` - . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl deleted file mode 100644 index a553877..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut ; - rml:termType rml:IRI - ]; - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" - ]; - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/output.nq deleted file mode 100644 index 617e154..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/student.csv deleted file mode 100644 index 97c6fdd..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0003-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/README.md deleted file mode 100644 index 8c70fae..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/README.md +++ /dev/null @@ -1,64 +0,0 @@ -## RMLFNMLTC0004-CSV - -**Title**: Function on object, the output termType is Literal - -**Description**: Tests if the output of the function is assigned the correct termType - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:length ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . - -``` - -**Output** -``` - "5"^^ . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl deleted file mode 100644 index c17c958..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:length ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/output.nq deleted file mode 100644 index a0fb12b..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "5"^^ . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/student.csv deleted file mode 100644 index 5c20b3c..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0004-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/README.md deleted file mode 100644 index e82355d..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/README.md +++ /dev/null @@ -1,63 +0,0 @@ -## RMLFNMLTC0005-CSV - -**Title**: Function on object, 1 template parameter - -**Description**: Tests if a function with a template parameter can be used - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:template "Name: {Name}" ; - ]; - ] . - -``` - -**Output** -``` - "NAME: VENUS" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl deleted file mode 100644 index 91cca31..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:template "Name: {Name}" ; - ]; - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/output.nq deleted file mode 100644 index dc75d98..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "NAME: VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/student.csv deleted file mode 100644 index cb323e9..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0005-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/README.md deleted file mode 100644 index 5a62c8c..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/README.md +++ /dev/null @@ -1,69 +0,0 @@ -## RMLFNMLTC0007-CSV - -**Title**: Function on object returns empty string - -**Description**: Tests that a triple is generated when the results is an empty string. - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "5" - ] . - -``` - -**Output** -``` - "" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl deleted file mode 100644 index bac6b3e..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "5" - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/output.nq deleted file mode 100644 index 6629e02..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0007-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/README.md deleted file mode 100644 index 28181b3..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/README.md +++ /dev/null @@ -1,68 +0,0 @@ -## RMLFNMLTC0008-CSV - -**Title**: Function on object returns null - -**Description**: Tests that no triple should be generated when the result is null. - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1000" - ] . - -``` - -**Output** -``` - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl deleted file mode 100644 index b21a92f..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "1000" - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/output.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0008-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/README.md deleted file mode 100644 index bd59766..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/README.md +++ /dev/null @@ -1,64 +0,0 @@ -## RMLFNMLTC0011-CSV - -**Title**: Function on predicate, 1 parameter - -**Description**: Tests if a function can be used on a predicate - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicateMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - ]; - rml:object foaf:name; - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . - -``` - -**Output** -``` - . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl deleted file mode 100644 index 79e7738..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicateMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - ]; - rml:object foaf:name; - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "Name" - ]; - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/output.nq deleted file mode 100644 index 4210121..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/student.csv deleted file mode 100644 index cb323e9..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0011-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/README.md deleted file mode 100644 index 044f5c6..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/README.md +++ /dev/null @@ -1,67 +0,0 @@ -## RMLFNMLTC0021-CSV - -**Title**: Function on object, 1 reference parameter, 1 constant parameter - -**Description**: Tests if a function with multiple parameters can be used - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:escape ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Comment" - ] - ] , - [ - rml:parameter grel:modeParam ; - rml:inputValue "html" - ] . - -``` - -**Output** -``` - "A&B" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl deleted file mode 100644 index 63b9668..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/mapping.ttl +++ /dev/null @@ -1,41 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:escape ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Comment" - ] - ] , - [ - rml:parameter grel:modeParam ; - rml:inputValue "html" - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/output.nq deleted file mode 100644 index a51e1c4..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "A&B" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/student.csv deleted file mode 100644 index cb323e9..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0021-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/README.md deleted file mode 100644 index a146e87..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/README.md +++ /dev/null @@ -1,64 +0,0 @@ -## RMLFNMLTC0031-CSV - -**Title**: Function on subject, 1 parameter - -**Description**: Tests if -(1) a function can be used on a subject -(2) Tests if the default termType assigned to the output of the function to be correct - -**Error expected?** No - -**Input** -``` -Id,Name,url -1,Venus,www.example.com - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:reference "Name"] - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" - ]; - ] . - -``` - -**Output** -``` - "Venus" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl deleted file mode 100644 index 20cedd9..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ rml:reference "Name"] - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" - ]; - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/output.nq deleted file mode 100644 index 43ceda1..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/student.csv deleted file mode 100644 index ec72787..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0031-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,url -1,Venus,www.example.com diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/README.md deleted file mode 100644 index 69a77e1..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/README.md +++ /dev/null @@ -1,70 +0,0 @@ -## RMLFNMLTC0032-CSV - -**Title**: Condition on subject - -**Description**: Tests that a condition shortcut works - -**Error expected?** No - -**Input** -``` -Id,Name,Class -1,Venus,A -1,Serena,B - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ] ; - rml:subjectMap [ - rml:condition [ - rml:functionExecution [ - rml:function idlab-fn:equal ; - rml:input [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Class" - ] - ] , [ - rml:parameter grel:valueParam2 ; - rml:inputValue "A" ; - ] ; - ] ; - rml:return idlab-fn:_boolOut ; - ] ; - rml:template "http://example.com/{Name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate foaf:name ; - rml:objectMap [ - rml:reference "Name" ; - ] ; - ] ; -. - -``` - -**Output** -``` - "Venus" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl deleted file mode 100644 index 8c482d1..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ] ; - rml:subjectMap [ - rml:condition [ - rml:functionExecution [ - rml:function idlab-fn:equal ; - rml:input [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Class" - ] - ] , [ - rml:parameter grel:valueParam2 ; - rml:inputValue "A" ; - ] ; - ] ; - rml:return idlab-fn:_boolOut ; - ] ; - rml:template "http://example.com/{Name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate foaf:name ; - rml:objectMap [ - rml:reference "Name" ; - ] ; - ] ; -. diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/output.nq deleted file mode 100644 index efbb554..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/student.csv deleted file mode 100644 index 0154640..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0032-CSV/student.csv +++ /dev/null @@ -1,3 +0,0 @@ -Id,Name,Class -1,Venus,A -1,Serena,B diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/README.md deleted file mode 100644 index 0fd0431..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLFNMLTC0041-CSV - -**Title**: Function using non-constant shortcut property return - -**Description**: Tests that a non-constant FNML Return map also works - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:returnMap [ - rml:constant grel:stringOut - ] - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . - -``` - -**Output** -``` - "VENUS" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl deleted file mode 100644 index 3669cab..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:returnMap [ - rml:constant grel:stringOut - ] - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/output.nq deleted file mode 100644 index d7e35a2..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/student.csv deleted file mode 100644 index 97c6fdd..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0041-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/README.md deleted file mode 100644 index 510edf1..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/README.md +++ /dev/null @@ -1,88 +0,0 @@ -## RMLFNMLTC0051-CSV - -**Title**: Nested function - Test A - -**Description**: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function) - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,M Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - -<#Person_Mapping> - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap <#NameMapping> . - -<#NameMapping> - rml:predicate foaf:name ; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ]; . - -<#Execution> a rml:FunctionExecution ; - rml:function grel:toUpperCase ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:functionExecution <#Execution2> ; - rml:return grel:stringOut - ] - ] . - -<#Execution2> a rml:Execution ; - rml:function grel:string_replace ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ] - ] , - [ - a rml:Input ; - rml:parameter grel:param_find ; - rml:inputValue " " - ] , - [ - a rml:Input ; - rml:parameter grel:param_replace ; - rml:inputValue "-" - ] . - -``` - -**Output** -``` - "M-VENUS" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl deleted file mode 100644 index d23fd4d..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/mapping.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - -<#Person_Mapping> - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap <#NameMapping> . - -<#NameMapping> - rml:predicate foaf:name ; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ]; . - -<#Execution> a rml:FunctionExecution ; - rml:function grel:toUpperCase ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:functionExecution <#Execution2> ; - rml:return grel:stringOut - ] - ] . - -<#Execution2> a rml:Execution ; - rml:function grel:string_replace ; - rml:input - [ - a rml:Input ; - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" - ] - ] , - [ - a rml:Input ; - rml:parameter grel:param_find ; - rml:inputValue " " - ] , - [ - a rml:Input ; - rml:parameter grel:param_replace ; - rml:inputValue "-" - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/output.nq deleted file mode 100644 index 5e4ca54..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "M-VENUS" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/student.csv deleted file mode 100644 index adfc7a8..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0051-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,M Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/README.md deleted file mode 100644 index d101190..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/README.md +++ /dev/null @@ -1,69 +0,0 @@ -## RMLFNMLTC0061-CSV - -**Title**: Function on graph, 1 parameter - -**Description**: Tests if a function can be used on a graph - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" ; - rml:graphMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - - ] - ]; - - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:reference "Name" - ] - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" ; - ] - ] . - -``` - -**Output** -``` - "Venus" . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl deleted file mode 100644 index 7927ea4..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" ; - rml:graphMap [ - rml:functionExecution <#Execution> ; - rml:return idlab-fn:_stringOut - - ] - ]; - - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:reference "Name" - ] - ] . - -<#Execution> - rml:function idlab-fn:toUpperCaseURL ; - rml:input - [ - rml:parameter idlab-fn:str ; - rml:inputValueMap [ - rml:reference "url" ; - ] - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/output.nq deleted file mode 100644 index 47140dc..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus" . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/student.csv deleted file mode 100644 index 5c20b3c..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0061-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/README.md deleted file mode 100644 index 3af5a78..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/README.md +++ /dev/null @@ -1,72 +0,0 @@ -## RMLFNMLTC0071-CSV - -**Title**: Function on datatypeMap, 1 parameter - -**Description**: Tests that function on DatatypeMap is handled - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,Type -1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:reference "Name" ; - rml:datatypeMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Type" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "0" - ] . - -``` - -**Output** -``` - "Venus"^^ . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl deleted file mode 100644 index a78dcba..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:reference "Name" ; - rml:datatypeMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Type" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "0" - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/output.nq deleted file mode 100644 index d0740b6..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus"^^ . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/student.csv deleted file mode 100644 index d458891..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0071-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,Type -1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/README.md deleted file mode 100644 index c96d4b2..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/README.md +++ /dev/null @@ -1,72 +0,0 @@ -## RMLFNMLTC0081-CSV - -**Title**: Function on languageMap, 1 parameter - -**Description**: Tests that function on LanguageMap is handled - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,Lang -1,Venus,A&B,A,en - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:reference "Name" ; - rml:languageMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] ; - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Lang" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "0" - ] . - -``` - -**Output** -``` - "Venus"@en . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl deleted file mode 100644 index ef8573a..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:reference "Name" ; - rml:languageMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] ; - ] - ] . - -<#Execution> - rml:function grel:string_substring ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Lang" - ]; - ] , - [ - a rml:Input ; - rml:parameter grel:p_int_i_from ; - rml:inputValue "0" - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/output.nq deleted file mode 100644 index ec2e549..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/output.nq +++ /dev/null @@ -1 +0,0 @@ - "Venus"@en . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/student.csv deleted file mode 100644 index 56a4e2a..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0081-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,Lang -1,Venus,A&B,A,en diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/README.md deleted file mode 100644 index 1922b26..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/README.md +++ /dev/null @@ -1,58 +0,0 @@ -## RMLFNMLTC0101-CSV - -**Title**: Function on object, 1 false reference parameter - -**Description**: Tests if a false reference parameters is caught - -**Error expected?** Yes - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "name" ; - ] - ] . - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl deleted file mode 100644 index d7a024e..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . -@prefix idlab-fn: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/student.csv deleted file mode 100644 index cb323e9..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0101-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/README.md deleted file mode 100644 index f9c01cc..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/README.md +++ /dev/null @@ -1,62 +0,0 @@ -## RMLFNMLTC0102-CSV - -**Title**: Function on object, wrong function URI - -**Description**: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class -1,Venus,A&B,A - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:unknown_func ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . - -``` - -**Output** -``` - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl deleted file mode 100644 index a5978b6..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:unknown_func ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/output.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/student.csv deleted file mode 100644 index 052b991..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0102-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class -1,Venus,A&B,A diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/README.md deleted file mode 100644 index bfe7dd0..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/README.md +++ /dev/null @@ -1,62 +0,0 @@ -## RMLFNMLTC0103-CSV - -**Title**: Function on object, wrong parameter - -**Description**: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:unknownParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . - -``` - -**Output** -``` - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl deleted file mode 100644 index 96cca0c..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:stringOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:unknownParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/output.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/student.csv deleted file mode 100644 index 5c20b3c..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0103-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/README.md b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/README.md deleted file mode 100644 index 8a02a34..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/README.md +++ /dev/null @@ -1,62 +0,0 @@ -## RMLFNMLTC0104-CSV - -**Title**: Function on object, wrong return parameter - -**Description**: Tests that nothing is generated if a function is defined using a return not defined in the FnO description - -**Error expected?** No - -**Input** -``` -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus - -``` - -**Mapping** -``` -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:unknownOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . - -``` - -**Output** -``` - -``` - diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl deleted file mode 100644 index dd6c647..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix foaf: . -@prefix ex: . -@prefix xsd: . -@prefix rml: . -@prefix fno: . -@prefix grel: . - -@base . - - - rml:logicalSource [ - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "student.csv" - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example.com/{Name}" - ]; - rml:predicateObjectMap [ - rml:predicate foaf:name; - rml:objectMap [ - rml:functionExecution <#Execution> ; - rml:return grel:unknownOut - ] - ] . - -<#Execution> - rml:function grel:toUpperCase ; - rml:input - [ - rml:parameter grel:valueParam ; - rml:inputValueMap [ - rml:reference "Name" ; - ] - ] . diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/output.nq b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/output.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/student.csv b/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/student.csv deleted file mode 100644 index 5c20b3c..0000000 --- a/src/test/resources/rml-fnml/RMLFNMLTC0104-CSV/student.csv +++ /dev/null @@ -1,2 +0,0 @@ -Id,Name,Comment,Class,url -1,Venus,A&B,A,http://example.com/venus diff --git a/src/test/resources/rml-fnml/config.js b/src/test/resources/rml-fnml/config.js deleted file mode 100644 index 8427457..0000000 --- a/src/test/resources/rml-fnml/config.js +++ /dev/null @@ -1,93 +0,0 @@ -async function loadTurtle() { - //this is the function you call in 'preProcess', to load the highlighter - const worker = await new Promise(resolve => { - require(["core/worker"], ({ worker }) => resolve(worker)); - }); - const action = "highlight-load-lang"; - const langURL = - "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; - const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded - const lang = "turtle"; // this is the class you use to identify the language - worker.postMessage({ action, langURL, propName, lang }); - return new Promise(resolve => { - worker.addEventListener("message", function listener({ data }) { - const { action: responseAction, lang: responseLang } = data; - if (responseAction === action && responseLang === lang) { - worker.removeEventListener("message", listener); - resolve(); - } - }); - }); -} - -var respecConfig = { - // check https://respec.org/docs/ for the meaning of these keys - preProcess: [loadTurtle], - authors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - }, { - name: "Ben De Meester", - company: "Ghent University – imec – IDLab", - url: "https://ben.de-meester.org/#me", - orcid: "0000-0003-0248-0987", - companyURL: "https://knows.idlab.ugent.be/" - }, { - name: "Tobias Schweizer" - }, { - name: "Els de Vleeschauwer", - company: "Ghent University – imec – IDLab", - orcid: "0000-0002-8630-3947", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - edDraftURI: "https://w3id.org/rml/fnml/test-cases/", - editors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - }, - { - name: "Ben De Meester", - company: "Ghent University – imec – IDLab", - url: "https://ben.de-meester.org/#me", - orcid: "0000-0003-0248-0987", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - formerEditors: [ - ], - github: "https://github.com/kg-construct/rml-fnml", - license: "w3c-software-doc", - localBiblio: { - "RML-Core": { - title: "RML-Core", - href: "https://w3id.org/rml/core/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "07 August 2024", - }, - "RML-IO": { - title: "RML-IO", - href: "https://w3id.org/rml/io/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "12 March 2024", - }, - }, - otherLinks: [], - shortName: "RML-FNML-Testcases", - specStatus: "CG-DRAFT", - // W3C config - copyrightStart: "2024", - doJsonLd: true, - prevVersion: "https://kg-construct.github.io/rml-fnml/test-cases/docs/20250630/", - group: "kg-construct", -}; diff --git a/src/test/resources/rml-fnml/descriptions.csv b/src/test/resources/rml-fnml/descriptions.csv deleted file mode 100644 index a191582..0000000 --- a/src/test/resources/rml-fnml/descriptions.csv +++ /dev/null @@ -1,28 +0,0 @@ -ID,title,description,part of spec,data format,ref. formulation,error expected?,input file 1,input file 2,input file 3,comment -RMLFNMLTC0001-CSV,"Function on object, 0 parameters","Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term) -(3) if the output of the function is assigned the correct termType by default",,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0002-CSV,"Function on object, 1 reference parameter","Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term)",,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0003-CSV,"Function on object, 1 reference parameter, the output termType is IRI",Tests if the output of the function is assigned the correct termType,,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0004-CSV,"Function on object, the output termType is Literal",Tests if the output of the function is assigned the correct termType,,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0005-CSV,"Function on object, 1 template parameter",Tests if a function with a template parameter can be used,,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0007-CSV,Function on object returns empty string,Tests that a triple is generated when the results is an empty string.,,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0008-CSV,Function on object returns null,Tests that no triple should be generated when the result is null.,,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0011-CSV,"Function on predicate, 1 parameter",Tests if a function can be used on a predicate,,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0021-CSV,"Function on object, 1 reference parameter, 1 constant parameter",Tests if a function with multiple parameters can be used,,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0031-CSV,"Function on subject, 1 parameter","Tests if -(1) a function can be used on a subject -(2) Tests if the default termType assigned to the output of the function to be correct",,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0032-CSV,Condition on subject,Tests that a condition shortcut works,,,,,,,, -RMLFNMLTC0041-CSV,Function using non-constant shortcut property return,Tests that a non-constant FNML Return map also works,,CSV,CSV,FALSE,student.csv,,,"does this can be tested with SHACL? If yes, I think this wouldn't be a test-case" -RMLFNMLTC0051-CSV,Nested function - Test A,"Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)",,CSV,CSV,FALSE,student.csv,,, -RMLFNMLTC0061-CSV,"Function on graph, 1 parameter",Tests if a function can be used on a graph,,CSV,CSV,FALSE,student.csv,,,RML example: https://kg-construct.github.io/rml-core/spec/docs/#example-graph-map -RMLFNMLTC0071-CSV,"Function on datatypeMap, 1 parameter",Tests that function on DatatypeMap is handled,,CSV,CSV,FALSE,student.csv,,,RML example: https://kg-construct.github.io/rml-core/spec/docs/#example-datatype-map -RMLFNMLTC0081-CSV,"Function on languageMap, 1 parameter",Tests that function on LanguageMap is handled,,CSV,CSV,FALSE,student.csv,,,RML example: https://kg-construct.github.io/rml-core/spec/docs/#example-language-map -RMLFNMLTC0101-CSV,"Function on object, 1 false reference parameter",Tests if a false reference parameters is caught,,CSV,CSV,TRUE,student.csv,,, -RMLFNMLTC0102-CSV,"Function on object, wrong function URI",Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine,,CSV,CSV,TRUE,student.csv,,, -RMLFNMLTC0103-CSV,"Function on object, wrong parameter",Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description,,CSV,CSV,TRUE,student.csv,,, -RMLFNMLTC0104-CSV,"Function on object, wrong return parameter",Tests that nothing is generated if a function is defined using a return not defined in the FnO description,,CSV,CSV,TRUE,student.csv,,, \ No newline at end of file diff --git a/src/test/resources/rml-fnml/dev.html b/src/test/resources/rml-fnml/dev.html deleted file mode 100644 index 1b2422a..0000000 --- a/src/test/resources/rml-fnml/dev.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - RML-FNML: Test Cases - - - - - - - - - - -
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - diff --git a/src/test/resources/rml-fnml/docs/20250130/index.html b/src/test/resources/rml-fnml/docs/20250130/index.html deleted file mode 100644 index f66c763..0000000 --- a/src/test/resources/rml-fnml/docs/20250130/index.html +++ /dev/null @@ -1,1325 +0,0 @@ - - - - - - -RML-FNML: Test Cases - - - - - - - - - - - - - - -
- -

RML-FNML: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-FNML-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/fnml/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-fnml - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-FNML test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLFNOTC0000b-CSV

-

Title: Function on object, default termType

-

Description: Tests if the output of the function is assigned the correct termType by default

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix fns: <http://example.com/functions/> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function fns:helloworld .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Hello World!" .
-
-
-

5. RMLFNOTC0000-CSV

-

Title: Function on object, 0 parameters

-

Description: Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function morph-kgc:uuid .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
-
-
-

6. RMLFNOTC0001-CSV

-

Title: Function on object, 1 reference parameter

-

Description: Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

7. RMLFNOTC0002-CSV

-

Title: Function using non-constant shortcut property parameter

-

Description: Tests that a non-constant FNML Parameter map also works

-

Error expected? Yes

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "name" ;
-            ]
-        ] .
-
-
-

8. RMLFNOTC0003-CSV

-

Title: Function on object, 1 false reference parameter

-

Description: Tests if a false reference parameters is caught

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:escape ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Comment"
-            ]
-        ] ,
-        [
-            rml:parameter grel:modeParam  ;
-            rml:inputValue "html"
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
-
-
-

9. RMLFNOTC0004b-CSV

-

Title: Function on predicate, 1 parameter

-

Description: Tests if a function can be used on a predicate

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix fns: <http://example.com/functions/> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicateMap [
-            rml:functionExecution <#Execution> ;
-        ];
-        rml:object foaf:name;
-    ] .
-
-<#Execution>
-    rml:function fns:schema ;
-    rml:input
-        [
-            rml:parameter fns:stringParameter ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <https://schema.org/Venus> <http://xmlns.com/foaf/0.1/name> .
-
-
-

10. RMLFNOTC0004-CSV

-

Title: Function on object, 1 reference parameter, 1 constant parameter

-

Description: Tests if a function with multiple parameters can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicateMap [
-            rml:functionExecution <#Execution> ;
-        ];
-        rml:object foaf:name;
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
-
-
-

11. RMLFNOTC0005b-CSV

-

Title: Function on subject, default termType

-

Description: Tests if the default termType assigned to the output of the function to be correct

-

Error expected? No

-

Input

-
Id,Name,url
-1,Venus,www.example.com
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix fns: <http://example.com/functions/> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:functionExecution <#Execution> ;
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [ rml:reference "Name"]
-    ] .
-
-<#Execution>
-    rml:function fns:schema ;
-    rml:input
-        [
-            rml:parameter fns:stringParameter ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<https://schema.org/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

12. RMLFNOTC0005-CSV

-

Title: Function on subject, 1 parameter

-

Description: Tests if a function can be used on a subject

-

Error expected? No

-

Input

-
Id,Name,url
-1,Venus,www.example.com
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:functionExecution <#Execution> ;
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [ rml:reference "Name"]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

13. RMLFNOTC0006b-CSV

-

Title: Function on object, 1 template parameter

-

Description: Tests if a function with a template parameter can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix fns: <http://example.com/functions/> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:termType rml:IRI
-        ];
-    ] .
-
-<#Execution>
-    rml:function fns:schema ;
-    rml:input
-        [
-            rml:parameter fns:stringParameter ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <https://schema.org/Venus> .
-
-
-

14. RMLFNOTC0006-CSV

-

Title: Function on object, the output termType is IRI

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:termType rml:IRI
-        ];
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

15. RMLFNOTC0008-CSV

-

Title: Nested function - Test A

-

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [ rml:functionExecution <#Execution> ] ;
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:template "Name: {Name}"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
-
-
-

16. RMLFNOTC0009-CSV

-

Title: Function on object, 1 constant parameter

-

Description: Tests if a constant parameter can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,M Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<#Person_Mapping>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap <#NameMapping> .
-
-<#NameMapping>
-    rml:predicate foaf:name ;
-    rml:objectMap [
-        rml:functionExecution <#Execution> ;
-    ]; .
-
-<#Execution> a rml:FunctionExecution ;
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:functionExecution <#Execution2> ;
-                rml:return grel:stringOut
-            ]
-        ] .
-
-<#Execution2> a rml:Execution ;
-    rml:function grel:string_replace ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ]
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_find ;
-            rml:inputValue " "
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_replace  ;
-            rml:inputValue "-"
-        ] .
-
-

Output

-
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
-
-
-

17. RMLFNOTC0010-CSV

-

Title: Function on object, wrong type parameter

-

Description: Tests a function with a wrong type parameter cannot be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix fns: <http://example.com/functions/> .
-@prefix morph-kgc: <https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <http://example.com/idlab/function/> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:returnMap [
-                rml:constant fns:domainOutput
-            ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function fns:parseURL ;
-    rml:input
-        [
-            rml:parameter fns:stringParameter ;
-            rml:inputValueMap [
-                rml:reference "url" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "example.com" .
-
-
- - - - - diff --git a/src/test/resources/rml-fnml/docs/20250303/index.html b/src/test/resources/rml-fnml/docs/20250303/index.html deleted file mode 100644 index c5504b9..0000000 --- a/src/test/resources/rml-fnml/docs/20250303/index.html +++ /dev/null @@ -1,1496 +0,0 @@ - - - - - - -RML-FNML: Test Cases - - - - - - - - - - - - - - -
- -

RML-FNML: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-FNML-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/fnml/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-fnml - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-FNML test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLFNMLTC0001-CSV

-

Title: Function on object, 0 parameters

-

Description: Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term) -(3) if the output of the function is assigned the correct termType by default

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:random .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
-
-
-

5. RMLFNMLTC0002-CSV

-

Title: Function on object, 1 reference parameter

-

Description: Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

6. RMLFNMLTC0003-CSV

-

Title: Function on object, 1 reference parameter, the output termType is IRI

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut ;
-            rml:termType rml:IRI
-        ];
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

7. RMLFNMLTC0004-CSV

-

Title: Function on object, the output termType is Literal

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:length ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLFNMLTC0005-CSV

-

Title: Function on object, 1 template parameter

-

Description: Tests if a function with a template parameter can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:template "Name: {Name}" ;
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
-
-
-

9. RMLFNMLTC0007-CSV

-

Title: Function on object returns empty string

-

Description: Tests that a triple is generated when the results is an empty string.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "5"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
-
-
-

10. RMLFNMLTC0008-CSV

-

Title: Function on object returns null

-

Description: Tests that no triple should be generated when the result is null.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "1000"
-        ]  .
-
-

Output

-

-
-
-

11. RMLFNMLTC0011-CSV

-

Title: Function on predicate, 1 parameter

-

Description: Tests if a function can be used on a predicate

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicateMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ];
-        rml:object foaf:name;
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
-
-
-

12. RMLFNMLTC0021-CSV

-

Title: Function on object, 1 reference parameter, 1 constant parameter

-

Description: Tests if a function with multiple parameters can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:escape ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Comment"
-            ]
-        ] ,
-        [
-            rml:parameter grel:modeParam  ;
-            rml:inputValue "html"
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
-
-
-

13. RMLFNMLTC0031-CSV

-

Title: Function on subject, 1 parameter

-

Description: Tests if -(1) a function can be used on a subject -(2) Tests if the default termType assigned to the output of the function to be correct

-

Error expected? No

-

Input

-
Id,Name,url
-1,Venus,www.example.com
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return idlab-fn:_stringOut
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [ rml:reference "Name"]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

14. RMLFNMLTC0041-CSV

-

Title: Function using non-constant shortcut property return

-

Description: Tests that a non-constant FNML Return map also works

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:returnMap [
-                rml:constant grel:stringOut
-            ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "example.com" .
-
-
-

15. RMLFNMLTC0051-CSV

-

Title: Nested function - Test A

-

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,M Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<#Person_Mapping>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap <#NameMapping> .
-
-<#NameMapping>
-    rml:predicate foaf:name ;
-    rml:objectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return grel:stringOut
-    ]; .
-
-<#Execution> a rml:FunctionExecution ;
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:functionExecution <#Execution2> ;
-                rml:return grel:stringOut
-            ]
-        ] .
-
-<#Execution2> a rml:Execution ;
-    rml:function grel:string_replace ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ]
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_find ;
-            rml:inputValue " "
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_replace  ;
-            rml:inputValue "-"
-        ] .
-
-

Output

-
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
-
-
-

16. RMLFNMLTC0061-CSV

-

Title: Function on graph, 1 parameter

-

Description: Tests if a function can be used on a graph

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}" ;
-        rml:graphMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-            
-        ]
-    ];
-
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:reference "Name"
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

17. RMLFNMLTC0101-CSV

-

Title: Function on object, 1 false reference parameter

-

Description: Tests if a false reference parameters is caught

-

Error expected? Yes

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "name" ;
-            ]
-        ] .
-
-
-

18. RMLFNMLTC0102-CSV

-

Title: Function on object, wrong function URI

-

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:unknown_func ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

19. RMLFNMLTC0103-CSV

-

Title: Function on object, wrong parameter

-

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:unknownParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

20. RMLFNMLTC0104-CSV

-

Title: Function on object, wrong return parameter

-

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:unknownOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-fnml/docs/20250630/index.html b/src/test/resources/rml-fnml/docs/20250630/index.html deleted file mode 100644 index 67b0889..0000000 --- a/src/test/resources/rml-fnml/docs/20250630/index.html +++ /dev/null @@ -1,1768 +0,0 @@ - - - - - - -RML-FNML: Test Cases - - - - - - - - - - - - - - - -
- -

RML-FNML: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-FNML-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/fnml/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-fnml - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-FNML test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLFNMLTC0001-CSV

-

Title: Function on object, 0 parameters

-

Description: Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term) -(3) if the output of the function is assigned the correct termType by default

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:random .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
-
-
-

5. RMLFNMLTC0002-CSV

-

Title: Function on object, 1 reference parameter

-

Description: Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

6. RMLFNMLTC0003-CSV

-

Title: Function on object, 1 reference parameter, the output termType is IRI

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut ;
-            rml:termType rml:IRI
-        ];
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

7. RMLFNMLTC0004-CSV

-

Title: Function on object, the output termType is Literal

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:length ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLFNMLTC0005-CSV

-

Title: Function on object, 1 template parameter

-

Description: Tests if a function with a template parameter can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:template "Name: {Name}" ;
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
-
-
-

9. RMLFNMLTC0007-CSV

-

Title: Function on object returns empty string

-

Description: Tests that a triple is generated when the results is an empty string.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "5"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
-
-
-

10. RMLFNMLTC0008-CSV

-

Title: Function on object returns null

-

Description: Tests that no triple should be generated when the result is null.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "1000"
-        ]  .
-
-

Output

-

-
-
-

11. RMLFNMLTC0011-CSV

-

Title: Function on predicate, 1 parameter

-

Description: Tests if a function can be used on a predicate

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicateMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ];
-        rml:object foaf:name;
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
-
-
-

12. RMLFNMLTC0021-CSV

-

Title: Function on object, 1 reference parameter, 1 constant parameter

-

Description: Tests if a function with multiple parameters can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:escape ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Comment"
-            ]
-        ] ,
-        [
-            rml:parameter grel:modeParam  ;
-            rml:inputValue "html"
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
-
-
-

13. RMLFNMLTC0031-CSV

-

Title: Function on subject, 1 parameter

-

Description: Tests if -(1) a function can be used on a subject -(2) Tests if the default termType assigned to the output of the function to be correct

-

Error expected? No

-

Input

-
Id,Name,url
-1,Venus,www.example.com
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return idlab-fn:_stringOut
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [ rml:reference "Name"]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

14. RMLFNMLTC0041-CSV

-

Title: Function using non-constant shortcut property return

-

Description: Tests that a non-constant FNML Return map also works

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:returnMap [
-                rml:constant grel:stringOut
-            ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

15. RMLFNMLTC0051-CSV

-

Title: Nested function - Test A

-

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,M Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<#Person_Mapping>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap <#NameMapping> .
-
-<#NameMapping>
-    rml:predicate foaf:name ;
-    rml:objectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return grel:stringOut
-    ]; .
-
-<#Execution> a rml:FunctionExecution ;
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:functionExecution <#Execution2> ;
-                rml:return grel:stringOut
-            ]
-        ] .
-
-<#Execution2> a rml:Execution ;
-    rml:function grel:string_replace ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ]
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_find ;
-            rml:inputValue " "
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_replace  ;
-            rml:inputValue "-"
-        ] .
-
-

Output

-
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
-
-
-

16. RMLFNMLTC0061-CSV

-

Title: Function on graph, 1 parameter

-

Description: Tests if a function can be used on a graph

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}" ;
-        rml:graphMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-            
-        ]
-    ];
-
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:reference "Name"
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

17. RMLFNMLTC0071-CSV

-

Title: Function on datatypeMap, 1 parameter

-

Description: Tests that function on DatatypeMap is handled

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,Type
-1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-           rml:reference "Name" ;
-           rml:datatypeMap [
-             rml:functionExecution <#Execution> ;
-             rml:return grel:stringOut
-           ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Type"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "0"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-
-
-

18. RMLFNMLTC0081-CSV

-

Title: Function on languageMap, 1 parameter

-

Description: Tests that function on LanguageMap is handled

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,Lang
-1,Venus,A&B,A,en
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-           rml:reference "Name" ;
-           rml:languageMap [
-             rml:functionExecution <#Execution> ;
-             rml:return grel:stringOut
-           ] ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Lang"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "0"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"@en .
-
-
-

19. RMLFNMLTC0101-CSV

-

Title: Function on object, 1 false reference parameter

-

Description: Tests if a false reference parameters is caught

-

Error expected? Yes

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "name" ;
-            ]
-        ] .
-
-
-

20. RMLFNMLTC0102-CSV

-

Title: Function on object, wrong function URI

-

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:unknown_func ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

21. RMLFNMLTC0103-CSV

-

Title: Function on object, wrong parameter

-

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:unknownParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

22. RMLFNMLTC0104-CSV

-

Title: Function on object, wrong return parameter

-

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:unknownOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-fnml/docs/20250806/index.html b/src/test/resources/rml-fnml/docs/20250806/index.html deleted file mode 100644 index f939ec5..0000000 --- a/src/test/resources/rml-fnml/docs/20250806/index.html +++ /dev/null @@ -1,1865 +0,0 @@ - - - - - - -RML-FNML: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-FNML test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLFNMLTC0001-CSV

-

Title: Function on object, 0 parameters

-

Description: Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term) -(3) if the output of the function is assigned the correct termType by default

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:random .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
-
-
-

5. RMLFNMLTC0002-CSV

-

Title: Function on object, 1 reference parameter

-

Description: Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

6. RMLFNMLTC0003-CSV

-

Title: Function on object, 1 reference parameter, the output termType is IRI

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut ;
-            rml:termType rml:IRI
-        ];
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

7. RMLFNMLTC0004-CSV

-

Title: Function on object, the output termType is Literal

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:length ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLFNMLTC0005-CSV

-

Title: Function on object, 1 template parameter

-

Description: Tests if a function with a template parameter can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:template "Name: {Name}" ;
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
-
-
-

9. RMLFNMLTC0007-CSV

-

Title: Function on object returns empty string

-

Description: Tests that a triple is generated when the results is an empty string.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "5"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
-
-
-

10. RMLFNMLTC0008-CSV

-

Title: Function on object returns null

-

Description: Tests that no triple should be generated when the result is null.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "1000"
-        ]  .
-
-

Output

-

-
-
-

11. RMLFNMLTC0011-CSV

-

Title: Function on predicate, 1 parameter

-

Description: Tests if a function can be used on a predicate

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicateMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ];
-        rml:object foaf:name;
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
-
-
-

12. RMLFNMLTC0021-CSV

-

Title: Function on object, 1 reference parameter, 1 constant parameter

-

Description: Tests if a function with multiple parameters can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:escape ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Comment"
-            ]
-        ] ,
-        [
-            rml:parameter grel:modeParam  ;
-            rml:inputValue "html"
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
-
-
-

13. RMLFNMLTC0031-CSV

-

Title: Function on subject, 1 parameter

-

Description: Tests if -(1) a function can be used on a subject -(2) Tests if the default termType assigned to the output of the function to be correct

-

Error expected? No

-

Input

-
Id,Name,url
-1,Venus,www.example.com
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return idlab-fn:_stringOut
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [ rml:reference "Name"]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

14. RMLFNMLTC0032-CSV

-

Title: Condition on subject

-

Description: Tests that a condition shortcut works

-

Error expected? No

-

Input

-
Id,Name,Class
-1,Venus,A
-1,Serena,B
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ] ;
-    rml:subjectMap [
-        rml:condition [
-            rml:functionExecution [
-                rml:function idlab-fn:equal ;
-                rml:input [
-                    rml:parameter grel:valueParam ;
-                    rml:inputValueMap [
-                        rml:reference "Class"
-                    ]
-                ] , [
-                    rml:parameter grel:valueParam2 ;
-                    rml:inputValue "A" ;
-                ] ;
-            ] ;
-            rml:return idlab-fn:_boolOut ;
-        ] ;
-        rml:template "http://example.com/{Name}" ;
-    ] ;
-    rml:predicateObjectMap [
-        rml:predicate foaf:name ;
-        rml:objectMap [
-            rml:reference "Name" ;
-        ] ;
-    ] ;
-.
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

15. RMLFNMLTC0041-CSV

-

Title: Function using non-constant shortcut property return

-

Description: Tests that a non-constant FNML Return map also works

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:returnMap [
-                rml:constant grel:stringOut
-            ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

16. RMLFNMLTC0051-CSV

-

Title: Nested function - Test A

-

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,M Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<#Person_Mapping>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap <#NameMapping> .
-
-<#NameMapping>
-    rml:predicate foaf:name ;
-    rml:objectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return grel:stringOut
-    ]; .
-
-<#Execution> a rml:FunctionExecution ;
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:functionExecution <#Execution2> ;
-                rml:return grel:stringOut
-            ]
-        ] .
-
-<#Execution2> a rml:Execution ;
-    rml:function grel:string_replace ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ]
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_find ;
-            rml:inputValue " "
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_replace  ;
-            rml:inputValue "-"
-        ] .
-
-

Output

-
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
-
-
-

17. RMLFNMLTC0061-CSV

-

Title: Function on graph, 1 parameter

-

Description: Tests if a function can be used on a graph

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}" ;
-        rml:graphMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-            
-        ]
-    ];
-
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:reference "Name"
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

18. RMLFNMLTC0071-CSV

-

Title: Function on datatypeMap, 1 parameter

-

Description: Tests that function on DatatypeMap is handled

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,Type
-1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-           rml:reference "Name" ;
-           rml:datatypeMap [
-             rml:functionExecution <#Execution> ;
-             rml:return grel:stringOut
-           ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Type"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "0"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-
-
-

19. RMLFNMLTC0081-CSV

-

Title: Function on languageMap, 1 parameter

-

Description: Tests that function on LanguageMap is handled

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,Lang
-1,Venus,A&B,A,en
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-           rml:reference "Name" ;
-           rml:languageMap [
-             rml:functionExecution <#Execution> ;
-             rml:return grel:stringOut
-           ] ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Lang"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "0"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"@en .
-
-
-

20. RMLFNMLTC0101-CSV

-

Title: Function on object, 1 false reference parameter

-

Description: Tests if a false reference parameters is caught

-

Error expected? Yes

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "name" ;
-            ]
-        ] .
-
-
-

21. RMLFNMLTC0102-CSV

-

Title: Function on object, wrong function URI

-

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:unknown_func ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

22. RMLFNMLTC0103-CSV

-

Title: Function on object, wrong parameter

-

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:unknownParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

23. RMLFNMLTC0104-CSV

-

Title: Function on object, wrong return parameter

-

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:unknownOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
- - - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-fnml/docs/index.html b/src/test/resources/rml-fnml/docs/index.html deleted file mode 100644 index f939ec5..0000000 --- a/src/test/resources/rml-fnml/docs/index.html +++ /dev/null @@ -1,1865 +0,0 @@ - - - - - - -RML-FNML: Test Cases - - - - - - - - - - - - - - - - - - - -

Abstract

This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-FNML test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLFNMLTC0001-CSV

-

Title: Function on object, 0 parameters

-

Description: Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term) -(3) if the output of the function is assigned the correct termType by default

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:random .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "e4dcc7ee-8e2a-4012-92cc-9a74dd545e89" .
-
-
-

5. RMLFNMLTC0002-CSV

-

Title: Function on object, 1 reference parameter

-

Description: Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

6. RMLFNMLTC0003-CSV

-

Title: Function on object, 1 reference parameter, the output termType is IRI

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut ;
-            rml:termType rml:IRI
-        ];
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

7. RMLFNMLTC0004-CSV

-

Title: Function on object, the output termType is Literal

-

Description: Tests if the output of the function is assigned the correct termType

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:length ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "5"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLFNMLTC0005-CSV

-

Title: Function on object, 1 template parameter

-

Description: Tests if a function with a template parameter can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:template "Name: {Name}" ;
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "NAME: VENUS" .
-
-
-

9. RMLFNMLTC0007-CSV

-

Title: Function on object returns empty string

-

Description: Tests that a triple is generated when the results is an empty string.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "5"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "" .
-
-
-

10. RMLFNMLTC0008-CSV

-

Title: Function on object returns null

-

Description: Tests that no triple should be generated when the result is null.

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "1000"
-        ]  .
-
-

Output

-

-
-
-

11. RMLFNMLTC0011-CSV

-

Title: Function on predicate, 1 parameter

-

Description: Tests if a function can be used on a predicate

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicateMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-        ];
-        rml:object foaf:name;
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ];
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://VENUS> <http://xmlns.com/foaf/0.1/name> .
-
-
-

12. RMLFNMLTC0021-CSV

-

Title: Function on object, 1 reference parameter, 1 constant parameter

-

Description: Tests if a function with multiple parameters can be used

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:escape ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Comment"
-            ]
-        ] ,
-        [
-            rml:parameter grel:modeParam  ;
-            rml:inputValue "html"
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "A&B" .
-
-
-

13. RMLFNMLTC0031-CSV

-

Title: Function on subject, 1 parameter

-

Description: Tests if -(1) a function can be used on a subject -(2) Tests if the default termType assigned to the output of the function to be correct

-

Error expected? No

-

Input

-
Id,Name,url
-1,Venus,www.example.com
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return idlab-fn:_stringOut
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [ rml:reference "Name"]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url"
-            ];
-        ] .
-
-

Output

-
<http://WWW.EXAMPLE.COM> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

14. RMLFNMLTC0032-CSV

-

Title: Condition on subject

-

Description: Tests that a condition shortcut works

-

Error expected? No

-

Input

-
Id,Name,Class
-1,Venus,A
-1,Serena,B
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ] ;
-    rml:subjectMap [
-        rml:condition [
-            rml:functionExecution [
-                rml:function idlab-fn:equal ;
-                rml:input [
-                    rml:parameter grel:valueParam ;
-                    rml:inputValueMap [
-                        rml:reference "Class"
-                    ]
-                ] , [
-                    rml:parameter grel:valueParam2 ;
-                    rml:inputValue "A" ;
-                ] ;
-            ] ;
-            rml:return idlab-fn:_boolOut ;
-        ] ;
-        rml:template "http://example.com/{Name}" ;
-    ] ;
-    rml:predicateObjectMap [
-        rml:predicate foaf:name ;
-        rml:objectMap [
-            rml:reference "Name" ;
-        ] ;
-    ] ;
-.
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" .
-
-
-

15. RMLFNMLTC0041-CSV

-

Title: Function using non-constant shortcut property return

-

Description: Tests that a non-constant FNML Return map also works

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:returnMap [
-                rml:constant grel:stringOut
-            ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "VENUS" .
-
-
-

16. RMLFNMLTC0051-CSV

-

Title: Nested function - Test A

-

Description: Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,M Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<#Person_Mapping>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap <#NameMapping> .
-
-<#NameMapping>
-    rml:predicate foaf:name ;
-    rml:objectMap [
-        rml:functionExecution <#Execution> ;
-        rml:return grel:stringOut
-    ]; .
-
-<#Execution> a rml:FunctionExecution ;
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:functionExecution <#Execution2> ;
-                rml:return grel:stringOut
-            ]
-        ] .
-
-<#Execution2> a rml:Execution ;
-    rml:function grel:string_replace ;
-    rml:input
-        [
-            a rml:Input ;
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name"
-            ]
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_find ;
-            rml:inputValue " "
-        ] ,
-        [
-            a rml:Input ;
-            rml:parameter grel:param_replace  ;
-            rml:inputValue "-"
-        ] .
-
-

Output

-
<http://example.com/M%20Venus> <http://xmlns.com/foaf/0.1/name> "M-VENUS" .
-
-
-

17. RMLFNMLTC0061-CSV

-

Title: Function on graph, 1 parameter

-

Description: Tests if a function can be used on a graph

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}" ;
-        rml:graphMap [
-            rml:functionExecution <#Execution> ;
-            rml:return idlab-fn:_stringOut
-            
-        ]
-    ];
-
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:reference "Name"
-        ]
-    ] .
-
-<#Execution>
-    rml:function idlab-fn:toUpperCaseURL ;
-    rml:input
-        [
-            rml:parameter idlab-fn:str ;
-            rml:inputValueMap [
-                rml:reference "url" ;
-            ]
-        ] .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus" <HTTP://EXAMPLE.COM/VENUS> .
-
-
-

18. RMLFNMLTC0071-CSV

-

Title: Function on datatypeMap, 1 parameter

-

Description: Tests that function on DatatypeMap is handled

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,Type
-1,Venus,A&B,A,http://www.w3.org/2001/XMLSchema#string
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-           rml:reference "Name" ;
-           rml:datatypeMap [
-             rml:functionExecution <#Execution> ;
-             rml:return grel:stringOut
-           ]
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Type"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "0"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"^^<http://www.w3.org/2001/XMLSchema#string> .
-
-
-

19. RMLFNMLTC0081-CSV

-

Title: Function on languageMap, 1 parameter

-

Description: Tests that function on LanguageMap is handled

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,Lang
-1,Venus,A&B,A,en
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-           rml:reference "Name" ;
-           rml:languageMap [
-             rml:functionExecution <#Execution> ;
-             rml:return grel:stringOut
-           ] ;
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:string_substring ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Lang"
-            ];
-        ]  ,
-        [
-            a rml:Input ;
-            rml:parameter grel:p_int_i_from ;
-            rml:inputValue "0"
-        ]  .
-
-

Output

-
<http://example.com/Venus> <http://xmlns.com/foaf/0.1/name> "Venus"@en .
-
-
-

20. RMLFNMLTC0101-CSV

-

Title: Function on object, 1 false reference parameter

-

Description: Tests if a false reference parameters is caught

-

Error expected? Yes

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-@prefix idlab-fn: <https://w3id.org/imec/idlab/function#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "name" ;
-            ]
-        ] .
-
-
-

21. RMLFNMLTC0102-CSV

-

Title: Function on object, wrong function URI

-

Description: Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine

-

Error expected? No

-

Input

-
Id,Name,Comment,Class
-1,Venus,A&B,A
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:unknown_func ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

22. RMLFNMLTC0103-CSV

-

Title: Function on object, wrong parameter

-

Description: Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:stringOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:unknownParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
-

23. RMLFNMLTC0104-CSV

-

Title: Function on object, wrong return parameter

-

Description: Tests that nothing is generated if a function is defined using a return not defined in the FnO description

-

Error expected? No

-

Input

-
Id,Name,Comment,Class,url
-1,Venus,A&B,A,http://example.com/venus
-
-

Mapping

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.com/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix fno: <https://w3id.org/function/ontology#> .
-@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .
-
-@base <http://example.com/base/> .
-
-<TriplesMap1>
-    rml:logicalSource [
-        rml:source [ a rml:RelativePathSource;
-          rml:root rml:MappingDirectory;
-          rml:path "student.csv"
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example.com/{Name}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate foaf:name;
-        rml:objectMap [
-            rml:functionExecution <#Execution> ;
-            rml:return grel:unknownOut
-        ]
-    ] .
-
-<#Execution>
-    rml:function grel:toUpperCase ;
-    rml:input
-        [
-            rml:parameter grel:valueParam ;
-            rml:inputValueMap [
-                rml:reference "Name" ;
-            ]
-        ] .
-
-

Output

-

-
-
- - - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-fnml/functions.ttl b/src/test/resources/rml-fnml/functions.ttl deleted file mode 100644 index d3ddd8b..0000000 --- a/src/test/resources/rml-fnml/functions.ttl +++ /dev/null @@ -1,102 +0,0 @@ -@prefix dcterms: . -@prefix fno: . -@prefix fns: . -@prefix grel: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . - -grel:toUpperCase - a fno:Function ; - fno:name "to Uppercase" ; - rdfs:label "to Uppercase" ; - dcterms:description "Returns the input with all letters in upper case." ; - fno:expects ( grel:valueParam ) ; - fno:returns ( grel:stringOut ) . - -grel:valueParam - a fno:Parameter ; - fno:name "input value" ; - rdfs:label "input value" ; - fno:predicate grel:valueParameter ; - fno:type xsd:string ; - fno:required "true"^^xsd:boolean . - -grel:stringOut - a fno:Output ; - fno:name "output string" ; - rdfs:label "output string" ; - fno:predicate grel:stringOutput ; - fno:type xsd:string . - -grel:string_replace - a fno:Function ; - fno:name "replace" ; - dcterms:description "replace" ; - fno:expects ( grel:valueParam grel:param_find grel:param_replace ) ; - fno:returns ( grel:stringOut ) . - -grel:param_find - a fno:Parameter ; - fno:name "f" ; - rdfs:label "f" ; - fno:predicate grel:p_string_find ; - fno:type xsd:string ; - fno:required "true"^^xsd:boolean . - -grel:param_replace - a fno:Parameter ; - fno:name "r" ; - rdfs:label "r" ; - fno:predicate grel:p_string_replace ; - fno:type xsd:string ; - fno:required "true"^^xsd:boolean . - -fns:helloworld - a fno:Function ; - fno:name "hello world" ; - dcterms:description "The hello world function has no parameters and always returns the string 'Hello World!'" ; - fno:expects ( ) ; - fno:returns ( fns:stringOutput ) . - -fns:stringOutput - a fno:Output ; - fno:name "output string" ; - rdfs:label "output string" ; - fno:predicate fns:hasStringOutput ; - fno:type xsd:string . - -fns:schema - a fno:Function ; - fno:name "schema term generator" ; - dcterms:description "The schema term generator function returns a string of the form 'https://schema.org/{stringParameter}'" ; - fno:expects ( fns:stringParameter ) ; - fno:returns ( fns:stringOutput ) . - -fns:stringParameter - a fno:Parameter ; - fno:name "input string" ; - rdfs:label "input string" ; - fno:predicate fns:hasStringParameter ; - fno:type xsd:string . - -fns:parseURL - a fno:Function ; - fno:name "parse URL" ; - dcterms:description "The parse URL function returns the protocol, domain, and path as strings of a URL of the form '{protocolOutput}://{domainOutput}/{stringOutput}'" ; - fno:expects ( fns:stringParameter ) ; - fno:returns ( fns:protocolOutput fns:domainOutput fns:stringOutput ) . - -fns:protocolOutput - a fno:Output ; - fno:name "protocol output string" ; - rdfs:label "protocol output string" ; - fno:predicate fns:hasProtocolOutput ; - fno:type xsd:string . - -fns:domainOutput - a fno:Output ; - fno:name "domain output string" ; - rdfs:label "domain output string" ; - fno:predicate fns:hasDomainOutput ; - fno:type xsd:string . diff --git a/src/test/resources/rml-fnml/list.sh b/src/test/resources/rml-fnml/list.sh deleted file mode 100755 index 12c3203..0000000 --- a/src/test/resources/rml-fnml/list.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -for i in RML*; do - echo "
" -done diff --git a/src/test/resources/rml-fnml/make-metadata.py b/src/test/resources/rml-fnml/make-metadata.py deleted file mode 100755 index 4e42105..0000000 --- a/src/test/resources/rml-fnml/make-metadata.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import glob -import csv - -def get_title_description(testcase: str): - with open ('descriptions.csv') as csvfile: - reader = csv.reader(csvfile) - for row in reader: - if row[0] == testcase: - return row[1], row[2] - -def main(spec: str): - with open ('metadata.csv', 'w', newline='') as csvfile: - writer = csv.writer(csvfile) - writer.writerow(['ID', 'title', 'description', 'specification', - 'mapping', 'input_format1', 'input_format2', - 'input_format3', 'output_format1', 'output_format2', - 'output_format3', 'input1', 'input2', 'input3', - 'output1', 'output2', 'output3', 'error']) - for testcase in glob.glob('RML*'): - print(testcase) - title, description = get_title_description(testcase) - error = 'false' - input1 = '' - input2 = '' - input3 = '' - input_format1 = '' - input_format2 = '' - input_format3 = '' - output1 = '' - output2 = '' - output3 = '' - output_format1 = '' - output_format2 = '' - output_format3 = '' - - # Input file - if os.path.exists(os.path.join(testcase, 'student.csv')): - input1 = 'student.csv' - input_format1 = 'text/csv' - - # Mapping file - if os.path.exists(os.path.join(testcase, 'mapping.ttl')): - mapping_file = 'mapping.ttl' - else: - raise ValueError('Mapping file missing!') - - # Output files - if os.path.exists(os.path.join(testcase, 'default.nq')): - output1 = 'default.nq' - output_format1 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'output.nq')): - output1 = 'output.nq' - output_format1 = 'application/n-quads' - else: - error = 'true' - - writer.writerow([testcase, title, description, spec, mapping_file, - input_format1, input_format2, input_format3, - output_format1, output_format2, output_format3, - input1, input2, input3, output1, output2, - output3, error]) - lines = [] - # Title and description - lines.append(f'## {testcase}\n\n') - lines.append(f'**Title**: {title}\n\n') - lines.append(f'**Description**: {description}\n\n') - if error == 'true': - error_html = 'Yes' - else: - error_html = 'No' - lines.append(f'**Error expected?** {error_html}\n\n') - - # Input - inputCount = '' - - for index, i in enumerate([input1, input2, input3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - input_html = f'**Input{inputCount}**\n `{i}`\n\n' - - lines.append(input_html) - inputCount = f' {index + 1}' - - # Mapping - with open(os.path.join(testcase, mapping_file)) as f: - mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' - lines.append(mapping_html) - - # Output - outputCount = '' - if output2 or output3: - outputCount = ' 1' - - for index, i in enumerate([output1, output2, output3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - output_html = f'**Output{outputCount}**\n `{i}`\n\n' - - lines.append(output_html) - outputCount = f' {index + 2}' - - - with open(os.path.join(testcase, 'README.md'), 'w') as f: - f.writelines(lines) - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('Usage: ./make-metadata.py ') - sys.exit(1) - main(sys.argv[1]) diff --git a/src/test/resources/rml-fnml/manifest.rml.ttl b/src/test/resources/rml-fnml/manifest.rml.ttl deleted file mode 100644 index 9d7b428..0000000 --- a/src/test/resources/rml-fnml/manifest.rml.ttl +++ /dev/null @@ -1,267 +0,0 @@ -@prefix xsd: . -@prefix dcterms: . -@prefix rml: . -@prefix rmltest: . -@prefix test: . -@base . - -# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/fnml/test/ - -_:source - rml:source [ - a rml:RelativePathSource ; - rml:path "metadata.csv" ; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; -. - -<#TriplesMapTestcase> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:reference "ID"; - rml:class test:TestCase; - ]; - - rml:predicateObjectMap [ - rml:predicate dcterms:identifier; - rml:objectMap [ - rml:reference "ID"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:hasError; - rml:objectMap [ - rml:reference "error"; - rml:datatype xsd:boolean; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:mappingDocument; - rml:objectMap [ - rml:reference "mapping"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; -. - -<#TriplesMapInput1> - a rml:TriplesMap; - - rml:logicalSource _:source ; - - rml:subjectMap [ - rml:template "{ID}/input/{input1}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format1"; - ]; - ]; -. - -<#TriplesMapInput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input2}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format2"; - ]; - ]; -. - -<#TriplesMapInput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input3}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format3"; - ]; - ]; -. - -<#TriplesMapOutput1> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output1}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format1"; - ]; - ]; -. - -<#TriplesMapOutput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output2}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format2"; - ]; - ]; -. - -<#TriplesMapOutput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output3}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format3"; - ]; - ]; -. - diff --git a/src/test/resources/rml-fnml/manifest.ttl b/src/test/resources/rml-fnml/manifest.ttl deleted file mode 100644 index 9110b4a..0000000 --- a/src/test/resources/rml-fnml/manifest.ttl +++ /dev/null @@ -1,236 +0,0 @@ - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0001-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0002-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0003-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0004-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0005-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0007-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0008-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0011-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0021-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0031-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0032-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0041-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0051-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0061-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0071-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0081-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "RMLFNMLTC0101-CSV" . - "true"^^ . - . - "mapping.ttl" . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0102-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0103-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . - "student.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "RMLFNMLTC0104-CSV" . - "false"^^ . - . - "mapping.ttl" . - . - . diff --git a/src/test/resources/rml-fnml/metadata.csv b/src/test/resources/rml-fnml/metadata.csv deleted file mode 100644 index c26f1b8..0000000 --- a/src/test/resources/rml-fnml/metadata.csv +++ /dev/null @@ -1,28 +0,0 @@ -ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error -RMLFNMLTC0001-CSV,"Function on object, 0 parameters","Tests -(1) if a function without parameters can be used (FnO) -(2) if a function on an object map can be used (Term) -(3) if the output of the function is assigned the correct termType by default",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0002-CSV,"Function on object, 1 reference parameter","Tests: -(1) if a function with one parameter can be used, (FnO) -(2) a reference parameter can be used (Term)",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0003-CSV,"Function on object, 1 reference parameter, the output termType is IRI",Tests if the output of the function is assigned the correct termType,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0004-CSV,"Function on object, the output termType is Literal",Tests if the output of the function is assigned the correct termType,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0005-CSV,"Function on object, 1 template parameter",Tests if a function with a template parameter can be used,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0007-CSV,Function on object returns empty string,Tests that a triple is generated when the results is an empty string.,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0008-CSV,Function on object returns null,Tests that no triple should be generated when the result is null.,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0011-CSV,"Function on predicate, 1 parameter",Tests if a function can be used on a predicate,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0021-CSV,"Function on object, 1 reference parameter, 1 constant parameter",Tests if a function with multiple parameters can be used,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0031-CSV,"Function on subject, 1 parameter","Tests if -(1) a function can be used on a subject -(2) Tests if the default termType assigned to the output of the function to be correct",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0032-CSV,Condition on subject,Tests that a condition shortcut works,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0041-CSV,Function using non-constant shortcut property return,Tests that a non-constant FNML Return map also works,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0051-CSV,Nested function - Test A,"Tests if a composite function of form f(g(x1),x2) works (i.e., the inner function is only one argument of the outer function)",http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0061-CSV,"Function on graph, 1 parameter",Tests if a function can be used on a graph,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0071-CSV,"Function on datatypeMap, 1 parameter",Tests that function on DatatypeMap is handled,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0081-CSV,"Function on languageMap, 1 parameter",Tests that function on LanguageMap is handled,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0101-CSV,"Function on object, 1 false reference parameter",Tests if a false reference parameters is caught,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,,,,student.csv,,,,,,true -RMLFNMLTC0102-CSV,"Function on object, wrong function URI",Tests that nothing is generated if a function is used where no implementation is made available to the mapping engine,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0103-CSV,"Function on object, wrong parameter",Tests that nothing is generated if a function is defined using a parameter not defined in the FnO description,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false -RMLFNMLTC0104-CSV,"Function on object, wrong return parameter",Tests that nothing is generated if a function is defined using a return not defined in the FnO description,http://w3id.org/rml/fnml/,mapping.ttl,text/csv,,,application/n-quads,,,student.csv,,,output.nq,,,false diff --git a/src/test/resources/rml-fnml/section/abstract.md b/src/test/resources/rml-fnml/section/abstract.md deleted file mode 100644 index 3ef03d6..0000000 --- a/src/test/resources/rml-fnml/section/abstract.md +++ /dev/null @@ -1 +0,0 @@ -This document defines the RML-FNML test cases to the determine the RML-FNML specification conformance of tools. diff --git a/src/test/resources/rml-fnml/section/data-model.md b/src/test/resources/rml-fnml/section/data-model.md deleted file mode 100644 index f4c3ad6..0000000 --- a/src/test/resources/rml-fnml/section/data-model.md +++ /dev/null @@ -1,12 +0,0 @@ -# Data model - -The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). -Each `test:Testcase` as the following properties: - -- `dcterms:identifier`: unique ID of the test case. -- `rmltest:hasError`: if an error of the RML Processor is expected or not. -- `rmltest:input`: One or more input data of the test case. -- `rmltest:output`: One or more output data of the test case. -- `rmltest:inputFormat`: the input data format. -- `rmltest:outputFormat`: the output data format. -- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-fnml/section/introduction.md b/src/test/resources/rml-fnml/section/introduction.md deleted file mode 100644 index e43b97e..0000000 --- a/src/test/resources/rml-fnml/section/introduction.md +++ /dev/null @@ -1,4 +0,0 @@ -# Introduction - -This document defines the RML-FNML test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-FNML specification. diff --git a/src/test/resources/rml-fnml/section/test-cases.md b/src/test/resources/rml-fnml/section/test-cases.md deleted file mode 100644 index 5ba69b6..0000000 --- a/src/test/resources/rml-fnml/section/test-cases.md +++ /dev/null @@ -1,10 +0,0 @@ -# Test cases - -This section describes the RML-FNML test cases. These descriptions are also available as RDF. -The files are available on [GitHub](https://github.com/kg-construct/rml-fnml/tree/main/test-cases) in the folder `test-cases`. -Each test case is contained in a single folder, containing three types of files: - - - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. - - One file with the RML rules, called `mapping.ttl`, in the Turtle format. - - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. - diff --git a/src/test/resources/rml-io/README.md b/src/test/resources/rml-io/README.md deleted file mode 100644 index 8dac540..0000000 --- a/src/test/resources/rml-io/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# IO Test Cases - -## Updating the metadata - -The test cases publication (html pages) can be generated as followed: - -1. Add the testcase description in `descriptions.csv` or fetch it from the [Google spreadsheet](https://docs.google.com/spreadsheets/d/1Ui216z2cF8bNAbdZvws-JoAhcjj4M2k_NlfzmCh1jh8/edit?gid=135246907#gid=135246907). -2. Execute the `make-metadata.py` script: `./make-metadata.py http://w3id.org/rml/io/` - (This is based on the content of the folders with the test cases, and on the file descriptions.csv for the descriptions of the cases) -3. Download burp: `curl -LO https://github.com/kg-construct/BURP/releases/download/v0.1.1/burp.jar` -4. Generate the manifest with [Burp](https://github.com/kg-construct/BURP): `java -jar burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/io/test/`. Optionally, sort the output: `sort -o manifest.ttl manifest.ttl` -5. Run list.sh and insert output in dev.html -6. Set the `prevVersion` in config.js -7. To publish the new HTML verson of the test cases, export `dev.html` as `index.html` in ./docs and in a subfolder with the date of the publication (maybe adapt the publication date) diff --git a/src/test/resources/rml-io/RMLSTC0001a/Friends.json b/src/test/resources/rml-io/RMLSTC0001a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLSTC0001a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLSTC0001a/README.md b/src/test/resources/rml-io/RMLSTC0001a/README.md deleted file mode 100644 index 21e8266..0000000 --- a/src/test/resources/rml-io/RMLSTC0001a/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLSTC0001a - -**Title**: Source with UTF-8 encoding - -**Description**: Test source with UTF-8 encoding - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json" - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0001a/default.nq b/src/test/resources/rml-io/RMLSTC0001a/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0001a/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0001a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0001a/mapping.ttl deleted file mode 100644 index 6ebc43f..0000000 --- a/src/test/resources/rml-io/RMLSTC0001a/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json" - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0001b/Friends-UTF16.json b/src/test/resources/rml-io/RMLSTC0001b/Friends-UTF16.json deleted file mode 100644 index 415e986531d4781633acb090c5a3a81837e3b2f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 664 zcmb7?F$=;l5QX2|UlBSxsHqB$ItYSGaTABy1`TM0I*It#)fXEA6-)?6!X8ouST4st=VS*xoU>qS>(*=b)9oSM`aaX#ztLVJPXujgj&fW?nzTp7{rq*-WDV diff --git a/src/test/resources/rml-io/RMLSTC0001b/README.md b/src/test/resources/rml-io/RMLSTC0001b/README.md deleted file mode 100644 index 32997da..0000000 --- a/src/test/resources/rml-io/RMLSTC0001b/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLSTC0001b - -**Title**: Source with UTF-16 encoding - -**Description**: Test source with UTF-16 encoding - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-UTF16.json" - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0001b/default.nq b/src/test/resources/rml-io/RMLSTC0001b/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0001b/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0001b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0001b/mapping.ttl deleted file mode 100644 index f669f6b..0000000 --- a/src/test/resources/rml-io/RMLSTC0001b/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-UTF16.json" - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0002a/Friends.json b/src/test/resources/rml-io/RMLSTC0002a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLSTC0002a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLSTC0002a/README.md b/src/test/resources/rml-io/RMLSTC0002a/README.md deleted file mode 100644 index d7f3ae9..0000000 --- a/src/test/resources/rml-io/RMLSTC0002a/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLSTC0002a - -**Title**: Source no compression - -**Description**: Test source without compression - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json" - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0002a/default.nq b/src/test/resources/rml-io/RMLSTC0002a/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0002a/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002a/mapping.ttl deleted file mode 100644 index 6ebc43f..0000000 --- a/src/test/resources/rml-io/RMLSTC0002a/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json" - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0002b/Friends.json.gz b/src/test/resources/rml-io/RMLSTC0002b/Friends.json.gz deleted file mode 100644 index 18bb45162065826a34773f6a10ba119bce30ad83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmV;X09pSZiwFqII7Vau14eRbWo~41E^2dcZUBqsQc$Q?01^rcN|`B2Rtg3>5KdlV zZYq$g . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.gz"; - rml:compression rml:gzip; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0002b/default.nq b/src/test/resources/rml-io/RMLSTC0002b/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0002b/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002b/mapping.ttl deleted file mode 100644 index c76bb87..0000000 --- a/src/test/resources/rml-io/RMLSTC0002b/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.gz"; - rml:compression rml:gzip; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0002c/README.md b/src/test/resources/rml-io/RMLSTC0002c/README.md deleted file mode 100644 index 13324fc..0000000 --- a/src/test/resources/rml-io/RMLSTC0002c/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLSTC0002c - -**Title**: Source Zip compression - -**Description**: Test source with ZIP compression - -**Error expected?** No - -**Input** - `Friends.json.zip` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.zip"; - rml:compression rml:zip; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0002c/default.nq b/src/test/resources/rml-io/RMLSTC0002c/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0002c/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002c/mapping.ttl deleted file mode 100644 index 18a50cf..0000000 --- a/src/test/resources/rml-io/RMLSTC0002c/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.zip"; - rml:compression rml:zip; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz b/src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz deleted file mode 100644 index 9b19cb563dea40a1dda6e700eb69300c3da635f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 284 zcmV+%0ptGtH+ooF000E$*0e?hz}f+T5Fr5;000000001AL@w0e2mb)lT>v8-i6&|` z44nsLdA@q|B9k`UnAnWOglesEy3w6Gk@RpivaQlS#C*}LCJ0J|TBDv7GP+SU zl~&&urO5tT0|(Pd2(gjzoJn2bNLJZFqF2HsuB z*@2mr?7))bDWxdU##C{82SJsML}_Z;4~d3)JgojBOANqt&wA}LPZ%hCdrwOM0000T i8ftv=wfMLI0rmla5C8xo5`oOI#Ao{g000001X)@mU3_E! diff --git a/src/test/resources/rml-io/RMLSTC0002d/README.md b/src/test/resources/rml-io/RMLSTC0002d/README.md deleted file mode 100644 index 74d1a38..0000000 --- a/src/test/resources/rml-io/RMLSTC0002d/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLSTC0002d - -**Title**: Source TarXz compression - -**Description**: Test source with TarXZ compression - -**Error expected?** No - -**Input** - `Friends.json.tar.xz` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.tar.xz"; - rml:compression rml:tarxz; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0002d/default.nq b/src/test/resources/rml-io/RMLSTC0002d/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0002d/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002d/mapping.ttl deleted file mode 100644 index 175631b..0000000 --- a/src/test/resources/rml-io/RMLSTC0002d/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.tar.xz"; - rml:compression rml:tarxz; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0002e/README.md b/src/test/resources/rml-io/RMLSTC0002e/README.md deleted file mode 100644 index b7144ef..0000000 --- a/src/test/resources/rml-io/RMLSTC0002e/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLSTC0002e - -**Title**: Source TarGzip compression - -**Description**: Test source with TarGZip compression - -**Error expected?** No - -**Input** - `Friends.json.tar.gz` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.tar.gz"; - rml:compression rml:targz; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0002e/default.nq b/src/test/resources/rml-io/RMLSTC0002e/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0002e/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0002e/mapping.ttl b/src/test/resources/rml-io/RMLSTC0002e/mapping.ttl deleted file mode 100644 index d08b82b..0000000 --- a/src/test/resources/rml-io/RMLSTC0002e/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json.tar.gz"; - rml:compression rml:targz; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0003/Friends.nt b/src/test/resources/rml-io/RMLSTC0003/Friends.nt deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLSTC0003/Friends.nt +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0003/README.md b/src/test/resources/rml-io/RMLSTC0003/README.md deleted file mode 100644 index 0376f5d..0000000 --- a/src/test/resources/rml-io/RMLSTC0003/README.md +++ /dev/null @@ -1,83 +0,0 @@ -## RMLSTC0003 - -**Title**: Source with query - -**Description**: Test source which requires a query - -**Error expected?** No - -**Input** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:path "./Friends.nt"; - ]; - rml:iterator """ - PREFIX foaf: - - SELECT ?person ?name ?age WHERE { - ?person foaf:name ?name . - ?person foaf:age ?age . - } - """; - rml:referenceFormulation formats:SPARQL_Results_CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:reference "person"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0003/default.nq b/src/test/resources/rml-io/RMLSTC0003/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0003/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0003/mapping.ttl b/src/test/resources/rml-io/RMLSTC0003/mapping.ttl deleted file mode 100644 index 78cbc56..0000000 --- a/src/test/resources/rml-io/RMLSTC0003/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:path "./Friends.nt"; - ]; - rml:iterator """ - PREFIX foaf: - - SELECT ?person ?name ?age WHERE { - ?person foaf:name ?name . - ?person foaf:age ?age . - } - """; - rml:referenceFormulation formats:SPARQL_Results_CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:reference "person"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv b/src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv deleted file mode 100644 index 6a82739..0000000 --- a/src/test/resources/rml-io/RMLSTC0004a/Friends-NULL.csv +++ /dev/null @@ -1,7 +0,0 @@ -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 -5,, diff --git a/src/test/resources/rml-io/RMLSTC0004a/README.md b/src/test/resources/rml-io/RMLSTC0004a/README.md deleted file mode 100644 index 21f0a61..0000000 --- a/src/test/resources/rml-io/RMLSTC0004a/README.md +++ /dev/null @@ -1,73 +0,0 @@ -## RMLSTC0004a - -**Title**: Source with default NULL values - -**Description**: Test source with default NULL values - -**Error expected?** No - -**Input** -``` -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 -5,, - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-NULL.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0004a/default.nq b/src/test/resources/rml-io/RMLSTC0004a/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0004a/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0004a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0004a/mapping.ttl deleted file mode 100644 index aa44cf1..0000000 --- a/src/test/resources/rml-io/RMLSTC0004a/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-NULL.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv b/src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv deleted file mode 100644 index 6a82739..0000000 --- a/src/test/resources/rml-io/RMLSTC0004b/Friends-NULL.csv +++ /dev/null @@ -1,7 +0,0 @@ -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 -5,, diff --git a/src/test/resources/rml-io/RMLSTC0004b/README.md b/src/test/resources/rml-io/RMLSTC0004b/README.md deleted file mode 100644 index 52cbcb4..0000000 --- a/src/test/resources/rml-io/RMLSTC0004b/README.md +++ /dev/null @@ -1,74 +0,0 @@ -## RMLSTC0004b - -**Title**: Source with one NULL value - -**Description**: Test source with one NULL value defined - -**Error expected?** No - -**Input** -``` -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 -5,, - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-NULL.csv"; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0004b/default.nq b/src/test/resources/rml-io/RMLSTC0004b/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0004b/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0004b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0004b/mapping.ttl deleted file mode 100644 index bb39b80..0000000 --- a/src/test/resources/rml-io/RMLSTC0004b/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-NULL.csv"; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL.csv b/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL.csv deleted file mode 100644 index 9fe1957..0000000 --- a/src/test/resources/rml-io/RMLSTC0004c/Friends-NULL.csv +++ /dev/null @@ -1,8 +0,0 @@ -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 -5,, -6,NULL,NULL diff --git a/src/test/resources/rml-io/RMLSTC0004c/README.md b/src/test/resources/rml-io/RMLSTC0004c/README.md deleted file mode 100644 index 936b943..0000000 --- a/src/test/resources/rml-io/RMLSTC0004c/README.md +++ /dev/null @@ -1,76 +0,0 @@ -## RMLSTC0004c - -**Title**: Source with multiple NULL values - -**Description**: Test source with multiple NULL values defined - -**Error expected?** No - -**Input** -``` -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 -5,, -6,NULL,NULL - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-NULL.csv"; - rml:null ""; - rml:null "NULL"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0004c/default.nq b/src/test/resources/rml-io/RMLSTC0004c/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0004c/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0004c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0004c/mapping.ttl deleted file mode 100644 index e864a95..0000000 --- a/src/test/resources/rml-io/RMLSTC0004c/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends-NULL.csv"; - rml:null ""; - rml:null "NULL"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0006a/Friends.csv b/src/test/resources/rml-io/RMLSTC0006a/Friends.csv deleted file mode 100644 index 752cdfe..0000000 --- a/src/test/resources/rml-io/RMLSTC0006a/Friends.csv +++ /dev/null @@ -1,6 +0,0 @@ -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0006a/README.md b/src/test/resources/rml-io/RMLSTC0006a/README.md deleted file mode 100644 index 3e7b5c9..0000000 --- a/src/test/resources/rml-io/RMLSTC0006a/README.md +++ /dev/null @@ -1,77 +0,0 @@ -## RMLSTC0006a - -**Title**: Source with D2RQ access description - -**Description**: Test source with D2RQ access description for SQL databases - -**Error expected?** No - -**Input** -``` -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix d2rq: . -@prefix xsd: . -@base . - -<#D2RQSourceAccess> a rml:Source, d2rq:Database; - d2rq:jdbcDSN "$CONNECTIONDSN"; - d2rq:username "$USERNAME"; - d2rq:password "$PASSWORD" -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#D2RQSourceAccess>; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Friends"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0006a/default.nq b/src/test/resources/rml-io/RMLSTC0006a/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0006a/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006a/mapping.ttl deleted file mode 100644 index f8011e8..0000000 --- a/src/test/resources/rml-io/RMLSTC0006a/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix d2rq: . -@prefix xsd: . -@base . - -<#D2RQSourceAccess> a rml:Source, d2rq:Database; - d2rq:jdbcDSN "$CONNECTIONDSN"; - d2rq:username "$USERNAME"; - d2rq:password "$PASSWORD" -. - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source <#D2RQSourceAccess>; - rml:referenceFormulation rml:SQL2008Table; - rml:iterator "Friends"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0006b/Friends.csv b/src/test/resources/rml-io/RMLSTC0006b/Friends.csv deleted file mode 100644 index 752cdfe..0000000 --- a/src/test/resources/rml-io/RMLSTC0006b/Friends.csv +++ /dev/null @@ -1,6 +0,0 @@ -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0006b/README.md b/src/test/resources/rml-io/RMLSTC0006b/README.md deleted file mode 100644 index 73c9ad5..0000000 --- a/src/test/resources/rml-io/RMLSTC0006b/README.md +++ /dev/null @@ -1,72 +0,0 @@ -## RMLSTC0006b - -**Title**: Source with a Relative Path Source - -**Description**: Test access to a file - -**Error expected?** No - -**Input** -``` -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath, rml:Source; - rml:root rml:CurrentWorkingDirectory; - rml:path "./Friends.csv" - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0006b/default.nq b/src/test/resources/rml-io/RMLSTC0006b/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0006b/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0006b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0006b/mapping.ttl deleted file mode 100644 index f0d0f98..0000000 --- a/src/test/resources/rml-io/RMLSTC0006b/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath, rml:Source; - rml:root rml:CurrentWorkingDirectory; - rml:path "./Friends.csv" - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0007a/Friends.json b/src/test/resources/rml-io/RMLSTC0007a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLSTC0007a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLSTC0007a/README.md b/src/test/resources/rml-io/RMLSTC0007a/README.md deleted file mode 100644 index 94abd46..0000000 --- a/src/test/resources/rml-io/RMLSTC0007a/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLSTC0007a - -**Title**: Source with JSONPath reference formulation - -**Description**: Test source with JSONPath reference formulation - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0007a/default.nq b/src/test/resources/rml-io/RMLSTC0007a/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0007a/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007a/mapping.ttl deleted file mode 100644 index 00a2f99..0000000 --- a/src/test/resources/rml-io/RMLSTC0007a/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0007b/Friends.csv b/src/test/resources/rml-io/RMLSTC0007b/Friends.csv deleted file mode 100644 index 752cdfe..0000000 --- a/src/test/resources/rml-io/RMLSTC0007b/Friends.csv +++ /dev/null @@ -1,6 +0,0 @@ -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0007b/README.md b/src/test/resources/rml-io/RMLSTC0007b/README.md deleted file mode 100644 index 90d9e4b..0000000 --- a/src/test/resources/rml-io/RMLSTC0007b/README.md +++ /dev/null @@ -1,72 +0,0 @@ -## RMLSTC0007b - -**Title**: Source with CSV reference formulation - -**Description**: Test source with Tabular reference formulation - -**Error expected?** No - -**Input** -``` -id,name,age -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0007b/default.nq b/src/test/resources/rml-io/RMLSTC0007b/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0007b/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007b/mapping.ttl deleted file mode 100644 index a177188..0000000 --- a/src/test/resources/rml-io/RMLSTC0007b/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0007c/Friends.xml b/src/test/resources/rml-io/RMLSTC0007c/Friends.xml deleted file mode 100644 index 73fb396..0000000 --- a/src/test/resources/rml-io/RMLSTC0007c/Friends.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Monica Geller - 33 - - - Rachel Green - 34 - - - Joey Tribbiani - 35 - - - Chandler Bing - 36 - - - Ross Geller - 37 - - diff --git a/src/test/resources/rml-io/RMLSTC0007c/README.md b/src/test/resources/rml-io/RMLSTC0007c/README.md deleted file mode 100644 index 234696f..0000000 --- a/src/test/resources/rml-io/RMLSTC0007c/README.md +++ /dev/null @@ -1,88 +0,0 @@ -## RMLSTC0007c - -**Title**: Source with XPath reference formulation - -**Description**: Test source with XPath reference formulation - -**Error expected?** No - -**Input** -``` - - - Monica Geller - 33 - - - Rachel Green - 34 - - - Joey Tribbiani - 35 - - - Chandler Bing - 36 - - - Ross Geller - 37 - - - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.xml" - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "//Friends/Character"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name/text()"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age/text()"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0007c/default.nq b/src/test/resources/rml-io/RMLSTC0007c/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0007c/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007c/mapping.ttl deleted file mode 100644 index a437353..0000000 --- a/src/test/resources/rml-io/RMLSTC0007c/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.xml" - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "//Friends/Character"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name/text()"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age/text()"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0007d/Friends.xml b/src/test/resources/rml-io/RMLSTC0007d/Friends.xml deleted file mode 100644 index 6eb793a..0000000 --- a/src/test/resources/rml-io/RMLSTC0007d/Friends.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Monica Geller - 33 - - - Rachel Green - 34 - - - Joey Tribbiani - 35 - - - Chandler Bing - 36 - - - Ross Geller - 37 - - diff --git a/src/test/resources/rml-io/RMLSTC0007d/README.md b/src/test/resources/rml-io/RMLSTC0007d/README.md deleted file mode 100644 index ce96922..0000000 --- a/src/test/resources/rml-io/RMLSTC0007d/README.md +++ /dev/null @@ -1,93 +0,0 @@ -## RMLSTC0007d - -**Title**: Source with XPath reference formulation with namespaces - -**Description**: Test source with XPath reference formulation with namespaces - -**Error expected?** No - -**Input** -``` - - - Monica Geller - 33 - - - Rachel Green - 34 - - - Joey Tribbiani - 35 - - - Chandler Bing - 36 - - - Ross Geller - 37 - - - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.xml" - ]; - rml:referenceFormulation [ a rml:XPathReferenceFormulation; - rml:namespace [ a rml:Namespace; - rml:namespacePrefix "ex"; - rml:namespaceURL "http://example.org"; - ]; - ]; - rml:iterator "//Friends/ex:Character"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "ex:name/text()"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "ex:age/text()"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0007d/default.nq b/src/test/resources/rml-io/RMLSTC0007d/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLSTC0007d/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0007d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0007d/mapping.ttl deleted file mode 100644 index 14f45ed..0000000 --- a/src/test/resources/rml-io/RMLSTC0007d/mapping.ttl +++ /dev/null @@ -1,38 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.xml" - ]; - rml:referenceFormulation [ a rml:XPathReferenceFormulation; - rml:namespace [ a rml:Namespace; - rml:namespacePrefix "ex"; - rml:namespaceURL "http://example.org"; - ]; - ]; - rml:iterator "//Friends/ex:Character"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "ex:name/text()"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "ex:age/text()"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0008a/Friends.json b/src/test/resources/rml-io/RMLSTC0008a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLSTC0008a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLSTC0008a/Friends2.json b/src/test/resources/rml-io/RMLSTC0008a/Friends2.json deleted file mode 100644 index 415235f..0000000 --- a/src/test/resources/rml-io/RMLSTC0008a/Friends2.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "id": 6, - "name": "Phoebe Buffay", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLSTC0008a/README.md b/src/test/resources/rml-io/RMLSTC0008a/README.md deleted file mode 100644 index 20e36b2..0000000 --- a/src/test/resources/rml-io/RMLSTC0008a/README.md +++ /dev/null @@ -1,127 +0,0 @@ -## RMLSTC0008a - -**Title**: Multiple sources of same type - -**Description**: Tests the generation of all triples from multiple homogeneous sources - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "Friends2.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - "37" . - "Phoebe Buffay" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0008a/default.nq b/src/test/resources/rml-io/RMLSTC0008a/default.nq deleted file mode 100644 index 8751f41..0000000 --- a/src/test/resources/rml-io/RMLSTC0008a/default.nq +++ /dev/null @@ -1,12 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . - "37"^^ . - "Phoebe Buffay" . diff --git a/src/test/resources/rml-io/RMLSTC0008a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0008a/mapping.ttl deleted file mode 100644 index 1b53bd1..0000000 --- a/src/test/resources/rml-io/RMLSTC0008a/mapping.ttl +++ /dev/null @@ -1,65 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "Friends2.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0008b/Friends.csv b/src/test/resources/rml-io/RMLSTC0008b/Friends.csv deleted file mode 100644 index 6966523..0000000 --- a/src/test/resources/rml-io/RMLSTC0008b/Friends.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,age -6,Phoebe Buffay,37 \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0008b/Friends.json b/src/test/resources/rml-io/RMLSTC0008b/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLSTC0008b/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLSTC0008b/README.md b/src/test/resources/rml-io/RMLSTC0008b/README.md deleted file mode 100644 index 18fea47..0000000 --- a/src/test/resources/rml-io/RMLSTC0008b/README.md +++ /dev/null @@ -1,126 +0,0 @@ -## RMLSTC0008b - -**Title**: Multiple sources of different type - -**Description**: Tests the generation of all triples from multiple heterogeneous sources - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - "37" . - "Phoebe Buffay" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0008b/default.nq b/src/test/resources/rml-io/RMLSTC0008b/default.nq deleted file mode 100644 index 8751f41..0000000 --- a/src/test/resources/rml-io/RMLSTC0008b/default.nq +++ /dev/null @@ -1,12 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . - "37"^^ . - "Phoebe Buffay" . diff --git a/src/test/resources/rml-io/RMLSTC0008b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0008b/mapping.ttl deleted file mode 100644 index 8fd68c4..0000000 --- a/src/test/resources/rml-io/RMLSTC0008b/mapping.ttl +++ /dev/null @@ -1,64 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:RelativePathSource; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0009a/Friends.csv b/src/test/resources/rml-io/RMLSTC0009a/Friends.csv deleted file mode 100644 index 66cc9dc..0000000 --- a/src/test/resources/rml-io/RMLSTC0009a/Friends.csv +++ /dev/null @@ -1,6 +0,0 @@ -"id","name","age" -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 diff --git a/src/test/resources/rml-io/RMLSTC0009a/README.md b/src/test/resources/rml-io/RMLSTC0009a/README.md deleted file mode 100644 index e8d8a64..0000000 --- a/src/test/resources/rml-io/RMLSTC0009a/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## RMLSTC0009a - -**Title**: Source with quoted columns - -**Description**: Tests the generation of triples where columns are quoted - -**Error expected?** Yes - -**Input** -``` -"id","name","age" -0,Monica Geller,33 -1,Rachel Green,34 -2,Joey Tribbiani,35 -3,Chandler Bing,36 -4,Ross Geller,37 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0009a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0009a/mapping.ttl deleted file mode 100644 index a177188..0000000 --- a/src/test/resources/rml-io/RMLSTC0009a/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLSTC0009a/output.nq b/src/test/resources/rml-io/RMLSTC0009a/output.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLSTC0009a/output.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLSTC0010a/Friends.csv b/src/test/resources/rml-io/RMLSTC0010a/Friends.csv deleted file mode 100644 index 1b386cf..0000000 --- a/src/test/resources/rml-io/RMLSTC0010a/Friends.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,age -6,Phoebe Buffay 37 diff --git a/src/test/resources/rml-io/RMLSTC0010a/README.md b/src/test/resources/rml-io/RMLSTC0010a/README.md deleted file mode 100644 index d960a59..0000000 --- a/src/test/resources/rml-io/RMLSTC0010a/README.md +++ /dev/null @@ -1,52 +0,0 @@ -## RMLSTC0010a - -**Title**: Invalid CSV source, reference to invalid column - -**Description**: Tests the identification of invalid CSV sources - -**Error expected?** Yes - -**Input** -``` -id,name,age -6,Phoebe Buffay 37 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]. - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0010a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0010a/mapping.ttl deleted file mode 100644 index 8439296..0000000 --- a/src/test/resources/rml-io/RMLSTC0010a/mapping.ttl +++ /dev/null @@ -1,32 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "age"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0010b/Friends.csv b/src/test/resources/rml-io/RMLSTC0010b/Friends.csv deleted file mode 100644 index 1b386cf..0000000 --- a/src/test/resources/rml-io/RMLSTC0010b/Friends.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,age -6,Phoebe Buffay 37 diff --git a/src/test/resources/rml-io/RMLSTC0010b/README.md b/src/test/resources/rml-io/RMLSTC0010b/README.md deleted file mode 100644 index 83bee15..0000000 --- a/src/test/resources/rml-io/RMLSTC0010b/README.md +++ /dev/null @@ -1,44 +0,0 @@ -## RMLSTC0010b - -**Title**: Invalid CSV source, no reference to invalid column - -**Description**: Tests the identification of invalid CSV sources, even when all columns referenced are valid - -**Error expected?** Yes - -**Input** -``` -id,name,age -6,Phoebe Buffay 37 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]. - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0010b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0010b/mapping.ttl deleted file mode 100644 index d4e5fe5..0000000 --- a/src/test/resources/rml-io/RMLSTC0010b/mapping.ttl +++ /dev/null @@ -1,24 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.csv"; - ]; - rml:referenceFormulation rml:CSV; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0011a/README.md b/src/test/resources/rml-io/RMLSTC0011a/README.md deleted file mode 100644 index bf4cdbe..0000000 --- a/src/test/resources/rml-io/RMLSTC0011a/README.md +++ /dev/null @@ -1,48 +0,0 @@ -## RMLSTC0011a - -**Title**: Complex JSON source - -**Description**: Tests the generation of triples from complex JSON sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]. - -``` - -**Output** -``` - "InnovateX" . - "TechCorp" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0011a/companies.json b/src/test/resources/rml-io/RMLSTC0011a/companies.json deleted file mode 100644 index 2835503..0000000 --- a/src/test/resources/rml-io/RMLSTC0011a/companies.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "companies": [ - { - "name": "TechCorp", - "location": { - "country": "USA", - "state": "California", - "city": "San Francisco" - }, - "departments": [ - { - "name": "Engineering", - "manager": { - "name": "Alice Johnson", - "age": 42 - }, - "employees": [ - { - "name": "Bob Smith", - "role": "Software Engineer", - "skills": ["Python", "JavaScript", "AWS"] - }, - { - "name": "Eve Davis", - "role": "DevOps Engineer", - "skills": ["Docker", "Kubernetes", "Terraform"] - } - ] - }, - { - "name": "Marketing", - "manager": { - "name": "John Doe", - "age": 39 - }, - "employees": [ - { - "name": "Sarah Lee", - "role": "Marketing Specialist", - "skills": ["SEO", "Google Ads", "Copywriting"] - } - ] - } - ] - }, - { - "name": "InnovateX", - "location": { - "country": "Canada", - "state": "Ontario", - "city": "Toronto" - }, - "departments": [ - { - "name": "Research & Development", - "manager": { - "name": "Emma Wilson", - "age": 45 - }, - "employees": [ - { - "name": "Liam Brown", - "role": "AI Researcher", - "skills": ["Machine Learning", "Deep Learning", "Python"] - }, - { - "name": "Sophia White", - "role": "Data Scientist", - "skills": ["Data Analysis", "R", "SQL"] - } - ] - }, - { - "name": "Sales", - "manager": { - "name": "Michael Green", - "age": 38 - }, - "employees": [ - { - "name": "Olivia Martinez", - "role": "Sales Executive", - "skills": ["Negotiation", "CRM", "Lead Generation"] - } - ] - } - ] - } - ] - } - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011a/default.nq b/src/test/resources/rml-io/RMLSTC0011a/default.nq deleted file mode 100644 index 77a2153..0000000 --- a/src/test/resources/rml-io/RMLSTC0011a/default.nq +++ /dev/null @@ -1,2 +0,0 @@ - "InnovateX" . - "TechCorp" . diff --git a/src/test/resources/rml-io/RMLSTC0011a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011a/mapping.ttl deleted file mode 100644 index ac102a3..0000000 --- a/src/test/resources/rml-io/RMLSTC0011a/mapping.ttl +++ /dev/null @@ -1,25 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0011b/README.md b/src/test/resources/rml-io/RMLSTC0011b/README.md deleted file mode 100644 index 6a0f0bf..0000000 --- a/src/test/resources/rml-io/RMLSTC0011b/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## RMLSTC0011b - -**Title**: Complex JSON source - -**Description**: Tests the generation of triples from complex JSON sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:department; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.departments[*].name"; - ]; - ]. - -``` - -**Output** -``` - "Research & Development" . - "Sales" . - "Engineering" . - "Marketing" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0011b/companies.json b/src/test/resources/rml-io/RMLSTC0011b/companies.json deleted file mode 100644 index 2835503..0000000 --- a/src/test/resources/rml-io/RMLSTC0011b/companies.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "companies": [ - { - "name": "TechCorp", - "location": { - "country": "USA", - "state": "California", - "city": "San Francisco" - }, - "departments": [ - { - "name": "Engineering", - "manager": { - "name": "Alice Johnson", - "age": 42 - }, - "employees": [ - { - "name": "Bob Smith", - "role": "Software Engineer", - "skills": ["Python", "JavaScript", "AWS"] - }, - { - "name": "Eve Davis", - "role": "DevOps Engineer", - "skills": ["Docker", "Kubernetes", "Terraform"] - } - ] - }, - { - "name": "Marketing", - "manager": { - "name": "John Doe", - "age": 39 - }, - "employees": [ - { - "name": "Sarah Lee", - "role": "Marketing Specialist", - "skills": ["SEO", "Google Ads", "Copywriting"] - } - ] - } - ] - }, - { - "name": "InnovateX", - "location": { - "country": "Canada", - "state": "Ontario", - "city": "Toronto" - }, - "departments": [ - { - "name": "Research & Development", - "manager": { - "name": "Emma Wilson", - "age": 45 - }, - "employees": [ - { - "name": "Liam Brown", - "role": "AI Researcher", - "skills": ["Machine Learning", "Deep Learning", "Python"] - }, - { - "name": "Sophia White", - "role": "Data Scientist", - "skills": ["Data Analysis", "R", "SQL"] - } - ] - }, - { - "name": "Sales", - "manager": { - "name": "Michael Green", - "age": 38 - }, - "employees": [ - { - "name": "Olivia Martinez", - "role": "Sales Executive", - "skills": ["Negotiation", "CRM", "Lead Generation"] - } - ] - } - ] - } - ] - } - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011b/default.nq b/src/test/resources/rml-io/RMLSTC0011b/default.nq deleted file mode 100644 index 600758b..0000000 --- a/src/test/resources/rml-io/RMLSTC0011b/default.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Research & Development" . - "Sales" . - "Engineering" . - "Marketing" . diff --git a/src/test/resources/rml-io/RMLSTC0011b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011b/mapping.ttl deleted file mode 100644 index 91a597e..0000000 --- a/src/test/resources/rml-io/RMLSTC0011b/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:department; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.departments[*].name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0011c/README.md b/src/test/resources/rml-io/RMLSTC0011c/README.md deleted file mode 100644 index aed00dd..0000000 --- a/src/test/resources/rml-io/RMLSTC0011c/README.md +++ /dev/null @@ -1,53 +0,0 @@ -## RMLSTC0011c - -**Title**: Complex JSON source - -**Description**: Tests the generation of triples from complex JSON sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:employee; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.departments[*].employees[*].name"; - ]; - ]. - -``` - -**Output** -``` - "Liam Brown" . - "Olivia Martinez" . - "Sophia White" . - "Bob Smith" . - "Eve Davis" . - "Sarah Lee" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0011c/companies.json b/src/test/resources/rml-io/RMLSTC0011c/companies.json deleted file mode 100644 index 2835503..0000000 --- a/src/test/resources/rml-io/RMLSTC0011c/companies.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "companies": [ - { - "name": "TechCorp", - "location": { - "country": "USA", - "state": "California", - "city": "San Francisco" - }, - "departments": [ - { - "name": "Engineering", - "manager": { - "name": "Alice Johnson", - "age": 42 - }, - "employees": [ - { - "name": "Bob Smith", - "role": "Software Engineer", - "skills": ["Python", "JavaScript", "AWS"] - }, - { - "name": "Eve Davis", - "role": "DevOps Engineer", - "skills": ["Docker", "Kubernetes", "Terraform"] - } - ] - }, - { - "name": "Marketing", - "manager": { - "name": "John Doe", - "age": 39 - }, - "employees": [ - { - "name": "Sarah Lee", - "role": "Marketing Specialist", - "skills": ["SEO", "Google Ads", "Copywriting"] - } - ] - } - ] - }, - { - "name": "InnovateX", - "location": { - "country": "Canada", - "state": "Ontario", - "city": "Toronto" - }, - "departments": [ - { - "name": "Research & Development", - "manager": { - "name": "Emma Wilson", - "age": 45 - }, - "employees": [ - { - "name": "Liam Brown", - "role": "AI Researcher", - "skills": ["Machine Learning", "Deep Learning", "Python"] - }, - { - "name": "Sophia White", - "role": "Data Scientist", - "skills": ["Data Analysis", "R", "SQL"] - } - ] - }, - { - "name": "Sales", - "manager": { - "name": "Michael Green", - "age": 38 - }, - "employees": [ - { - "name": "Olivia Martinez", - "role": "Sales Executive", - "skills": ["Negotiation", "CRM", "Lead Generation"] - } - ] - } - ] - } - ] - } - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011c/default.nq b/src/test/resources/rml-io/RMLSTC0011c/default.nq deleted file mode 100644 index c83222b..0000000 --- a/src/test/resources/rml-io/RMLSTC0011c/default.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Liam Brown" . - "Olivia Martinez" . - "Sophia White" . - "Bob Smith" . - "Eve Davis" . - "Sarah Lee" . diff --git a/src/test/resources/rml-io/RMLSTC0011c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011c/mapping.ttl deleted file mode 100644 index 8c92295..0000000 --- a/src/test/resources/rml-io/RMLSTC0011c/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:employee; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.departments[*].employees[*].name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0011d/README.md b/src/test/resources/rml-io/RMLSTC0011d/README.md deleted file mode 100644 index cb2caaf..0000000 --- a/src/test/resources/rml-io/RMLSTC0011d/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## RMLSTC0011d - -**Title**: Complex JSON source - -**Description**: Tests the generation of triples from complex JSON sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*].departments[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.manager.name"; - ]; - ]. - -``` - -**Output** -``` - "Alice Johnson" . - "John Doe" . - "Emma Wilson" . - "Michael Green" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0011d/companies.json b/src/test/resources/rml-io/RMLSTC0011d/companies.json deleted file mode 100644 index 2835503..0000000 --- a/src/test/resources/rml-io/RMLSTC0011d/companies.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "companies": [ - { - "name": "TechCorp", - "location": { - "country": "USA", - "state": "California", - "city": "San Francisco" - }, - "departments": [ - { - "name": "Engineering", - "manager": { - "name": "Alice Johnson", - "age": 42 - }, - "employees": [ - { - "name": "Bob Smith", - "role": "Software Engineer", - "skills": ["Python", "JavaScript", "AWS"] - }, - { - "name": "Eve Davis", - "role": "DevOps Engineer", - "skills": ["Docker", "Kubernetes", "Terraform"] - } - ] - }, - { - "name": "Marketing", - "manager": { - "name": "John Doe", - "age": 39 - }, - "employees": [ - { - "name": "Sarah Lee", - "role": "Marketing Specialist", - "skills": ["SEO", "Google Ads", "Copywriting"] - } - ] - } - ] - }, - { - "name": "InnovateX", - "location": { - "country": "Canada", - "state": "Ontario", - "city": "Toronto" - }, - "departments": [ - { - "name": "Research & Development", - "manager": { - "name": "Emma Wilson", - "age": 45 - }, - "employees": [ - { - "name": "Liam Brown", - "role": "AI Researcher", - "skills": ["Machine Learning", "Deep Learning", "Python"] - }, - { - "name": "Sophia White", - "role": "Data Scientist", - "skills": ["Data Analysis", "R", "SQL"] - } - ] - }, - { - "name": "Sales", - "manager": { - "name": "Michael Green", - "age": 38 - }, - "employees": [ - { - "name": "Olivia Martinez", - "role": "Sales Executive", - "skills": ["Negotiation", "CRM", "Lead Generation"] - } - ] - } - ] - } - ] - } - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011d/default.nq b/src/test/resources/rml-io/RMLSTC0011d/default.nq deleted file mode 100644 index bf945c7..0000000 --- a/src/test/resources/rml-io/RMLSTC0011d/default.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Alice Johnson" . - "John Doe" . - "Emma Wilson" . - "Michael Green" . diff --git a/src/test/resources/rml-io/RMLSTC0011d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011d/mapping.ttl deleted file mode 100644 index 84360e1..0000000 --- a/src/test/resources/rml-io/RMLSTC0011d/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*].departments[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.manager.name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0011e/README.md b/src/test/resources/rml-io/RMLSTC0011e/README.md deleted file mode 100644 index 1685d96..0000000 --- a/src/test/resources/rml-io/RMLSTC0011e/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLSTC0011e - -**Title**: Complex JSON source - -**Description**: Tests the generation of triples from complex JSON sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*].departments[*].employees[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:skill; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.skills[*]"; - ]; - ]. - -``` - -**Output** -``` - "AWS" . - "JavaScript" . - "Python" . - "Docker" . - "Kubernetes" . - "Terraform" . - "Deep Learning" . - "Machine Learning" . - "Python" . - "CRM" . - "Lead Generation" . - "Negotiation" . - "Copywriting" . - "Google Ads" . - "SEO" . - "Data Analysis" . - "R" . - "SQL" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0011e/companies.json b/src/test/resources/rml-io/RMLSTC0011e/companies.json deleted file mode 100644 index 2835503..0000000 --- a/src/test/resources/rml-io/RMLSTC0011e/companies.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "companies": [ - { - "name": "TechCorp", - "location": { - "country": "USA", - "state": "California", - "city": "San Francisco" - }, - "departments": [ - { - "name": "Engineering", - "manager": { - "name": "Alice Johnson", - "age": 42 - }, - "employees": [ - { - "name": "Bob Smith", - "role": "Software Engineer", - "skills": ["Python", "JavaScript", "AWS"] - }, - { - "name": "Eve Davis", - "role": "DevOps Engineer", - "skills": ["Docker", "Kubernetes", "Terraform"] - } - ] - }, - { - "name": "Marketing", - "manager": { - "name": "John Doe", - "age": 39 - }, - "employees": [ - { - "name": "Sarah Lee", - "role": "Marketing Specialist", - "skills": ["SEO", "Google Ads", "Copywriting"] - } - ] - } - ] - }, - { - "name": "InnovateX", - "location": { - "country": "Canada", - "state": "Ontario", - "city": "Toronto" - }, - "departments": [ - { - "name": "Research & Development", - "manager": { - "name": "Emma Wilson", - "age": 45 - }, - "employees": [ - { - "name": "Liam Brown", - "role": "AI Researcher", - "skills": ["Machine Learning", "Deep Learning", "Python"] - }, - { - "name": "Sophia White", - "role": "Data Scientist", - "skills": ["Data Analysis", "R", "SQL"] - } - ] - }, - { - "name": "Sales", - "manager": { - "name": "Michael Green", - "age": 38 - }, - "employees": [ - { - "name": "Olivia Martinez", - "role": "Sales Executive", - "skills": ["Negotiation", "CRM", "Lead Generation"] - } - ] - } - ] - } - ] - } - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0011e/default.nq b/src/test/resources/rml-io/RMLSTC0011e/default.nq deleted file mode 100644 index 9403b1f..0000000 --- a/src/test/resources/rml-io/RMLSTC0011e/default.nq +++ /dev/null @@ -1,18 +0,0 @@ - "AWS" . - "JavaScript" . - "Python" . - "Docker" . - "Kubernetes" . - "Terraform" . - "Deep Learning" . - "Machine Learning" . - "Python" . - "CRM" . - "Lead Generation" . - "Negotiation" . - "Copywriting" . - "Google Ads" . - "SEO" . - "Data Analysis" . - "R" . - "SQL" . diff --git a/src/test/resources/rml-io/RMLSTC0011e/mapping.ttl b/src/test/resources/rml-io/RMLSTC0011e/mapping.ttl deleted file mode 100644 index 871a4e8..0000000 --- a/src/test/resources/rml-io/RMLSTC0011e/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$.companies[*].departments[*].employees[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:skill; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.skills[*]"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0012a/README.md b/src/test/resources/rml-io/RMLSTC0012a/README.md deleted file mode 100644 index 3563424..0000000 --- a/src/test/resources/rml-io/RMLSTC0012a/README.md +++ /dev/null @@ -1,49 +0,0 @@ -## RMLSTC0012a - -**Title**: Complex XML source - -**Description**: Tests the generation of triples from complex XML sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]. - -``` - -**Output** -``` - "TechCorp" . - "InnovateX" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0012a/companies.xml b/src/test/resources/rml-io/RMLSTC0012a/companies.xml deleted file mode 100644 index 6cf391e..0000000 --- a/src/test/resources/rml-io/RMLSTC0012a/companies.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - TechCorp - - USA - California - San Francisco - - - - Engineering - - Alice Johnson - 42 - - - - Bob Smith - Software Engineer - - Python - JavaScript - AWS - - - - Eve Davis - DevOps Engineer - - Docker - Kubernetes - Terraform - - - - - - Marketing - - John Doe - 39 - - - - Sarah Lee - Marketing Specialist - - SEO - Google Ads - Copywriting - - - - - - - - InnovateX - - Canada - Ontario - Toronto - - - - Research & Development - - Emma Wilson - 45 - - - - Liam Brown - AI Researcher - - Machine Learning - Deep Learning - Python - - - - Sophia White - Data Scientist - - Data Analysis - R - SQL - - - - - - Sales - - Michael Green - 38 - - - - Olivia Martinez - Sales Executive - - Negotiation - CRM - Lead Generation - - - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012a/default.nq b/src/test/resources/rml-io/RMLSTC0012a/default.nq deleted file mode 100644 index 2d195a8..0000000 --- a/src/test/resources/rml-io/RMLSTC0012a/default.nq +++ /dev/null @@ -1,2 +0,0 @@ - "TechCorp" . - "InnovateX" . diff --git a/src/test/resources/rml-io/RMLSTC0012a/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012a/mapping.ttl deleted file mode 100644 index e506815..0000000 --- a/src/test/resources/rml-io/RMLSTC0012a/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0012b/README.md b/src/test/resources/rml-io/RMLSTC0012b/README.md deleted file mode 100644 index 33121fd..0000000 --- a/src/test/resources/rml-io/RMLSTC0012b/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## RMLSTC0012b - -**Title**: Complex XML source - -**Description**: Tests the generation of triples from complex XML sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{../@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:department; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "department/name"; - ]; - ]. - -``` - -**Output** -``` - "Engineering" . - "Marketing" . - "Research & Development" . - "Sales" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0012b/companies.xml b/src/test/resources/rml-io/RMLSTC0012b/companies.xml deleted file mode 100644 index 6cf391e..0000000 --- a/src/test/resources/rml-io/RMLSTC0012b/companies.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - TechCorp - - USA - California - San Francisco - - - - Engineering - - Alice Johnson - 42 - - - - Bob Smith - Software Engineer - - Python - JavaScript - AWS - - - - Eve Davis - DevOps Engineer - - Docker - Kubernetes - Terraform - - - - - - Marketing - - John Doe - 39 - - - - Sarah Lee - Marketing Specialist - - SEO - Google Ads - Copywriting - - - - - - - - InnovateX - - Canada - Ontario - Toronto - - - - Research & Development - - Emma Wilson - 45 - - - - Liam Brown - AI Researcher - - Machine Learning - Deep Learning - Python - - - - Sophia White - Data Scientist - - Data Analysis - R - SQL - - - - - - Sales - - Michael Green - 38 - - - - Olivia Martinez - Sales Executive - - Negotiation - CRM - Lead Generation - - - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012b/default.nq b/src/test/resources/rml-io/RMLSTC0012b/default.nq deleted file mode 100644 index a6ddb02..0000000 --- a/src/test/resources/rml-io/RMLSTC0012b/default.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Engineering" . - "Marketing" . - "Research & Development" . - "Sales" . diff --git a/src/test/resources/rml-io/RMLSTC0012b/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012b/mapping.ttl deleted file mode 100644 index bc6e289..0000000 --- a/src/test/resources/rml-io/RMLSTC0012b/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{../@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:department; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "department/name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0012c/README.md b/src/test/resources/rml-io/RMLSTC0012c/README.md deleted file mode 100644 index b89b647..0000000 --- a/src/test/resources/rml-io/RMLSTC0012c/README.md +++ /dev/null @@ -1,53 +0,0 @@ -## RMLSTC0012c - -**Title**: Complex XML source - -**Description**: Tests the generation of triples from complex XML sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments/department/employees"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{../../../@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:employee; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "employee/name"; - ]; - ]. - -``` - -**Output** -``` - "Bob Smith" . - "Eve Davis" . - "Sarah Lee" . - "Liam Brown" . - "Olivia Martinez" . - "Sophia White" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0012c/companies.xml b/src/test/resources/rml-io/RMLSTC0012c/companies.xml deleted file mode 100644 index 6cf391e..0000000 --- a/src/test/resources/rml-io/RMLSTC0012c/companies.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - TechCorp - - USA - California - San Francisco - - - - Engineering - - Alice Johnson - 42 - - - - Bob Smith - Software Engineer - - Python - JavaScript - AWS - - - - Eve Davis - DevOps Engineer - - Docker - Kubernetes - Terraform - - - - - - Marketing - - John Doe - 39 - - - - Sarah Lee - Marketing Specialist - - SEO - Google Ads - Copywriting - - - - - - - - InnovateX - - Canada - Ontario - Toronto - - - - Research & Development - - Emma Wilson - 45 - - - - Liam Brown - AI Researcher - - Machine Learning - Deep Learning - Python - - - - Sophia White - Data Scientist - - Data Analysis - R - SQL - - - - - - Sales - - Michael Green - 38 - - - - Olivia Martinez - Sales Executive - - Negotiation - CRM - Lead Generation - - - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012c/default.nq b/src/test/resources/rml-io/RMLSTC0012c/default.nq deleted file mode 100644 index e7dab8b..0000000 --- a/src/test/resources/rml-io/RMLSTC0012c/default.nq +++ /dev/null @@ -1,6 +0,0 @@ - "Bob Smith" . - "Eve Davis" . - "Sarah Lee" . - "Liam Brown" . - "Olivia Martinez" . - "Sophia White" . diff --git a/src/test/resources/rml-io/RMLSTC0012c/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012c/mapping.ttl deleted file mode 100644 index 5388d75..0000000 --- a/src/test/resources/rml-io/RMLSTC0012c/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments/department/employees"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{../../../@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:employee; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "employee/name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0012d/README.md b/src/test/resources/rml-io/RMLSTC0012d/README.md deleted file mode 100644 index a322b1a..0000000 --- a/src/test/resources/rml-io/RMLSTC0012d/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## RMLSTC0012d - -**Title**: Complex XML source - -**Description**: Tests the generation of triples from complex XML sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments/department"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{../../@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:manager; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "manager/name"; - ]; - ]. - -``` - -**Output** -``` - "Alice Johnson" . - "John Doe" . - "Emma Wilson" . - "Michael Green" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0012d/companies.xml b/src/test/resources/rml-io/RMLSTC0012d/companies.xml deleted file mode 100644 index 6cf391e..0000000 --- a/src/test/resources/rml-io/RMLSTC0012d/companies.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - TechCorp - - USA - California - San Francisco - - - - Engineering - - Alice Johnson - 42 - - - - Bob Smith - Software Engineer - - Python - JavaScript - AWS - - - - Eve Davis - DevOps Engineer - - Docker - Kubernetes - Terraform - - - - - - Marketing - - John Doe - 39 - - - - Sarah Lee - Marketing Specialist - - SEO - Google Ads - Copywriting - - - - - - - - InnovateX - - Canada - Ontario - Toronto - - - - Research & Development - - Emma Wilson - 45 - - - - Liam Brown - AI Researcher - - Machine Learning - Deep Learning - Python - - - - Sophia White - Data Scientist - - Data Analysis - R - SQL - - - - - - Sales - - Michael Green - 38 - - - - Olivia Martinez - Sales Executive - - Negotiation - CRM - Lead Generation - - - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012d/default.nq b/src/test/resources/rml-io/RMLSTC0012d/default.nq deleted file mode 100644 index 13a0c58..0000000 --- a/src/test/resources/rml-io/RMLSTC0012d/default.nq +++ /dev/null @@ -1,4 +0,0 @@ - "Alice Johnson" . - "John Doe" . - "Emma Wilson" . - "Michael Green" . diff --git a/src/test/resources/rml-io/RMLSTC0012d/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012d/mapping.ttl deleted file mode 100644 index a97be77..0000000 --- a/src/test/resources/rml-io/RMLSTC0012d/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments/department"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{../../@id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:manager; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "manager/name"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLSTC0012e/README.md b/src/test/resources/rml-io/RMLSTC0012e/README.md deleted file mode 100644 index 436b7cc..0000000 --- a/src/test/resources/rml-io/RMLSTC0012e/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLSTC0012e - -**Title**: Complex XML source - -**Description**: Tests the generation of triples from complex XML sources - -**Error expected?** No - -**Input** - [http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json](http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json) - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments/department/employees/employee"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:skill; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "skills/skill"; - ]; - ]. - -``` - -**Output** -``` - "AWS" . - "JavaScript" . - "Python" . - "Docker" . - "Kubernetes" . - "Terraform" . - "Deep Learning" . - "Machine Learning" . - "Python" . - "CRM" . - "Lead Generation" . - "Negotiation" . - "Copywriting" . - "Google Ads" . - "SEO" . - "Data Analysis" . - "R" . - "SQL" . - -``` - diff --git a/src/test/resources/rml-io/RMLSTC0012e/companies.xml b/src/test/resources/rml-io/RMLSTC0012e/companies.xml deleted file mode 100644 index 6cf391e..0000000 --- a/src/test/resources/rml-io/RMLSTC0012e/companies.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - TechCorp - - USA - California - San Francisco - - - - Engineering - - Alice Johnson - 42 - - - - Bob Smith - Software Engineer - - Python - JavaScript - AWS - - - - Eve Davis - DevOps Engineer - - Docker - Kubernetes - Terraform - - - - - - Marketing - - John Doe - 39 - - - - Sarah Lee - Marketing Specialist - - SEO - Google Ads - Copywriting - - - - - - - - InnovateX - - Canada - Ontario - Toronto - - - - Research & Development - - Emma Wilson - 45 - - - - Liam Brown - AI Researcher - - Machine Learning - Deep Learning - Python - - - - Sophia White - Data Scientist - - Data Analysis - R - SQL - - - - - - Sales - - Michael Green - 38 - - - - Olivia Martinez - Sales Executive - - Negotiation - CRM - Lead Generation - - - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLSTC0012e/default.nq b/src/test/resources/rml-io/RMLSTC0012e/default.nq deleted file mode 100644 index 9403b1f..0000000 --- a/src/test/resources/rml-io/RMLSTC0012e/default.nq +++ /dev/null @@ -1,18 +0,0 @@ - "AWS" . - "JavaScript" . - "Python" . - "Docker" . - "Kubernetes" . - "Terraform" . - "Deep Learning" . - "Machine Learning" . - "Python" . - "CRM" . - "Lead Generation" . - "Negotiation" . - "Copywriting" . - "Google Ads" . - "SEO" . - "Data Analysis" . - "R" . - "SQL" . diff --git a/src/test/resources/rml-io/RMLSTC0012e/mapping.ttl b/src/test/resources/rml-io/RMLSTC0012e/mapping.ttl deleted file mode 100644 index 91af0f2..0000000 --- a/src/test/resources/rml-io/RMLSTC0012e/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "companies.xml"; - ]; - rml:referenceFormulation rml:XPath; - rml:iterator "/companies/company/departments/department/employees/employee"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{name}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant ex:skill; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "skills/skill"; - ]; - ]. diff --git a/src/test/resources/rml-io/RMLTTC0000/Friends.json b/src/test/resources/rml-io/RMLTTC0000/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0000/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0000/README.md b/src/test/resources/rml-io/RMLTTC0000/README.md deleted file mode 100644 index f7669db..0000000 --- a/src/test/resources/rml-io/RMLTTC0000/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLTTC0000 - -**Title**: Default target - -**Description**: Test exporting all triples to the default Target when not Targets are specified. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -``` - -**Output** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0000/default.nq b/src/test/resources/rml-io/RMLTTC0000/default.nq deleted file mode 100644 index 63f28ff..0000000 --- a/src/test/resources/rml-io/RMLTTC0000/default.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33"^^ . - "Monica Geller" . - "34"^^ . - "Rachel Green" . - "35"^^ . - "Joey Tribbiani" . - "36"^^ . - "Chandler Bing" . - "37"^^ . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0000/mapping.ttl b/src/test/resources/rml-io/RMLTTC0000/mapping.ttl deleted file mode 100644 index 00a2f99..0000000 --- a/src/test/resources/rml-io/RMLTTC0000/mapping.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - rml:encoding rml:UTF-8 - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. diff --git a/src/test/resources/rml-io/RMLTTC0001a/Friends.json b/src/test/resources/rml-io/RMLTTC0001a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0001a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0001a/README.md b/src/test/resources/rml-io/RMLTTC0001a/README.md deleted file mode 100644 index 34fa66d..0000000 --- a/src/test/resources/rml-io/RMLTTC0001a/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0001a - -**Title**: Single Target: Subject Map - -**Description**: Test exporting all triples to a single Target with a given subject. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0001a/default.nq b/src/test/resources/rml-io/RMLTTC0001a/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0001a/dump1.nq b/src/test/resources/rml-io/RMLTTC0001a/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0001a/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0001a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001a/mapping.ttl deleted file mode 100644 index a6215d4..0000000 --- a/src/test/resources/rml-io/RMLTTC0001a/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0001b/Friends.json b/src/test/resources/rml-io/RMLTTC0001b/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0001b/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0001b/README.md b/src/test/resources/rml-io/RMLTTC0001b/README.md deleted file mode 100644 index 009ff1d..0000000 --- a/src/test/resources/rml-io/RMLTTC0001b/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0001b - -**Title**: Single Target: Predicate Map - -**Description**: Test exporting all triples to a single Target with a given predicate. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - "33". - "34". - "35". - "36". - "37". - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0001b/default.nq b/src/test/resources/rml-io/RMLTTC0001b/default.nq deleted file mode 100644 index f2e60c8..0000000 --- a/src/test/resources/rml-io/RMLTTC0001b/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0001b/dump1.nq b/src/test/resources/rml-io/RMLTTC0001b/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0001b/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0001b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001b/mapping.ttl deleted file mode 100644 index ac7eea7..0000000 --- a/src/test/resources/rml-io/RMLTTC0001b/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0001c/Friends.json b/src/test/resources/rml-io/RMLTTC0001c/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0001c/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0001c/README.md b/src/test/resources/rml-io/RMLTTC0001c/README.md deleted file mode 100644 index eb3ac75..0000000 --- a/src/test/resources/rml-io/RMLTTC0001c/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0001c - -**Title**: Single Target: Object Map - -**Description**: Test exporting all triples to a single Target with a given object reference. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - "33". - "34". - "35". - "36". - "37". - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0001c/default.nq b/src/test/resources/rml-io/RMLTTC0001c/default.nq deleted file mode 100644 index f2e60c8..0000000 --- a/src/test/resources/rml-io/RMLTTC0001c/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0001c/dump1.nq b/src/test/resources/rml-io/RMLTTC0001c/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0001c/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0001c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001c/mapping.ttl deleted file mode 100644 index 3b58386..0000000 --- a/src/test/resources/rml-io/RMLTTC0001c/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0001d/Friends.json b/src/test/resources/rml-io/RMLTTC0001d/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0001d/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0001d/README.md b/src/test/resources/rml-io/RMLTTC0001d/README.md deleted file mode 100644 index 8657705..0000000 --- a/src/test/resources/rml-io/RMLTTC0001d/README.md +++ /dev/null @@ -1,113 +0,0 @@ -## RMLTTC0001d - -**Title**: Single Target: Graph Map - -**Description**: Test exporting all triples within a named graph to a single Target. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0001d/default.nq b/src/test/resources/rml-io/RMLTTC0001d/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0001d/dump1.nq b/src/test/resources/rml-io/RMLTTC0001d/dump1.nq deleted file mode 100644 index adcefd0..0000000 --- a/src/test/resources/rml-io/RMLTTC0001d/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0001d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001d/mapping.ttl deleted file mode 100644 index 40b34da..0000000 --- a/src/test/resources/rml-io/RMLTTC0001d/mapping.ttl +++ /dev/null @@ -1,48 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0001e/Friends.json b/src/test/resources/rml-io/RMLTTC0001e/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0001e/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0001e/README.md b/src/test/resources/rml-io/RMLTTC0001e/README.md deleted file mode 100644 index ae87dfe..0000000 --- a/src/test/resources/rml-io/RMLTTC0001e/README.md +++ /dev/null @@ -1,111 +0,0 @@ -## RMLTTC0001e - -**Title**: Single Target: Language Map - -**Description**: Test exporting all triples with a given language tag to a single Target. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - "33". - "34". - "35". - "36". - "37". - -``` - -**Output 2** -``` - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0001e/default.nq b/src/test/resources/rml-io/RMLTTC0001e/default.nq deleted file mode 100644 index f2e60c8..0000000 --- a/src/test/resources/rml-io/RMLTTC0001e/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0001e/dump1.nq b/src/test/resources/rml-io/RMLTTC0001e/dump1.nq deleted file mode 100644 index 8f081be..0000000 --- a/src/test/resources/rml-io/RMLTTC0001e/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . diff --git a/src/test/resources/rml-io/RMLTTC0001e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001e/mapping.ttl deleted file mode 100644 index 51a5bbf..0000000 --- a/src/test/resources/rml-io/RMLTTC0001e/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0001f/Friends.json b/src/test/resources/rml-io/RMLTTC0001f/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0001f/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0001f/README.md b/src/test/resources/rml-io/RMLTTC0001f/README.md deleted file mode 100644 index 1fb6a2b..0000000 --- a/src/test/resources/rml-io/RMLTTC0001f/README.md +++ /dev/null @@ -1,112 +0,0 @@ -## RMLTTC0001f - -**Title**: Single Target: Datatype Map - -**Description**: Test exporting all triples with a given datatype to a single Target. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 2** -``` - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0001f/default.nq b/src/test/resources/rml-io/RMLTTC0001f/default.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0001f/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0001f/dump1.nq b/src/test/resources/rml-io/RMLTTC0001f/dump1.nq deleted file mode 100644 index f2e60c8..0000000 --- a/src/test/resources/rml-io/RMLTTC0001f/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0001f/mapping.ttl b/src/test/resources/rml-io/RMLTTC0001f/mapping.ttl deleted file mode 100644 index e8f8fac..0000000 --- a/src/test/resources/rml-io/RMLTTC0001f/mapping.ttl +++ /dev/null @@ -1,47 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002a/Friends.json b/src/test/resources/rml-io/RMLTTC0002a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002a/README.md b/src/test/resources/rml-io/RMLTTC0002a/README.md deleted file mode 100644 index 299577a..0000000 --- a/src/test/resources/rml-io/RMLTTC0002a/README.md +++ /dev/null @@ -1,132 +0,0 @@ -## RMLTTC0002a - -**Title**: Multiple Targets: Same Term Map - -**Description**: Test exporting all triples to multiple Targets in the same Term Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002a/default.nq b/src/test/resources/rml-io/RMLTTC0002a/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002a/dump1.nq b/src/test/resources/rml-io/RMLTTC0002a/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0002a/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002a/dump2.nq b/src/test/resources/rml-io/RMLTTC0002a/dump2.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0002a/dump2.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002a/mapping.ttl deleted file mode 100644 index a6647f3..0000000 --- a/src/test/resources/rml-io/RMLTTC0002a/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002b/Friends.json b/src/test/resources/rml-io/RMLTTC0002b/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002b/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002b/README.md b/src/test/resources/rml-io/RMLTTC0002b/README.md deleted file mode 100644 index f24589b..0000000 --- a/src/test/resources/rml-io/RMLTTC0002b/README.md +++ /dev/null @@ -1,127 +0,0 @@ -## RMLTTC0002b - -**Title**: Multiple Targets: Subject Map and Predicate Map - -**Description**: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump2>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002b/default.nq b/src/test/resources/rml-io/RMLTTC0002b/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002b/dump1.nq b/src/test/resources/rml-io/RMLTTC0002b/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0002b/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002b/dump2.nq b/src/test/resources/rml-io/RMLTTC0002b/dump2.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0002b/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002b/mapping.ttl deleted file mode 100644 index d218116..0000000 --- a/src/test/resources/rml-io/RMLTTC0002b/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump2>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002c/Friends.json b/src/test/resources/rml-io/RMLTTC0002c/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002c/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002c/README.md b/src/test/resources/rml-io/RMLTTC0002c/README.md deleted file mode 100644 index e1c45b0..0000000 --- a/src/test/resources/rml-io/RMLTTC0002c/README.md +++ /dev/null @@ -1,127 +0,0 @@ -## RMLTTC0002c - -**Title**: Multiple Targets: Subject Map and Object Map - -**Description**: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002c/default.nq b/src/test/resources/rml-io/RMLTTC0002c/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002c/dump1.nq b/src/test/resources/rml-io/RMLTTC0002c/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0002c/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002c/dump2.nq b/src/test/resources/rml-io/RMLTTC0002c/dump2.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0002c/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002c/mapping.ttl deleted file mode 100644 index d5466bd..0000000 --- a/src/test/resources/rml-io/RMLTTC0002c/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002d/Friends.json b/src/test/resources/rml-io/RMLTTC0002d/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002d/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002d/README.md b/src/test/resources/rml-io/RMLTTC0002d/README.md deleted file mode 100644 index 76f1adf..0000000 --- a/src/test/resources/rml-io/RMLTTC0002d/README.md +++ /dev/null @@ -1,122 +0,0 @@ -## RMLTTC0002d - -**Title**: Multiple Targets: Predicate Map and Object Map - -**Description**: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002d/default.nq b/src/test/resources/rml-io/RMLTTC0002d/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002d/dump1.nq b/src/test/resources/rml-io/RMLTTC0002d/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002d/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002d/dump2.nq b/src/test/resources/rml-io/RMLTTC0002d/dump2.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0002d/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002d/mapping.ttl deleted file mode 100644 index c383356..0000000 --- a/src/test/resources/rml-io/RMLTTC0002d/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002e/Friends.json b/src/test/resources/rml-io/RMLTTC0002e/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002e/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002e/README.md b/src/test/resources/rml-io/RMLTTC0002e/README.md deleted file mode 100644 index 7334649..0000000 --- a/src/test/resources/rml-io/RMLTTC0002e/README.md +++ /dev/null @@ -1,131 +0,0 @@ -## RMLTTC0002e - -**Title**: Multiple Targets: Subject Map, Predicate Map, and Object Map - -**Description**: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump3>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump3> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump3.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002e/default.nq b/src/test/resources/rml-io/RMLTTC0002e/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002e/dump1.nq b/src/test/resources/rml-io/RMLTTC0002e/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002e/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002e/dump2.nq b/src/test/resources/rml-io/RMLTTC0002e/dump2.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0002e/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002e/dump3.nq b/src/test/resources/rml-io/RMLTTC0002e/dump3.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0002e/dump3.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002e/mapping.ttl deleted file mode 100644 index 9b7a967..0000000 --- a/src/test/resources/rml-io/RMLTTC0002e/mapping.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump3>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump3> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump3.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002f/Friends.json b/src/test/resources/rml-io/RMLTTC0002f/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002f/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002f/README.md b/src/test/resources/rml-io/RMLTTC0002f/README.md deleted file mode 100644 index 3e48018..0000000 --- a/src/test/resources/rml-io/RMLTTC0002f/README.md +++ /dev/null @@ -1,131 +0,0 @@ -## RMLTTC0002f - -**Title**: Multiple Targets: Subject Map and Graph Map - -**Description**: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - -**Output 3** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002f/default.nq b/src/test/resources/rml-io/RMLTTC0002f/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002f/dump1.nq b/src/test/resources/rml-io/RMLTTC0002f/dump1.nq deleted file mode 100644 index 0cbc7f5..0000000 --- a/src/test/resources/rml-io/RMLTTC0002f/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002f/dump2.nq b/src/test/resources/rml-io/RMLTTC0002f/dump2.nq deleted file mode 100644 index 488d76f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002f/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002f/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002f/mapping.ttl deleted file mode 100644 index 1e4138b..0000000 --- a/src/test/resources/rml-io/RMLTTC0002f/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002g/Friends.json b/src/test/resources/rml-io/RMLTTC0002g/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002g/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002g/README.md b/src/test/resources/rml-io/RMLTTC0002g/README.md deleted file mode 100644 index 957cf96..0000000 --- a/src/test/resources/rml-io/RMLTTC0002g/README.md +++ /dev/null @@ -1,126 +0,0 @@ -## RMLTTC0002g - -**Title**: Multiple Targets: Predicate Map and Graph Map - -**Description**: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - -**Output 3** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002g/default.nq b/src/test/resources/rml-io/RMLTTC0002g/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002g/dump1.nq b/src/test/resources/rml-io/RMLTTC0002g/dump1.nq deleted file mode 100644 index 42e9dfe..0000000 --- a/src/test/resources/rml-io/RMLTTC0002g/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002g/dump2.nq b/src/test/resources/rml-io/RMLTTC0002g/dump2.nq deleted file mode 100644 index 488d76f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002g/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002g/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002g/mapping.ttl deleted file mode 100644 index a6b87c5..0000000 --- a/src/test/resources/rml-io/RMLTTC0002g/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002h/Friends.json b/src/test/resources/rml-io/RMLTTC0002h/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002h/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002h/README.md b/src/test/resources/rml-io/RMLTTC0002h/README.md deleted file mode 100644 index 878af28..0000000 --- a/src/test/resources/rml-io/RMLTTC0002h/README.md +++ /dev/null @@ -1,126 +0,0 @@ -## RMLTTC0002h - -**Title**: Multiple Targets: Object Map and Graph Map - -**Description**: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - -**Output 3** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002h/default.nq b/src/test/resources/rml-io/RMLTTC0002h/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002h/dump1.nq b/src/test/resources/rml-io/RMLTTC0002h/dump1.nq deleted file mode 100644 index 42e9dfe..0000000 --- a/src/test/resources/rml-io/RMLTTC0002h/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002h/dump2.nq b/src/test/resources/rml-io/RMLTTC0002h/dump2.nq deleted file mode 100644 index 488d76f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002h/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002h/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002h/mapping.ttl deleted file mode 100644 index ced88d8..0000000 --- a/src/test/resources/rml-io/RMLTTC0002h/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002i/Friends.json b/src/test/resources/rml-io/RMLTTC0002i/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002i/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002i/README.md b/src/test/resources/rml-io/RMLTTC0002i/README.md deleted file mode 100644 index 371a4cc..0000000 --- a/src/test/resources/rml-io/RMLTTC0002i/README.md +++ /dev/null @@ -1,129 +0,0 @@ -## RMLTTC0002i - -**Title**: Multiple Targets: Language Map and Graph Map - -**Description**: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - -**Output 3** -``` - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002i/default.nq b/src/test/resources/rml-io/RMLTTC0002i/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002i/dump1.nq b/src/test/resources/rml-io/RMLTTC0002i/dump1.nq deleted file mode 100644 index fb4f3a4..0000000 --- a/src/test/resources/rml-io/RMLTTC0002i/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002i/dump2.nq b/src/test/resources/rml-io/RMLTTC0002i/dump2.nq deleted file mode 100644 index 8f081be..0000000 --- a/src/test/resources/rml-io/RMLTTC0002i/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . diff --git a/src/test/resources/rml-io/RMLTTC0002i/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002i/mapping.ttl deleted file mode 100644 index a5af0ef..0000000 --- a/src/test/resources/rml-io/RMLTTC0002i/mapping.ttl +++ /dev/null @@ -1,59 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002j/Friends.json b/src/test/resources/rml-io/RMLTTC0002j/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002j/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002j/README.md b/src/test/resources/rml-io/RMLTTC0002j/README.md deleted file mode 100644 index 0838260..0000000 --- a/src/test/resources/rml-io/RMLTTC0002j/README.md +++ /dev/null @@ -1,126 +0,0 @@ -## RMLTTC0002j - -**Title**: Multiple Targets: Language Map and Object Map - -**Description**: Test exporting all triples to a Target in a Language Map and a Target in a Object Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - -**Output 3** -``` - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002j/default.nq b/src/test/resources/rml-io/RMLTTC0002j/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002j/dump1.nq b/src/test/resources/rml-io/RMLTTC0002j/dump1.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0002j/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002j/dump2.nq b/src/test/resources/rml-io/RMLTTC0002j/dump2.nq deleted file mode 100644 index 8f081be..0000000 --- a/src/test/resources/rml-io/RMLTTC0002j/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . diff --git a/src/test/resources/rml-io/RMLTTC0002j/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002j/mapping.ttl deleted file mode 100644 index fd7f142..0000000 --- a/src/test/resources/rml-io/RMLTTC0002j/mapping.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002k/Friends.json b/src/test/resources/rml-io/RMLTTC0002k/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002k/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002k/README.md b/src/test/resources/rml-io/RMLTTC0002k/README.md deleted file mode 100644 index 656b5cb..0000000 --- a/src/test/resources/rml-io/RMLTTC0002k/README.md +++ /dev/null @@ -1,135 +0,0 @@ -## RMLTTC0002k - -**Title**: Multiple Targets: Datatype Map and Graph Map - -**Description**: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . - -``` - -**Output 2** -``` - "33"^^ . - "34"^^ . - "35"^^ . - "36"^^ . - "37"^^ . - -``` - -**Output 3** -``` - "33"^^ . - "34"^^ . - "35"^^ . - "36"^^ . - "37"^^ . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002k/default.nq b/src/test/resources/rml-io/RMLTTC0002k/default.nq deleted file mode 100644 index 250e23c..0000000 --- a/src/test/resources/rml-io/RMLTTC0002k/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . diff --git a/src/test/resources/rml-io/RMLTTC0002k/dump1.nq b/src/test/resources/rml-io/RMLTTC0002k/dump1.nq deleted file mode 100644 index b92731f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002k/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^ . - "34"^^ . - "35"^^ . - "36"^^ . - "37"^^ . diff --git a/src/test/resources/rml-io/RMLTTC0002k/dump2.nq b/src/test/resources/rml-io/RMLTTC0002k/dump2.nq deleted file mode 100644 index b92731f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002k/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^ . - "34"^^ . - "35"^^ . - "36"^^ . - "37"^^ . diff --git a/src/test/resources/rml-io/RMLTTC0002k/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002k/mapping.ttl deleted file mode 100644 index 17dcb83..0000000 --- a/src/test/resources/rml-io/RMLTTC0002k/mapping.ttl +++ /dev/null @@ -1,60 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002l/Friends.json b/src/test/resources/rml-io/RMLTTC0002l/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002l/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002l/README.md b/src/test/resources/rml-io/RMLTTC0002l/README.md deleted file mode 100644 index c688f6d..0000000 --- a/src/test/resources/rml-io/RMLTTC0002l/README.md +++ /dev/null @@ -1,127 +0,0 @@ -## RMLTTC0002l - -**Title**: Multiple Targets: Datatype Map and Object Map - -**Description**: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33"^^ . - "34"^^ . - "35"^^ . - "36"^^ . - "37"^^ . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002l/default.nq b/src/test/resources/rml-io/RMLTTC0002l/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002l/dump1.nq b/src/test/resources/rml-io/RMLTTC0002l/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002l/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002l/dump2.nq b/src/test/resources/rml-io/RMLTTC0002l/dump2.nq deleted file mode 100644 index c3eeab3..0000000 --- a/src/test/resources/rml-io/RMLTTC0002l/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^ . - "34"^^ . - "35"^^ . - "36"^^ . - "37"^^ . diff --git a/src/test/resources/rml-io/RMLTTC0002l/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002l/mapping.ttl deleted file mode 100644 index 9fae6b4..0000000 --- a/src/test/resources/rml-io/RMLTTC0002l/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix xsd: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002m/Friends.json b/src/test/resources/rml-io/RMLTTC0002m/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002m/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002m/README.md b/src/test/resources/rml-io/RMLTTC0002m/README.md deleted file mode 100644 index 6727d98..0000000 --- a/src/test/resources/rml-io/RMLTTC0002m/README.md +++ /dev/null @@ -1,122 +0,0 @@ -## RMLTTC0002m - -**Title**: Multiple Targets: Multiple Predicate Maps - -**Description**: Test exporting all triples to Targets in multiple Predicate Maps. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump2>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002m/default.nq b/src/test/resources/rml-io/RMLTTC0002m/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002m/dump1.nq b/src/test/resources/rml-io/RMLTTC0002m/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002m/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002m/dump2.nq b/src/test/resources/rml-io/RMLTTC0002m/dump2.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0002m/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002m/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002m/mapping.ttl deleted file mode 100644 index d3fd84f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002m/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump2>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002n/Friends.json b/src/test/resources/rml-io/RMLTTC0002n/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002n/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002n/README.md b/src/test/resources/rml-io/RMLTTC0002n/README.md deleted file mode 100644 index e0a1076..0000000 --- a/src/test/resources/rml-io/RMLTTC0002n/README.md +++ /dev/null @@ -1,122 +0,0 @@ -## RMLTTC0002n - -**Title**: Multiple Targets: Multiple Object Maps - -**Description**: Test exporting all triples to Targets in multiple Object Maps. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002n/default.nq b/src/test/resources/rml-io/RMLTTC0002n/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002n/dump1.nq b/src/test/resources/rml-io/RMLTTC0002n/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002n/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002n/dump2.nq b/src/test/resources/rml-io/RMLTTC0002n/dump2.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0002n/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002n/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002n/mapping.ttl deleted file mode 100644 index 6371637..0000000 --- a/src/test/resources/rml-io/RMLTTC0002n/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002o/Friends.json b/src/test/resources/rml-io/RMLTTC0002o/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002o/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002o/README.md b/src/test/resources/rml-io/RMLTTC0002o/README.md deleted file mode 100644 index 67d69c4..0000000 --- a/src/test/resources/rml-io/RMLTTC0002o/README.md +++ /dev/null @@ -1,134 +0,0 @@ -## RMLTTC0002o - -**Title**: Multiple Targets: Multiple Graph Maps - -**Description**: Test exporting all triples to Targets in multiple Graph Maps. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph1; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph2; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - -**Output 3** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002o/default.nq b/src/test/resources/rml-io/RMLTTC0002o/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002o/dump1.nq b/src/test/resources/rml-io/RMLTTC0002o/dump1.nq deleted file mode 100644 index b5a5e2b..0000000 --- a/src/test/resources/rml-io/RMLTTC0002o/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002o/dump2.nq b/src/test/resources/rml-io/RMLTTC0002o/dump2.nq deleted file mode 100644 index 61c543c..0000000 --- a/src/test/resources/rml-io/RMLTTC0002o/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002o/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002o/mapping.ttl deleted file mode 100644 index 7ffad94..0000000 --- a/src/test/resources/rml-io/RMLTTC0002o/mapping.ttl +++ /dev/null @@ -1,60 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix dcat: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph1; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - rml:graphMap [ a rml:GraphMap; - rml:constant ex:PeopleGraph2; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. \ No newline at end of file diff --git a/src/test/resources/rml-io/RMLTTC0002p/Friends.json b/src/test/resources/rml-io/RMLTTC0002p/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002p/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002p/README.md b/src/test/resources/rml-io/RMLTTC0002p/README.md deleted file mode 100644 index 8975f25..0000000 --- a/src/test/resources/rml-io/RMLTTC0002p/README.md +++ /dev/null @@ -1,141 +0,0 @@ -## RMLTTC0002p - -**Title**: Multiple Targets: Multiple Language Maps - -**Description**: Test exporting all triples to Targets in multiple Language Maps. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "nl"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - "33". - "34". - "35". - "36". - "37". - -``` - -**Output 2** -``` - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . - -``` - -**Output 3** -``` - "Monica Geller"@nl . - "Rachel Green"@nl . - "Joey Tribbiani"@nl . - "Chandler Bing"@nl . - "Ross Geller"@nl . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002p/default.nq b/src/test/resources/rml-io/RMLTTC0002p/default.nq deleted file mode 100644 index f2e60c8..0000000 --- a/src/test/resources/rml-io/RMLTTC0002p/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0002p/dump1.nq b/src/test/resources/rml-io/RMLTTC0002p/dump1.nq deleted file mode 100644 index 8f081be..0000000 --- a/src/test/resources/rml-io/RMLTTC0002p/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller"@en . - "Rachel Green"@en . - "Joey Tribbiani"@en . - "Chandler Bing"@en . - "Ross Geller"@en . diff --git a/src/test/resources/rml-io/RMLTTC0002p/dump2.nq b/src/test/resources/rml-io/RMLTTC0002p/dump2.nq deleted file mode 100644 index e6de67d..0000000 --- a/src/test/resources/rml-io/RMLTTC0002p/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller"@nl . - "Rachel Green"@nl . - "Joey Tribbiani"@nl . - "Chandler Bing"@nl . - "Ross Geller"@nl . diff --git a/src/test/resources/rml-io/RMLTTC0002p/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002p/mapping.ttl deleted file mode 100644 index b7d772e..0000000 --- a/src/test/resources/rml-io/RMLTTC0002p/mapping.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "en"; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - rml:languageMap [ a rml:LanguageMap; - rml:constant "nl"; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002q/Friends.json b/src/test/resources/rml-io/RMLTTC0002q/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002q/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002q/README.md b/src/test/resources/rml-io/RMLTTC0002q/README.md deleted file mode 100644 index e173efb..0000000 --- a/src/test/resources/rml-io/RMLTTC0002q/README.md +++ /dev/null @@ -1,142 +0,0 @@ -## RMLTTC0002q - -**Title**: Multiple Targets: Multiple Datatype Maps - -**Description**: Test exporting all triples to Targets in multiple Datatype Maps. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:double; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 2** -``` - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. - -``` - -**Output 3** -``` - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002q/default.nq b/src/test/resources/rml-io/RMLTTC0002q/default.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0002q/default.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0002q/dump1.nq b/src/test/resources/rml-io/RMLTTC0002q/dump1.nq deleted file mode 100644 index f2e60c8..0000000 --- a/src/test/resources/rml-io/RMLTTC0002q/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0002q/dump2.nq b/src/test/resources/rml-io/RMLTTC0002q/dump2.nq deleted file mode 100644 index 1cebdfc..0000000 --- a/src/test/resources/rml-io/RMLTTC0002q/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33"^^. - "34"^^. - "35"^^. - "36"^^. - "37"^^. diff --git a/src/test/resources/rml-io/RMLTTC0002q/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002q/mapping.ttl deleted file mode 100644 index a049f6d..0000000 --- a/src/test/resources/rml-io/RMLTTC0002q/mapping.ttl +++ /dev/null @@ -1,67 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix xsd: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:integer; - rml:logicalTarget <#TargetDump1>; - ]; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - rml:datatypeMap [ a rml:DatatypeMap; - rml:constant xsd:double; - rml:logicalTarget <#TargetDump2>; - ]; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0002r/Friends.json b/src/test/resources/rml-io/RMLTTC0002r/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0002r/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0002r/README.md b/src/test/resources/rml-io/RMLTTC0002r/README.md deleted file mode 100644 index 06d17ff..0000000 --- a/src/test/resources/rml-io/RMLTTC0002r/README.md +++ /dev/null @@ -1,109 +0,0 @@ -## RMLTTC0002r - -**Title**: Multiple Targets: Multiple Term Maps with same Target - -**Description**: Test exporting all triples to same Target in multiple Term Maps. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0002r/default.nq b/src/test/resources/rml-io/RMLTTC0002r/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0002r/dump1.nq b/src/test/resources/rml-io/RMLTTC0002r/dump1.nq deleted file mode 100644 index 3624750..0000000 --- a/src/test/resources/rml-io/RMLTTC0002r/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0002r/mapping.ttl b/src/test/resources/rml-io/RMLTTC0002r/mapping.ttl deleted file mode 100644 index 97dfc61..0000000 --- a/src/test/resources/rml-io/RMLTTC0002r/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - rml:logicalTarget <#TargetDump1>; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0003a/Friends.json b/src/test/resources/rml-io/RMLTTC0003a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0003a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0003a/README.md b/src/test/resources/rml-io/RMLTTC0003a/README.md deleted file mode 100644 index 6144767..0000000 --- a/src/test/resources/rml-io/RMLTTC0003a/README.md +++ /dev/null @@ -1,136 +0,0 @@ -## RMLTTC0003a - -**Title**: Overriding Targets: Seperate Triples Map - -**Description**: Test exporting some triples to a different Target with a separate Triples Map. - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - -``` - -**Output 3** -``` - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0003a/default.nq b/src/test/resources/rml-io/RMLTTC0003a/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0003a/dump1.nq b/src/test/resources/rml-io/RMLTTC0003a/dump1.nq deleted file mode 100644 index 3fc5c8f..0000000 --- a/src/test/resources/rml-io/RMLTTC0003a/dump1.nq +++ /dev/null @@ -1,5 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0003a/dump2.nq b/src/test/resources/rml-io/RMLTTC0003a/dump2.nq deleted file mode 100644 index 35a3950..0000000 --- a/src/test/resources/rml-io/RMLTTC0003a/dump2.nq +++ /dev/null @@ -1,5 +0,0 @@ - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0003a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0003a/mapping.ttl deleted file mode 100644 index 615f15e..0000000 --- a/src/test/resources/rml-io/RMLTTC0003a/mapping.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump2>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TriplesMap2> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -<#TargetDump2> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump2.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0004a/Friends.json b/src/test/resources/rml-io/RMLTTC0004a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0004a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0004a/README.md b/src/test/resources/rml-io/RMLTTC0004a/README.md deleted file mode 100644 index 1233d59..0000000 --- a/src/test/resources/rml-io/RMLTTC0004a/README.md +++ /dev/null @@ -1,131 +0,0 @@ -## RMLTTC0004a - -**Title**: Target JSON-LD - -**Description**: Test export all triples as JSON-LD - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.jsonld"; - ]; - rml:serialization formats:JSON-LD; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` -{ - "@context": { - "foaf": "http://xmlns.com/foaf/0.1/" - }, - "@graph": [ - { - - "@id": "http://example.org/0", - "foaf:name": "Monica Geller", - "foaf:age": "33" - }, - { - "@id": "http://example.org/1", - "foaf:name": "Rachel Green", - "foaf:age": "34" - }, - { - "@id": "http://example.org/2", - "foaf:name": "Joey Tribbiani", - "foaf:age": "35" - }, - { - "@id": "http://example.org/3", - "foaf:name": "Chandler Bing", - "foaf:age": "36" - }, - { - "@id": "http://example.org/4", - "foaf:name": "Ross Geller", - "foaf:age": "37" - } - ] -} - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0004a/default.nq b/src/test/resources/rml-io/RMLTTC0004a/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0004a/dump1.jsonld b/src/test/resources/rml-io/RMLTTC0004a/dump1.jsonld deleted file mode 100644 index 5bddb0d..0000000 --- a/src/test/resources/rml-io/RMLTTC0004a/dump1.jsonld +++ /dev/null @@ -1,33 +0,0 @@ -{ - "@context": { - "foaf": "http://xmlns.com/foaf/0.1/" - }, - "@graph": [ - { - - "@id": "http://example.org/0", - "foaf:name": "Monica Geller", - "foaf:age": "33" - }, - { - "@id": "http://example.org/1", - "foaf:name": "Rachel Green", - "foaf:age": "34" - }, - { - "@id": "http://example.org/2", - "foaf:name": "Joey Tribbiani", - "foaf:age": "35" - }, - { - "@id": "http://example.org/3", - "foaf:name": "Chandler Bing", - "foaf:age": "36" - }, - { - "@id": "http://example.org/4", - "foaf:name": "Ross Geller", - "foaf:age": "37" - } - ] -} diff --git a/src/test/resources/rml-io/RMLTTC0004a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004a/mapping.ttl deleted file mode 100644 index 7ed7673..0000000 --- a/src/test/resources/rml-io/RMLTTC0004a/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.jsonld"; - ]; - rml:serialization formats:JSON-LD; -. diff --git a/src/test/resources/rml-io/RMLTTC0004b/Friends.json b/src/test/resources/rml-io/RMLTTC0004b/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0004b/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0004b/README.md b/src/test/resources/rml-io/RMLTTC0004b/README.md deleted file mode 100644 index 86e5e6d..0000000 --- a/src/test/resources/rml-io/RMLTTC0004b/README.md +++ /dev/null @@ -1,110 +0,0 @@ -## RMLTTC0004b - -**Title**: Target N3 - -**Description**: Test export all triples as N3 - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.n3"; - ]; - rml:serialization formats:N3; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` -@prefix foaf: . -@prefix ex: . -ex:0 "33" ; - "Monica Geller" . -ex:1 "34" ; - "Rachel Green" . -ex:2 "35" ; - "Joey Tribbiani" . -ex:3 "36" ; - "Chandler Bing" . -ex:4 "37" ; - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0004b/default.nq b/src/test/resources/rml-io/RMLTTC0004b/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0004b/dump1.n3 b/src/test/resources/rml-io/RMLTTC0004b/dump1.n3 deleted file mode 100644 index 04c8977..0000000 --- a/src/test/resources/rml-io/RMLTTC0004b/dump1.n3 +++ /dev/null @@ -1,12 +0,0 @@ -@prefix foaf: . -@prefix ex: . -ex:0 "33" ; - "Monica Geller" . -ex:1 "34" ; - "Rachel Green" . -ex:2 "35" ; - "Joey Tribbiani" . -ex:3 "36" ; - "Chandler Bing" . -ex:4 "37" ; - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0004b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004b/mapping.ttl deleted file mode 100644 index 255349f..0000000 --- a/src/test/resources/rml-io/RMLTTC0004b/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.n3"; - ]; - rml:serialization formats:N3; -. diff --git a/src/test/resources/rml-io/RMLTTC0004c/Friends.json b/src/test/resources/rml-io/RMLTTC0004c/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0004c/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0004c/README.md b/src/test/resources/rml-io/RMLTTC0004c/README.md deleted file mode 100644 index 72e1b32..0000000 --- a/src/test/resources/rml-io/RMLTTC0004c/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0004c - -**Title**: Target N-Triples - -**Description**: Test export all triples as N-Triples - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nt"; - ]; - rml:serialization formats:N-Triples; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0004c/default.nq b/src/test/resources/rml-io/RMLTTC0004c/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0004c/dump1.nt b/src/test/resources/rml-io/RMLTTC0004c/dump1.nt deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0004c/dump1.nt +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0004c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004c/mapping.ttl deleted file mode 100644 index 30977d2..0000000 --- a/src/test/resources/rml-io/RMLTTC0004c/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nt"; - ]; - rml:serialization formats:N-Triples; -. diff --git a/src/test/resources/rml-io/RMLTTC0004d/Friends.json b/src/test/resources/rml-io/RMLTTC0004d/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0004d/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0004d/README.md b/src/test/resources/rml-io/RMLTTC0004d/README.md deleted file mode 100644 index 68b41db..0000000 --- a/src/test/resources/rml-io/RMLTTC0004d/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0004d - -**Title**: Target N-Quads - -**Description**: Test export all triples as N-Quads - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0004d/default.nq b/src/test/resources/rml-io/RMLTTC0004d/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0004d/dump1.nq b/src/test/resources/rml-io/RMLTTC0004d/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0004d/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0004d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004d/mapping.ttl deleted file mode 100644 index e2b4614..0000000 --- a/src/test/resources/rml-io/RMLTTC0004d/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0004e/Friends.json b/src/test/resources/rml-io/RMLTTC0004e/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0004e/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0004e/README.md b/src/test/resources/rml-io/RMLTTC0004e/README.md deleted file mode 100644 index 84c3c4c..0000000 --- a/src/test/resources/rml-io/RMLTTC0004e/README.md +++ /dev/null @@ -1,120 +0,0 @@ -## RMLTTC0004e - -**Title**: Target RDF/JSON - -**Description**: Test export all triples as RDF/JSON - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.rdfjson"; - ]; - rml:serialization formats:RDF_JSON; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` -{ - "http://example.org/0" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ] - }, - "http://example.org/1" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ] - }, - "http://example.org/2" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ] - }, - "http://example.org/3" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ] - }, - "http://example.org/4" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ] - } -} - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0004e/default.nq b/src/test/resources/rml-io/RMLTTC0004e/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0004e/dump1.rdfjson b/src/test/resources/rml-io/RMLTTC0004e/dump1.rdfjson deleted file mode 100644 index aff9b74..0000000 --- a/src/test/resources/rml-io/RMLTTC0004e/dump1.rdfjson +++ /dev/null @@ -1,22 +0,0 @@ -{ - "http://example.org/0" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ] - }, - "http://example.org/1" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ] - }, - "http://example.org/2" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ] - }, - "http://example.org/3" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ] - }, - "http://example.org/4" : { - "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ], - "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ] - } -} diff --git a/src/test/resources/rml-io/RMLTTC0004e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004e/mapping.ttl deleted file mode 100644 index c27fded..0000000 --- a/src/test/resources/rml-io/RMLTTC0004e/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.rdfjson"; - ]; - rml:serialization formats:RDF_JSON; -. diff --git a/src/test/resources/rml-io/RMLTTC0004f/Friends.json b/src/test/resources/rml-io/RMLTTC0004f/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0004f/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0004f/README.md b/src/test/resources/rml-io/RMLTTC0004f/README.md deleted file mode 100644 index 83c1259..0000000 --- a/src/test/resources/rml-io/RMLTTC0004f/README.md +++ /dev/null @@ -1,121 +0,0 @@ -## RMLTTC0004f - -**Title**: Target RDF/XML - -**Description**: Test export all triples as RDF/XML - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.rdfxml"; - ]; - rml:serialization formats:RDF_XML; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - - - 33 - Monica Geller - - - 34 - Rachel Green - - - 35 - Joey Tribbiani - - - 36 - Chandler Bing - - - 37 - Ross Geller - - - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0004f/default.nq b/src/test/resources/rml-io/RMLTTC0004f/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0004f/dump1.rdfxml b/src/test/resources/rml-io/RMLTTC0004f/dump1.rdfxml deleted file mode 100644 index 9e028bb..0000000 --- a/src/test/resources/rml-io/RMLTTC0004f/dump1.rdfxml +++ /dev/null @@ -1,23 +0,0 @@ - - - 33 - Monica Geller - - - 34 - Rachel Green - - - 35 - Joey Tribbiani - - - 36 - Chandler Bing - - - 37 - Ross Geller - - diff --git a/src/test/resources/rml-io/RMLTTC0004f/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004f/mapping.ttl deleted file mode 100644 index 4a100eb..0000000 --- a/src/test/resources/rml-io/RMLTTC0004f/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.rdfxml"; - ]; - rml:serialization formats:RDF_XML; -. diff --git a/src/test/resources/rml-io/RMLTTC0004g/Friends.json b/src/test/resources/rml-io/RMLTTC0004g/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0004g/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0004g/README.md b/src/test/resources/rml-io/RMLTTC0004g/README.md deleted file mode 100644 index f44425c..0000000 --- a/src/test/resources/rml-io/RMLTTC0004g/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0004g - -**Title**: Target Turtle - -**Description**: Test export all triples as Turtle - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.ttl"; - ]; - rml:serialization formats:Turtle; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - "33" . - "34" . - "35" . - "36" . - "37" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0004g/default.nq b/src/test/resources/rml-io/RMLTTC0004g/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0004g/dump1.ttl b/src/test/resources/rml-io/RMLTTC0004g/dump1.ttl deleted file mode 100644 index 2032b0f..0000000 --- a/src/test/resources/rml-io/RMLTTC0004g/dump1.ttl +++ /dev/null @@ -1,10 +0,0 @@ - "Monica Geller" . - "Rachel Green" . - "Joey Tribbiani" . - "Chandler Bing" . - "Ross Geller" . - "33" . - "34" . - "35" . - "36" . - "37" . diff --git a/src/test/resources/rml-io/RMLTTC0004g/mapping.ttl b/src/test/resources/rml-io/RMLTTC0004g/mapping.ttl deleted file mode 100644 index 7ebf102..0000000 --- a/src/test/resources/rml-io/RMLTTC0004g/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.ttl"; - ]; - rml:serialization formats:Turtle; -. diff --git a/src/test/resources/rml-io/RMLTTC0005a/Friends.json b/src/test/resources/rml-io/RMLTTC0005a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0005a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0005a/README.md b/src/test/resources/rml-io/RMLTTC0005a/README.md deleted file mode 100644 index 3e87f9b..0000000 --- a/src/test/resources/rml-io/RMLTTC0005a/README.md +++ /dev/null @@ -1,109 +0,0 @@ -## RMLTTC0005a - -**Title**: Target UTF-8 - -**Description**: Test export all triples with UTF-8 encoding - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; - rml:encoding rml:UTF-8; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0005a/default.nq b/src/test/resources/rml-io/RMLTTC0005a/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0005a/dump1.nq b/src/test/resources/rml-io/RMLTTC0005a/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0005a/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0005a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0005a/mapping.ttl deleted file mode 100644 index 8ec724a..0000000 --- a/src/test/resources/rml-io/RMLTTC0005a/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; - rml:encoding rml:UTF-8; -. diff --git a/src/test/resources/rml-io/RMLTTC0005b/Friends.json b/src/test/resources/rml-io/RMLTTC0005b/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0005b/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0005b/README.md b/src/test/resources/rml-io/RMLTTC0005b/README.md deleted file mode 100644 index 6f8b893..0000000 --- a/src/test/resources/rml-io/RMLTTC0005b/README.md +++ /dev/null @@ -1,109 +0,0 @@ -## RMLTTC0005b - -**Title**: Target UTF-16 - -**Description**: Test export all triples with UTF-16 encoding - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; - rml:encoding rml:UTF-16; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0005b/default.nq b/src/test/resources/rml-io/RMLTTC0005b/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0005b/dump1.nq b/src/test/resources/rml-io/RMLTTC0005b/dump1.nq deleted file mode 100644 index 0cb7fa2236e4ed9efd04a8c9581c55f7752470c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1358 zcmchX%L>9U5Jm6WuaJH~wLU?_g)RiajrapqqZZmKtqc8m^`z(`>ZVZ3Kptf>cjk1G z$9=4$F4$QkwJ@WrLM7~D*1k^4bl`hi6E*eeeZ@0YsvOTPz6qXt=8(~z@f9$KL@>p9 zPhHF-lCQ>Bw0~%)MKy2rCAp=F$TcK~Ia$R;omuIeg35UGYSngmtl+Sv11ty2BV%PC zRQ3;bDx=Y_RokVppgW9ikXS<^(guqlWILuTk#1!~2DNItL}v7ct$+8rB~49Xk#e8Q V^5|8@V_2)U%VR}{C^= diff --git a/src/test/resources/rml-io/RMLTTC0005b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0005b/mapping.ttl deleted file mode 100644 index 69dc45b..0000000 --- a/src/test/resources/rml-io/RMLTTC0005b/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; - rml:encoding rml:UTF-16; -. diff --git a/src/test/resources/rml-io/RMLTTC0006a/Friends.json b/src/test/resources/rml-io/RMLTTC0006a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0006a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0006a/README.md b/src/test/resources/rml-io/RMLTTC0006a/README.md deleted file mode 100644 index 96554c9..0000000 --- a/src/test/resources/rml-io/RMLTTC0006a/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0006a - -**Title**: Target no compression - -**Description**: Test export all triples with no compression - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0006a/default.nq b/src/test/resources/rml-io/RMLTTC0006a/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0006a/dump1.nq b/src/test/resources/rml-io/RMLTTC0006a/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0006a/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0006a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006a/mapping.ttl deleted file mode 100644 index e2b4614..0000000 --- a/src/test/resources/rml-io/RMLTTC0006a/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/RMLTTC0006b/Friends.json b/src/test/resources/rml-io/RMLTTC0006b/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0006b/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0006b/README.md b/src/test/resources/rml-io/RMLTTC0006b/README.md deleted file mode 100644 index 52bb039..0000000 --- a/src/test/resources/rml-io/RMLTTC0006b/README.md +++ /dev/null @@ -1,97 +0,0 @@ -## RMLTTC0006b - -**Title**: Target GZip compression - -**Description**: Test export all triples with GZip compression - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.gz"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:gzip; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** - `dump1.nq.gz` - diff --git a/src/test/resources/rml-io/RMLTTC0006b/default.nq b/src/test/resources/rml-io/RMLTTC0006b/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0006b/dump1.nq.gz b/src/test/resources/rml-io/RMLTTC0006b/dump1.nq.gz deleted file mode 100644 index f486fec185b11dcebe0413df5e67c8dbb11025e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 193 zcmV;y06za8iwFq4MnYr&17vk=a4{}!aR8l?K?=e!5JmT%BJ==BYpQ~jE_6{4+=v&L z)@d6^CME5n-d=?WZUQmef%kaury7@KItqa+m`NkIZV-9RDt}&$rkQuvh~7dka$X1+ zux6Q*8RMJkZ<@e-@T(=&0c%iebRkm_(^00;zT*bnh?+GHkwT(vOvWya_8Aw8Pj+{z vZ55CTsboyZK8^Mv=Mm`fo`jtg4Ixt*({V_nzq{CZ{`rm . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.gz"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:gzip; -. diff --git a/src/test/resources/rml-io/RMLTTC0006c/Friends.json b/src/test/resources/rml-io/RMLTTC0006c/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0006c/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0006c/README.md b/src/test/resources/rml-io/RMLTTC0006c/README.md deleted file mode 100644 index 15435e9..0000000 --- a/src/test/resources/rml-io/RMLTTC0006c/README.md +++ /dev/null @@ -1,97 +0,0 @@ -## RMLTTC0006c - -**Title**: Target Zip compression - -**Description**: Test export all triples with ZIP compression - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.zip"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:zip; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** - `dump1.nq.zip` - diff --git a/src/test/resources/rml-io/RMLTTC0006c/default.nq b/src/test/resources/rml-io/RMLTTC0006c/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0006c/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006c/mapping.ttl deleted file mode 100644 index e4395a8..0000000 --- a/src/test/resources/rml-io/RMLTTC0006c/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.zip"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:zip; -. diff --git a/src/test/resources/rml-io/RMLTTC0006d/Friends.json b/src/test/resources/rml-io/RMLTTC0006d/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0006d/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0006d/README.md b/src/test/resources/rml-io/RMLTTC0006d/README.md deleted file mode 100644 index d60b367..0000000 --- a/src/test/resources/rml-io/RMLTTC0006d/README.md +++ /dev/null @@ -1,98 +0,0 @@ -## RMLTTC0006d - -**Title**: Target TarXz compression - -**Description**: Test export all triples with TarXZ compression - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.tar.xz"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:tarxz; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** - `dump1.nq.tar.xz` - diff --git a/src/test/resources/rml-io/RMLTTC0006d/default.nq b/src/test/resources/rml-io/RMLTTC0006d/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0006d/dump1.nq.tar.xz b/src/test/resources/rml-io/RMLTTC0006d/dump1.nq.tar.xz deleted file mode 100644 index b671d160225e578a491b96ee06b1928f9f4b3ff7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 277 zcmb2|=3oE==C_wGW;Gi~uqLekF0zn6LFjLG;*_{G;;o1Bj>Rcl4PiDc%vxCcTT|o9 zv9p}1(sSOcO{l2jQ%Re?Y0|>q9C98dLW}CA&fdBszS?M!$^@5*3SF8nzb#$zZbqm3 zG^yBGVOM)tZ=Tiqezg4l-2cJ17v-)_Kle3s>eQ^$|gZ|$RsqlcEyUp`ms_m9=(YN2lytiAg6ii+iOc3p3N+j}8V8K?QSUdzi0Fj;=A zDza)t;g?^>?qwHSNj^PuWkrSG#FWS?jZOMfPVdrA)Iat#cyfkc|JhAnD)jedzKc7a W|6dj2Yb3J%vbsr{SU-aX0|NjGO@ZV9 diff --git a/src/test/resources/rml-io/RMLTTC0006d/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006d/mapping.ttl deleted file mode 100644 index 6c914e7..0000000 --- a/src/test/resources/rml-io/RMLTTC0006d/mapping.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@prefix ex: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.tar.xz"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:tarxz; -. diff --git a/src/test/resources/rml-io/RMLTTC0006e/Friends.json b/src/test/resources/rml-io/RMLTTC0006e/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0006e/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0006e/README.md b/src/test/resources/rml-io/RMLTTC0006e/README.md deleted file mode 100644 index 42e7ca1..0000000 --- a/src/test/resources/rml-io/RMLTTC0006e/README.md +++ /dev/null @@ -1,97 +0,0 @@ -## RMLTTC0006e - -**Title**: Target TarGzip compression - -**Description**: Test export all triples with TarGZip compression - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.tar.gz"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:targz; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** - `dump1.nq.tar.gz` - diff --git a/src/test/resources/rml-io/RMLTTC0006e/default.nq b/src/test/resources/rml-io/RMLTTC0006e/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0006e/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006e/mapping.ttl deleted file mode 100644 index c71d369..0000000 --- a/src/test/resources/rml-io/RMLTTC0006e/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq.tar.gz"; - ]; - rml:serialization formats:N-Quads; - rml:compression rml:targz; -. diff --git a/src/test/resources/rml-io/RMLTTC0007a/Friends.json b/src/test/resources/rml-io/RMLTTC0007a/Friends.json deleted file mode 100644 index 8e55449..0000000 --- a/src/test/resources/rml-io/RMLTTC0007a/Friends.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] diff --git a/src/test/resources/rml-io/RMLTTC0007a/README.md b/src/test/resources/rml-io/RMLTTC0007a/README.md deleted file mode 100644 index 4e2f433..0000000 --- a/src/test/resources/rml-io/RMLTTC0007a/README.md +++ /dev/null @@ -1,108 +0,0 @@ -## RMLTTC0007a - -**Title**: Target with FilePath description - -**Description**: Test export all triples to a target with File path access description - -**Error expected?** No - -**Input** -``` -[ - { - "id": 0, - "name": "Monica Geller", - "age": 33 - }, - { - "id": 1, - "name": "Rachel Green", - "age": 34 - }, - { - "id": 2, - "name": "Joey Tribbiani", - "age": 35 - }, - { - "id": 3, - "name": "Chandler Bing", - "age": 36 - }, - { - "id": 4, - "name": "Ross Geller", - "age": 37 - } -] - -``` - -**Mapping** -``` -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. - -``` - -**Output 1** -``` - -``` - -**Output 2** -``` - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . - -``` - diff --git a/src/test/resources/rml-io/RMLTTC0007a/default.nq b/src/test/resources/rml-io/RMLTTC0007a/default.nq deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/resources/rml-io/RMLTTC0007a/dump1.nq b/src/test/resources/rml-io/RMLTTC0007a/dump1.nq deleted file mode 100644 index d945676..0000000 --- a/src/test/resources/rml-io/RMLTTC0007a/dump1.nq +++ /dev/null @@ -1,10 +0,0 @@ - "33" . - "Monica Geller" . - "34" . - "Rachel Green" . - "35" . - "Joey Tribbiani" . - "36" . - "Chandler Bing" . - "37" . - "Ross Geller" . diff --git a/src/test/resources/rml-io/RMLTTC0007a/mapping.ttl b/src/test/resources/rml-io/RMLTTC0007a/mapping.ttl deleted file mode 100644 index e2b4614..0000000 --- a/src/test/resources/rml-io/RMLTTC0007a/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix foaf: . -@prefix formats: . -@base . - -<#TriplesMap> a rml:TriplesMap; - rml:logicalSource [ a rml:LogicalSource; - rml:source [ a rml:FilePath; - rml:root rml:MappingDirectory; - rml:path "Friends.json"; - ]; - rml:referenceFormulation rml:JSONPath; - rml:iterator "$[*]"; - ]; - rml:subjectMap [ a rml:SubjectMap; - rml:template "http://example.org/{$.id}"; - rml:logicalTarget <#TargetDump1>; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:name; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.name"; - ]; - ]; - rml:predicateObjectMap [ a rml:PredicateObjectMap; - rml:predicateMap [ a rml:PredicateMap; - rml:constant foaf:age; - ]; - rml:objectMap [ a rml:ObjectMap; - rml:reference "$.age"; - ]; - ]; -. - -<#TargetDump1> a rml:LogicalTarget; - rml:target [ a rml:Target, rml:FilePath; - rml:root rml:CurrentWorkingDirectory; - rml:path "./dump1.nq"; - ]; - rml:serialization formats:N-Quads; -. diff --git a/src/test/resources/rml-io/config.js b/src/test/resources/rml-io/config.js deleted file mode 100644 index ded0cc2..0000000 --- a/src/test/resources/rml-io/config.js +++ /dev/null @@ -1,73 +0,0 @@ -async function loadTurtle() { - //this is the function you call in 'preProcess', to load the highlighter - const worker = await new Promise(resolve => { - require(["core/worker"], ({ worker }) => resolve(worker)); - }); - const action = "highlight-load-lang"; - const langURL = - "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; - const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded - const lang = "turtle"; // this is the class you use to identify the language - worker.postMessage({ action, langURL, propName, lang }); - return new Promise(resolve => { - worker.addEventListener("message", function listener({ data }) { - const { action: responseAction, lang: responseLang } = data; - if (responseAction === action && responseLang === lang) { - worker.removeEventListener("message", listener); - resolve(); - } - }); - }); -} - -var respecConfig = { - // check https://respec.org/docs/ for the meaning of these keys - preProcess: [loadTurtle], - authors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - edDraftURI: "https://w3id.org/rml/io/test-cases/", - editors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - formerEditors: [ - ], - github: "https://github.com/kg-construct/rml-io", - license: "w3c-software-doc", - localBiblio: { - "RML-Core": { - title: "RML-Core", - href: "https://w3id.org/rml/core/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "07 August 2024", - }, - "RML-IO": { - title: "RML-IO", - href: "https://w3id.org/rml/io/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "12 March 2024", - }, - }, - otherLinks: [], - shortName: "RML-IO-Testcases", - specStatus: "CG-DRAFT", - // W3C config - copyrightStart: "2024", - doJsonLd: true, - group: "kg-construct", - prevVersion: "https://kg-construct.github.io/rml-io/test-cases/docs/20250630/", -}; diff --git a/src/test/resources/rml-io/descriptions.csv b/src/test/resources/rml-io/descriptions.csv deleted file mode 100644 index 6dc4cf9..0000000 --- a/src/test/resources/rml-io/descriptions.csv +++ /dev/null @@ -1,85 +0,0 @@ -ID,Title,Purpose,"Error -expected?",Input ,"Output -default","Output -1","Output -2","Output -3",Comment -TARGET,,,,,,,,, -RMLTTC0000,Default target,Test exporting all triples to the default Target when not Targets are specified.,no,Friends.json,default.nq,,,, -RMLTTC0001a,Single Target: Subject Map,Test exporting all triples to a single Target with a given subject.,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0001b,Single Target: Predicate Map,Test exporting all triples to a single Target with a given predicate.,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0001c,Single Target: Object Map,Test exporting all triples to a single Target with a given object reference.,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0001d,Single Target: Graph Map,Test exporting all triples within a named graph to a single Target.,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0001e,Single Target: Language Map,Test exporting all triples with a given language tag to a single Target.,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0001f,Single Target: Datatype Map,Test exporting all triples with a given datatype to a single Target.,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0002a,Multiple Targets: Same Term Map,Test exporting all triples to multiple Targets in the same Term Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002b,Multiple Targets: Subject Map and Predicate Map,Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002c,Multiple Targets: Subject Map and Object Map,Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002d,Multiple Targets: Predicate Map and Object Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002e,"Multiple Targets: Subject Map, Predicate Map, and Object Map","Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.",no,Friends.json,default.nq,dump1.nq,dump2.nq,dump3.nq, -RMLTTC0002f,Multiple Targets: Subject Map and Graph Map,Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002g,Multiple Targets: Predicate Map and Graph Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002h,Multiple Targets: Object Map and Graph Map,Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002i,Multiple Targets: Language Map and Graph Map,Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002j,Multiple Targets: Language Map and Object Map,Test exporting all triples to a Target in a Language Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002k,Multiple Targets: Datatype Map and Graph Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002l,Multiple Targets: Datatype Map and Object Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002m,Multiple Targets: Multiple Predicate Maps,Test exporting all triples to Targets in multiple Predicate Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002n,Multiple Targets: Multiple Object Maps,Test exporting all triples to Targets in multiple Object Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002o,Multiple Targets: Multiple Graph Maps,Test exporting all triples to Targets in multiple Graph Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002p,Multiple Targets: Multiple Language Maps,Test exporting all triples to Targets in multiple Language Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002q,Multiple Targets: Multiple Datatype Maps,Test exporting all triples to Targets in multiple Datatype Maps.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0002r,Multiple Targets: Multiple Term Maps with same Target,Test exporting all triples to same Target in multiple Term Maps.,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0003a,Overriding Targets: Seperate Triples Map,Test exporting some triples to a different Target with a separate Triples Map.,no,Friends.json,default.nq,dump1.nq,dump2.nq,, -RMLTTC0004a,Target JSON-LD,Test export all triples as JSON-LD,no,Friends.json,default.nq,dump1.jsonld,,,"Uncommon RDF formats: LD Patch, Microdata, RDFa, TriG, etc. are skipped in test cases." -RMLTTC0004b,Target N3,Test export all triples as N3,no,Friends.json,default.nq,dump1.n3,,, -RMLTTC0004c,Target N-Triples,Test export all triples as N-Triples,no,Friends.json,default.nq,dump1.nt,,, -RMLTTC0004d,Target N-Quads,Test export all triples as N-Quads,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0004e,Target RDF/JSON,Test export all triples as RDF/JSON,no,Friends.json,default.nq,dump1.rdfjson,,, -RMLTTC0004f,Target RDF/XML,Test export all triples as RDF/XML,no,Friends.json,default.nq,dump1.rdfxml,,, -RMLTTC0004g,Target Turtle,Test export all triples as Turtle,no,Friends.json,default.nq,dump1.ttl,,, -RMLTTC0005a,Target UTF-8,Test export all triples with UTF-8 encoding,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0005b,Target UTF-16,Test export all triples with UTF-16 encoding,no,Friends.json,default.nq,dump1-utf16.nq,,, -RMLTTC0006a,Target no compression,Test export all triples with no compression,no,Friends.json,default.nq,dump1.nq,,, -RMLTTC0006b,Target GZip compression,Test export all triples with GZip compression,no,Friends.json,default.nq,dump1.nq.gz,,, -RMLTTC0006c,Target Zip compression,Test export all triples with ZIP compression,no,Friends.json,default.nq,dump1.nq.zip,,, -RMLTTC0006d,Target TarXz compression,Test export all triples with TarXZ compression,no,Friends.json,default.nq,dump1.nq.tar.xz,,, -RMLTTC0006e,Target TarGzip compression,Test export all triples with TarGZip compression,no,Friends.json,default.nq,dump1.nq.tar.gz,,, -RMLTTC0007a,Target with FilePath description,Test export all triples to a target with File path access description,no,Friends.json,default.nq,dump1.nq,,, -,,,,,,,,, -,,,,,,,,, -,,,,,,,,, -,,,,,,,,, -SOURCE,,,,,,,,, -RMLSTC0001a,Source with UTF-8 encoding,Test source with UTF-8 encoding,no,Friends.json,default.nq,,,, -RMLSTC0001b,Source with UTF-16 encoding,Test source with UTF-16 encoding,no,Friends-UTF16.json,default.nq,,,, -RMLSTC0002a,Source no compression,Test source without compression,no,Friends.json,default.nq,,,, -RMLSTC0002b,Source GZip compression,Test source with GZip compression,no,Friends.json.gz,default.nq,,,, -RMLSTC0002c,Source Zip compression,Test source with ZIP compression,no,Friends.json.zip,default.nq,,,, -RMLSTC0002d,Source TarXz compression,Test source with TarXZ compression,no,Friends.json.tar.xz,default.nq,,,, -RMLSTC0002e,Source TarGzip compression,Test source with TarGZip compression,no,Friends.json.tar.gz,default.nq,,,, -RMLSTC0003,Source with query,Test source which requires a query,no,Friends.nt,default.nq,,,, -RMLSTC0004a,Source with default NULL values,Test source with default NULL values,no,Friends-NULL.csv,default.nq,,,, -RMLSTC0004b,Source with one NULL value,Test source with one NULL value defined,no,Friends-NULL.csv,default.nq,,,, -RMLSTC0004c,Source with multiple NULL values,Test source with multiple NULL values defined,no,Friends-NULL2.csv,default.nq,,,, -RMLSTC0006a,Source with D2RQ access description,Test source with D2RQ access description for SQL databases,no,Friends.csv,default.nq,,,, -RMLSTC0006b,Source with a Relative Path Source,Test access to a file,no,Friends.csv,default.nq,,,, -RMLSTC0007a,Source with JSONPath reference formulation,Test source with JSONPath reference formulation,no,Friends.json,default.nq,,,, -RMLSTC0007b,Source with CSV reference formulation,Test source with Tabular reference formulation,no,Friends.csv,default.nq,,,, -RMLSTC0007c,Source with XPath reference formulation,Test source with XPath reference formulation,no,Friends.xml,default.nq,,,, -RMLSTC0007d,Source with XPath reference formulation with namespaces,Test source with XPath reference formulation with namespaces,no,Friends.xml,default.nq,,,, -RMLSTC0008a,Multiple sources of same type,Tests the generation of all triples from multiple homogeneous sources ,no,"Friends.json, Friends2.json",default.nq,,,, -RMLSTC0008b,Multiple sources of different type,Tests the generation of all triples from multiple heterogeneous sources ,no,"Friends.json, Friends.csv",default.nq,,,, -RMLSTC0009a,Source with quoted columns,Tests the generation of triples where columns are quoted,no,Friends.csv,default.nq,,,, -RMLSTC0010a,"Invalid CSV source, reference to invalid column",Tests the identification of invalid CSV sources,yes,Friends.csv,,,,, -RMLSTC0010b,"Invalid CSV source, no reference to invalid column","Tests the identification of invalid CSV sources, even when all columns referenced are valid",yes,Friends.csv,,,,, -RMLSTC0011a,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, -RMLSTC0011b,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, -RMLSTC0011c,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, -RMLSTC0011d,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, -RMLSTC0011e,Complex JSON source,Tests the generation of triples from complex JSON sources,no,companies.json,default.nq,,,, -RMLSTC0012a,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, -RMLSTC0012b,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, -RMLSTC0012c,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, -RMLSTC0012d,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, -RMLSTC0012e,Complex XML source,Tests the generation of triples from complex XML sources,no,companies.xml,default.nq,,,, \ No newline at end of file diff --git a/src/test/resources/rml-io/dev.html b/src/test/resources/rml-io/dev.html deleted file mode 100644 index dca4229..0000000 --- a/src/test/resources/rml-io/dev.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - RML-IO: Test Cases - - - - - - - - - - -
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - diff --git a/src/test/resources/rml-io/docs/20250130/index.html b/src/test/resources/rml-io/docs/20250130/index.html deleted file mode 100644 index 0a514b5..0000000 --- a/src/test/resources/rml-io/docs/20250130/index.html +++ /dev/null @@ -1,5687 +0,0 @@ - - - - - - -RML-IO: Test Cases - - - - - - - - - - - - - - -
- -

RML-IO: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-IO-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-IO test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTC0001a

-

Title: Source with UTF-8 encoding

-

Description: Test source with UTF-8 encoding

-

Error expected? Yes

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001a/Friends.json>;
-  rml:encoding rml:UTF-8;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

5. RMLSTC0001b

-

Title: Source with UTF-16 encoding

-

Description: Test source with UTF-16 encoding

-

Error expected? Yes

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001b/Friends-UTF16.json>;
-  rml:encoding rml:UTF-16;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

6. RMLSTC0002a

-

Title: Source no compression

-

Description: Test source without compression

-

Error expected? Yes

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

7. RMLSTC0002b

-

Title: Source GZip compression

-

Description: Test source with GZip compression

-

Error expected? Yes

-

Input - Friends.json.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002b/Friends.json.gz>;
-  rml:compression rml:gzip;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

8. RMLSTC0002c

-

Title: Source Zip compression

-

Description: Test source with ZIP compression

-

Error expected? Yes

-

Input - Friends.json.zip

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002c/Friends.json.zip>;
-  rml:compression rml:zip;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

9. RMLSTC0002d

-

Title: Source TarXz compression

-

Description: Test source with TarXZ compression

-

Error expected? Yes

-

Input - Friends.json.tar.xz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz>;
-  rml:compression rml:tarxz;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

10. RMLSTC0002e

-

Title: Source TarGzip compression

-

Description: Test source with TarGZip compression

-

Error expected? Yes

-

Input - Friends.json.tar.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002e/Friends.json.tar.gz>;
-  rml:compression rml:targz;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

11. RMLSTC0003

-

Title: Source with query

-

Description: Test source which requires a query

-

Error expected? Yes

-

Input

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-        rml:path "./Friends.nt";
-    ];
-    rml:iterator """
-    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-    SELECT ?person ?name ?age WHERE {
-        ?person foaf:name ?name .
-        ?person foaf:age ?age .
-    }
-    """;
-    rml:referenceFormulation formats:SPARQL_Results_CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:reference "person";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

12. RMLSTC0004a

-

Title: Source with default NULL values

-

Description: Test source with default NULL values

-

Error expected? Yes

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004a/Friends-NULL.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/5> <http://xmlns.com/foaf/0.1/age> "" .
-<http://example.org/5> <http://xmlns.com/foaf/0.1/name> "" .
-
-
-

13. RMLSTC0004b

-

Title: Source with one NULL value

-

Description: Test source with one NULL value defined

-

Error expected? Yes

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004b/Friends-NULL.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-  # Empty value is considered NULL
-  rml:null "";
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

14. RMLSTC0004c

-

Title: Source with multiple NULL values

-

Description: Test source with multiple NULL values defined

-

Error expected? Yes

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-6;NULL;NULL
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-  # Empty value and 'NULL' are both considered NULL
-  rml:null "";
-  rml:null "NULL";
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

15. RMLSTC0005a

-

Title: Source overrride access: NULL values

-

Description: Test source with data access description providing NULL values which we override.

-

Error expected? Yes

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005a/Friends-NULL.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-    csvw:null "NULL";
-  ];
-  # Empty value is considered NULL and overrides CSVW
-  rml:null "";
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

16. RMLSTC0005b

-

Title: Source overrride access: Encoding

-

Description: Test source with data access description providing encoding which we override.

-

Error expected? Yes

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005b/Friends.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-  # Encoding is UTF-16 and overrides CSVW
-  rml:encoding rml:UTF-16;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

17. RMLSTC0006a

-

Title: Source with DCAT access description

-

Description: Test source with DCAT data access description

-

Error expected? Yes

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0006a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

18. RMLSTC0006b

-

Title: Source with VoID access description

-

Description: Test source with VoID data access description

-

Error expected? Yes

-

Input

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#VoIDSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0006b/Friends.nt>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#VoIDSourceAccess>;
-    rml:iterator """
-    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-    SELECT ?id ?name ?age WHERE {
-        ?person foaf:name ?name .
-        ?person foaf:age ?age .
-        BIND(REPLACE(STR(?person),"http://example.org/", "") AS ?id) .
-    }
-    """;
-    rml:referenceFormulation formats:SPARQL_Results_CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

19. RMLSTC0006c

-

Title: Source with SD access description

-

Description: Test source with SD data access description

-

Error expected? Yes

-

Input

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#SDSourceAccess> a rml:Source, sd:Service;
-  sd:endpoint <http://example.com/sparql/>;
-  sd:supportedLanguage sd:SPARQL11Query;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#SDSourceAccess>;
-    rml:iterator """
-    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-    SELECT ?id ?name ?age WHERE {
-        ?person foaf:name ?name .
-        ?person foaf:age ?age .
-        BIND(REPLACE(STR(?person),"http://example.org/", "") AS ?id) .
-    }
-    """;
-    rml:referenceFormulation formats:SPARQL_Results_CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

20. RMLSTC0006d

-

Title: Source with CSVW access description

-

Description: Test source with CSVW data access description

-

Error expected? Yes

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0006d/Friends.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

21. RMLSTC0006e

-

Title: Source with Web of Things access description

-

Description: Test source with Web of Things data access description

-

Error expected? Yes

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix td: <https://www.w3.org/2019/wot/td#> .
-@prefix htv: <http://www.w3.org/2011/http#> .
-@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
-@base <http://example.com/rules/> .
-
-<#WoTSourceAccess> a rml:Source, td:Thing;
-  td:hasPropertyAffordance [
-    td:hasForm [
-      # URL and content type
-      hctl:hasTarget "http://w3id.org/rml/resources/rml-io/RMLSTC0006e/Friends.json";
-      hctl:forContentType "application/json";
-    ];
-  ];
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#WoTSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

22. RMLSTC0006f

-

Title: Source with D2RQ access description

-

Description: Test source with D2RQ access description for SQL databases

-

Error expected? Yes

-

Input

-
id, name, age
-0, Monica Geller, 33
-1, Rachel Green, 34
-2, Joey Tribbiani, 35
-3, Chandler Bing, 36
-4, Ross Geller, 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#D2RQSourceAccess> a rml:Source, d2rq:Database;
-  d2rq:jdbcDSN "$CONNECTIONDSN";
-  d2rq:username "$USERNAME";
-  d2rq:password "$PASSWORD"
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#D2RQSourceAccess>;
-    rml:referenceFormulation rml:SQL2008Table;
-    rml:iterator "Friends";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

23. RMLSTC0007a

-

Title: Source with JSONPath reference formulation

-

Description: Test source with JSONPath reference formulation

-

Error expected? Yes

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007a/Friends.json>;
-  rml:encoding rml:UTF-8;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

24. RMLSTC0007b

-

Title: Source with CSV reference formulation

-

Description: Test source with Tabular reference formulation

-

Error expected? Yes

-

Input

-
id; name; age
-0; Monica Geller; 33
-1; Rachel Green; 34
-2; Joey Tribbiani; 35
-3; Chandler Bing; 36
-4; Ross Geller; 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0007b/Friends.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

25. RMLSTC0007c

-

Title: Source with XPath reference formulation

-

Description: Test source with XPath reference formulation

-

Error expected? Yes

-

Input

-
<Friends>
-  <Character id="0">
-    <name>Monica Geller</name>
-    <age>33</age>
-  </Character>
-  <Character id="1">
-    <name>Rachel Green</name>
-    <age>34</age>
-  </Character>
-  <Character id="2">
-    <name>Joey Tribbiani</name>
-    <age>35</age>
-  </Character>
-  <Character id="3">
-    <name>Chandler Bing</name>
-    <age>36</age>
-  </Character>
-  <Character id="4">
-    <name>Ross Geller</name>
-    <age>37</age>
-  </Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007c/Friends.xml>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "//Friends/Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

26. RMLSTC0007d

-

Title: Source with XPath reference formulation with namespaces

-

Description: Test source with XPath reference formulation with namespaces

-

Error expected? Yes

-

Input

-
<Friends xmlns:ex="http://example.org">
-  <ex:Character id="0">
-    <ex:name>Monica Geller</ex:name>
-    <ex:age>33</ex:age>
-  </ex:Character>
-  <ex:Character id="1">
-    <ex:name>Rachel Green</ex:name>
-    <ex:age>34</ex:age>
-  </ex:Character>
-  <ex:Character id="2">
-    <ex:name>Joey Tribbiani</ex:name>
-    <ex:age>35</ex:age>
-  </ex:Character>
-  <ex:Character id="3">
-    <ex:name>Chandler Bing</ex:name>
-    <ex:age>36</ex:age>
-  </ex:Character>
-  <ex:Character id="4">
-    <ex:name>Ross Geller</ex:name>
-    <ex:age>37</ex:age>
-  </ex:Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007d/Friends.xml>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
-      rml:namespace [ a rml:Namespace;
-        rml:namespacePrefix "ex";
-        rml:namespaceURL "http://example.org";
-      ];
-    ];
-    rml:iterator "//Friends/ex:Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

27. RMLTTC0000

-

Title: Default target

-

Description: Test exporting all triples to the default Target when not Targets are specified.

-

Error expected? Yes

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0000/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

28. RMLTTC0001a

-

Title: Single Target: Subject Map

-

Description: Test exporting all triples to a single Target with a given subject.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

29. RMLTTC0001b

-

Title: Single Target: Predicate Map

-

Description: Test exporting all triples to a single Target with a given predicate.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

30. RMLTTC0001c

-

Title: Single Target: Object Map

-

Description: Test exporting all triples to a single Target with a given object reference.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

31. RMLTTC0001d

-

Title: Single Target: Graph Map

-

Description: Test exporting all triples within a named graph to a single Target.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

32. RMLTTC0001e

-

Title: Single Target: Language Map

-

Description: Test exporting all triples with a given language tag to a single Target.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

33. RMLTTC0001f

-

Title: Single Target: Datatype Map

-

Description: Test exporting all triples with a given datatype to a single Target.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-
-

34. RMLTTC0002a

-

Title: Multiple Targets: Same Term Map

-

Description: Test exporting all triples to multiple Targets in the same Term Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

35. RMLTTC0002b

-

Title: Multiple Targets: Subject Map and Predicate Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

36. RMLTTC0002c

-

Title: Multiple Targets: Subject Map and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

37. RMLTTC0002d

-

Title: Multiple Targets: Predicate Map and Object Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

38. RMLTTC0002e

-

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump3>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump3> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump3.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

39. RMLTTC0002f

-

Title: Multiple Targets: Subject Map and Graph Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

40. RMLTTC0002g

-

Title: Multiple Targets: Predicate Map and Graph Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

41. RMLTTC0002h

-

Title: Multiple Targets: Object Map and Graph Map

-

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

42. RMLTTC0002i

-

Title: Multiple Targets: Language Map and Graph Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

43. RMLTTC0002j

-

Title: Multiple Targets: Language Map and Object Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

44. RMLTTC0002k

-

Title: Multiple Targets: Datatype Map and Graph Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

45. RMLTTC0002l

-

Title: Multiple Targets: Datatype Map and Object Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

46. RMLTTC0002m

-

Title: Multiple Targets: Multiple Predicate Maps

-

Description: Test exporting all triples to Targets in multiple Predicate Maps.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

47. RMLTTC0002n

-

Title: Multiple Targets: Multiple Object Maps

-

Description: Test exporting all triples to Targets in multiple Object Maps.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

48. RMLTTC0002o

-

Title: Multiple Targets: Multiple Graph Maps

-

Description: Test exporting all triples to Targets in multiple Graph Maps.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph2> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph2> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph2> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph2> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph2> .
-
-
-

49. RMLTTC0002p

-

Title: Multiple Targets: Multiple Language Maps

-

Description: Test exporting all triples to Targets in multiple Language Maps.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "nl";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
-
-
-

50. RMLTTC0002q

-

Title: Multiple Targets: Multiple Datatype Maps

-

Description: Test exporting all triples to Targets in multiple Datatype Maps.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:double;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
-
-
-

51. RMLTTC0002r

-

Title: Multiple Targets: Multiple Term Maps with same Target

-

Description: Test exporting all triples to same Target in multiple Term Maps.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

52. RMLTTC0003a

-

Title: Overriding Targets: Seperate Triples Map

-

Description: Test exporting some triples to a different Target with a separate Triples Map.

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

53. RMLTTC0004a

-

Title: Target JSON-LD

-

Description: Test export all triples as JSON-LD

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.jsonld>;
-  ];
-  rml:serialization formats:JSON-LD;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-  "@context": { 
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@graph": [
-    {                                                                                
-
-      "@id": "http://example.org/0",
-      "foaf:name": "Monica Geller",
-      "foaf:age": "33"
-    },
-    {                                                                                
-      "@id": "http://example.org/1",
-      "foaf:name": "Rachel Green",
-      "foaf:age": "34"
-    },
-    {                                                                                
-      "@id": "http://example.org/2",
-      "foaf:name": "Joey Tribbiani",
-      "foaf:age": "35"
-    },
-    {                                                                                
-      "@id": "http://example.org/3",
-      "foaf:name": "Chandler Bing",
-      "foaf:age": "36"
-    },
-      {                                                                                
-      "@id": "http://example.org/4",
-      "foaf:name": "Ross Geller",
-      "foaf:age": "37"
-    }
-  ]
-}
-
-
-

54. RMLTTC0004b

-

Title: Target N3

-

Description: Test export all triples as N3

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.n3>;
-  ];
-  rml:serialization formats:N3;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-ex:0 <foaf:age> "33" ;
-     <foaf:name> "Monica Geller" .
-ex:1 <foaf:age> "34" ;
-     <foaf:name> "Rachel Green" .
-ex:2 <foaf:age> "35" ;
-     <foaf:name> "Joey Tribbiani" .
-ex:3 <foaf:age> "36" ;
-     <foaf:name> "Chandler Bing" .
-ex:4 <foaf:age> "37" ;
-     <foaf:name> "Ross Geller" .
-
-
-

55. RMLTTC0004c

-

Title: Target N-Triples

-

Description: Test export all triples as N-Triples

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nt>;
-  ];
-  rml:serialization formats:N-Triples;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

56. RMLTTC0004d

-

Title: Target N-Quads

-

Description: Test export all triples as N-Quads

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

57. RMLTTC0004e

-

Title: Target RDF/JSON

-

Description: Test export all triples as RDF/JSON

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.rdfjson>;
-  ];
-  rml:serialization formats:RDF_JSON;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-    "http://example.org/0" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
-    },
-    "http://example.org/1" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
-    },
-    "http://example.org/2" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
-    },
-    "http://example.org/3" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
-    },
-    "http://example.org/4" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
-    }
-}
-
-
-

58. RMLTTC0004f

-

Title: Target RDF/XML

-

Description: Test export all triples as RDF/XML

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.rdfxml>;
-  ];
-  rml:serialization formats:RDF_XML;
-.
-
-

Output 1

-

-
-

Output 2

-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns:foaf="http://xmlns.com/foaf/0.1/">
-  <rdf:Description rdf:about="http://example.org/0">
-    <foaf:age>33</foaf:age>
-    <foaf:name>Monica Geller</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/1">
-    <foaf:age>34</foaf:age>
-    <foaf:name>Rachel Green</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/2">
-    <foaf:age>35</foaf:age>
-    <foaf:name>Joey Tribbiani</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/3">
-    <foaf:age>36</foaf:age>
-    <foaf:name>Chandler Bing</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/4">
-    <foaf:age>37</foaf:age>
-    <foaf:name>Ross Geller</foaf:name>
-  </rdf:Description>
-</rdf:RDF>
-
-
-

59. RMLTTC0004g

-

Title: Target Turtle

-

Description: Test export all triples as Turtle

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.ttl>;
-  ];
-  rml:serialization formats:Turtle;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-
-<ex:0> <foaf:age> "33" .
-<ex:0> <foaf:name> "Monica Geller" .
-<ex:1> <foaf:age> "34" .
-<ex:1> <foaf:name> "Rachel Green" .
-<ex:2> <foaf:age> "35" .
-<ex:2> <foaf:name> "Joey Tribbiani" .
-<ex:3> <foaf:age> "36" .
-<ex:3> <foaf:name> "Chandler Bing" .
-<ex:4> <foaf:age> "37" .
-<ex:4> <foaf:name> "Ross Geller" .
-
-
-

60. RMLTTC0005a

-

Title: Target UTF-8

-

Description: Test export all triples with UTF-8 encoding

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-8;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

61. RMLTTC0005b

-

Title: Target UTF-16

-

Description: Test export all triples with UTF-16 encoding

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-16;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

62. RMLTTC0006a

-

Title: Target no compression

-

Description: Test export all triples with no compression

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

63. RMLTTC0006b

-

Title: Target GZip compression

-

Description: Test export all triples with GZip compression

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.gz>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:gzip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.gz

-
-

64. RMLTTC0006c

-

Title: Target Zip compression

-

Description: Test export all triples with ZIP compression

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.zip>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:zip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.zip

-
-

65. RMLTTC0006d

-

Title: Target TarXz compression

-

Description: Test export all triples with TarXZ compression

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.tar.xz>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:tarxz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.xz

-
-

66. RMLTTC0006e

-

Title: Target TarGzip compression

-

Description: Test export all triples with TarGZip compression

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.tar.gz>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:targz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.gz

-
-

67. RMLTTC0007a

-

Title: Target with DCAT access description

-

Description: Test export all triples to a target with DCAT access description

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0007a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:accessUrl <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

68. RMLTTC0007b

-

Title: Target with VoID access description

-

Description: Test export all triples to a target with VoID access description

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0007b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

69. RMLTTC0007c

-

Title: Target with SD access description

-

Description: Test export all triples to a target with SD access description

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0007c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, sd:Service;
-    sd:endpoint  <http://example.com/sparql-update>;
-    sd:supportedLanguage sd:SPARQL11Update;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

70. RMLTTC0007d

-

Title: Target with Web of Things access description

-

Description: Test export all triples to a target with Web of Things access description

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0007d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix td: <https://www.w3.org/2019/wot/td#> .
-@prefix htv: <http://www.w3.org/2011/http#> .
-@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, td:Thing;
-      td:hasPropertyAffordance [
-        td:hasForm [
-          hctl:hasTarget "http://localhost/data";
-          hctl:forContentType "application/n-quads";
-      ];
-    ];
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

71. RMLTTC0007e

-

Title: Target with dcat:format

-

Description: Test dcat:format in a Target

-

Error expected? Yes

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0007e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix td: <https://www.w3.org/2019/wot/td#> .
-@prefix htv: <http://www.w3.org/2011/http#> .
-@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0007d/Friends.json>;
-    dcat:format <http://www.iana.org/assignments/media-types/application/json> ;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, td:Thing;
-      td:hasPropertyAffordance [
-        td:hasForm [
-          hctl:hasTarget "http://localhost/data";
-          hctl:forContentType "application/n-quads";
-      ];
-    ];
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/20250217/index.html b/src/test/resources/rml-io/docs/20250217/index.html deleted file mode 100644 index 5707a03..0000000 --- a/src/test/resources/rml-io/docs/20250217/index.html +++ /dev/null @@ -1,5298 +0,0 @@ - - - - - - -RML-IO: Test Cases - - - - - - - - - - - - - - -
- -

RML-IO: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-IO-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-IO test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTC0001a

-

Title: Source with UTF-8 encoding

-

Description: Test source with UTF-8 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001a/Friends.json>;
-  rml:encoding rml:UTF-8;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

5. RMLSTC0001b

-

Title: Source with UTF-16 encoding

-

Description: Test source with UTF-16 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0001b/Friends-UTF16.json>;
-  rml:encoding rml:UTF-16;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

6. RMLSTC0002a

-

Title: Source no compression

-

Description: Test source without compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

7. RMLSTC0002b

-

Title: Source GZip compression

-

Description: Test source with GZip compression

-

Error expected? No

-

Input - Friends.json.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002b/Friends.json.gz>;
-  rml:compression rml:gzip;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

8. RMLSTC0002c

-

Title: Source Zip compression

-

Description: Test source with ZIP compression

-

Error expected? No

-

Input - Friends.json.zip

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002c/Friends.json.zip>;
-  rml:compression rml:zip;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

9. RMLSTC0002d

-

Title: Source TarXz compression

-

Description: Test source with TarXZ compression

-

Error expected? No

-

Input - Friends.json.tar.xz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz>;
-  rml:compression rml:tarxz;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

10. RMLSTC0002e

-

Title: Source TarGzip compression

-

Description: Test source with TarGZip compression

-

Error expected? No

-

Input - Friends.json.tar.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0002e/Friends.json.tar.gz>;
-  rml:compression rml:targz;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

11. RMLSTC0003

-

Title: Source with query

-

Description: Test source which requires a query

-

Error expected? No

-

Input

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-        rml:path "./Friends.nt";
-    ];
-    rml:iterator """
-    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-    SELECT ?person ?name ?age WHERE {
-        ?person foaf:name ?name .
-        ?person foaf:age ?age .
-    }
-    """;
-    rml:referenceFormulation formats:SPARQL_Results_CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:reference "person";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

12. RMLSTC0004a

-

Title: Source with default NULL values

-

Description: Test source with default NULL values

-

Error expected? No

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004a/Friends-NULL.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/5> <http://xmlns.com/foaf/0.1/age> "" .
-<http://example.org/5> <http://xmlns.com/foaf/0.1/name> "" .
-
-
-

13. RMLSTC0004b

-

Title: Source with one NULL value

-

Description: Test source with one NULL value defined

-

Error expected? No

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004b/Friends-NULL.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-  # Empty value is considered NULL
-  rml:null "";
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

14. RMLSTC0004c

-

Title: Source with multiple NULL values

-

Description: Test source with multiple NULL values defined

-

Error expected? No

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-6;NULL;NULL
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0004c/Friends-NULL2.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-  # Empty value and 'NULL' are both considered NULL
-  rml:null "";
-  rml:null "NULL";
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

15. RMLSTC0005a

-

Title: Source overrride access: NULL values

-

Description: Test source with data access description providing NULL values which we override.

-

Error expected? No

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-5;;
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005a/Friends-NULL.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-    csvw:null "NULL";
-  ];
-  # Empty value is considered NULL and overrides CSVW
-  rml:null "";
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

16. RMLSTC0005b

-

Title: Source overrride access: Encoding

-

Description: Test source with data access description providing encoding which we override.

-

Error expected? No

-

Input

-
id;name;age
-0;Monica Geller;33
-1;Rachel Green;34
-2;Joey Tribbiani;35
-3;Chandler Bing;36
-4;Ross Geller;37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0005b/Friends.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-  # Encoding is UTF-16 and overrides CSVW
-  rml:encoding rml:UTF-16;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

17. RMLSTC0006a

-

Title: Source with D2RQ access description

-

Description: Test source with D2RQ access description for SQL databases

-

Error expected? No

-

Input

-
id, name, age
-0, Monica Geller, 33
-1, Rachel Green, 34
-2, Joey Tribbiani, 35
-3, Chandler Bing, 36
-4, Ross Geller, 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#D2RQSourceAccess> a rml:Source, d2rq:Database;
-  d2rq:jdbcDSN "$CONNECTIONDSN";
-  d2rq:username "$USERNAME";
-  d2rq:password "$PASSWORD"
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#D2RQSourceAccess>;
-    rml:referenceFormulation rml:SQL2008Table;
-    rml:iterator "Friends";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

18. RMLSTC0006b

-

Title: Source with a Relative Path Source

-

Description: Test access to a file

-

Error expected? No

-

Input

-
id, name, age
-0, Monica Geller, 33
-1, Rachel Green, 34
-2, Joey Tribbiani, 35
-3, Chandler Bing, 36
-4, Ross Geller, 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath, rml:Source;
-      rml:root rml:CurrentWorkingDirectory;
-      rml:path "./Friends.csv"
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

19. RMLSTC0007a

-

Title: Source with JSONPath reference formulation

-

Description: Test source with JSONPath reference formulation

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007a/Friends.json>;
-  rml:encoding rml:UTF-8;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

20. RMLSTC0007b

-

Title: Source with CSV reference formulation

-

Description: Test source with Tabular reference formulation

-

Error expected? No

-

Input

-
id; name; age
-0; Monica Geller; 33
-1; Rachel Green; 34
-2; Joey Tribbiani; 35
-3; Chandler Bing; 36
-4; Ross Geller; 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix csvw: <http://www.w3.org/ns/csvw#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#CSVWSourceAccess> a rml:Source, csvw:Table;
-  csvw:url "http://w3id.org/rml/resources/rml-io/RMLSTC0007b/Friends.csv"^^xsd:anyURI ;
-  csvw:dialect [ a csvw:Dialect;
-    csvw:delimiter ";";
-    csvw:encoding "UTF-8";
-    csvw:header "1"^^xsd:boolean;
-  ];
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#CSVWSourceAccess>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

21. RMLSTC0007c

-

Title: Source with XPath reference formulation

-

Description: Test source with XPath reference formulation

-

Error expected? No

-

Input

-
<Friends>
-  <Character id="0">
-    <name>Monica Geller</name>
-    <age>33</age>
-  </Character>
-  <Character id="1">
-    <name>Rachel Green</name>
-    <age>34</age>
-  </Character>
-  <Character id="2">
-    <name>Joey Tribbiani</name>
-    <age>35</age>
-  </Character>
-  <Character id="3">
-    <name>Chandler Bing</name>
-    <age>36</age>
-  </Character>
-  <Character id="4">
-    <name>Ross Geller</name>
-    <age>37</age>
-  </Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007c/Friends.xml>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "//Friends/Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

22. RMLSTC0007d

-

Title: Source with XPath reference formulation with namespaces

-

Description: Test source with XPath reference formulation with namespaces

-

Error expected? No

-

Input

-
<Friends xmlns:ex="http://example.org">
-  <ex:Character id="0">
-    <ex:name>Monica Geller</ex:name>
-    <ex:age>33</ex:age>
-  </ex:Character>
-  <ex:Character id="1">
-    <ex:name>Rachel Green</ex:name>
-    <ex:age>34</ex:age>
-  </ex:Character>
-  <ex:Character id="2">
-    <ex:name>Joey Tribbiani</ex:name>
-    <ex:age>35</ex:age>
-  </ex:Character>
-  <ex:Character id="3">
-    <ex:name>Chandler Bing</ex:name>
-    <ex:age>36</ex:age>
-  </ex:Character>
-  <ex:Character id="4">
-    <ex:name>Ross Geller</ex:name>
-    <ex:age>37</ex:age>
-  </ex:Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0007d/Friends.xml>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
-      rml:namespace [ a rml:Namespace;
-        rml:namespacePrefix "ex";
-        rml:namespaceURL "http://example.org";
-      ];
-    ];
-    rml:iterator "//Friends/ex:Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

23. RMLSTC0008a

-

Title: Multiple sources of same type

-

Description: Tests the generation of all triples from multiple homogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008a/Friends.json>;
-  rml:encoding rml:UTF-8;
-.
-
-<#DCATSourceAccess2> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008a/Friends2.json>;
-  rml:encoding rml:UTF-8;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess2>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

24. RMLSTC0008b

-

Title: Multiple sources of different type

-

Description: Tests the generation of all triples from multiple heterogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccessJSON> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008b/Friends.json>;
-  rml:encoding rml:UTF-8;
-.
-
-<#DCATSourceAccessCSV> a rml:Source, dcat:Distribution;
-  dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLSTC0008b/Friends.csv>;
-  rml:encoding rml:UTF-8;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccessJSON>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccessCSV>;
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

25. RMLTTC0000

-

Title: Default target

-

Description: Test exporting all triples to the default Target when not Targets are specified.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0000/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

26. RMLTTC0001a

-

Title: Single Target: Subject Map

-

Description: Test exporting all triples to a single Target with a given subject.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

27. RMLTTC0001b

-

Title: Single Target: Predicate Map

-

Description: Test exporting all triples to a single Target with a given predicate.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

28. RMLTTC0001c

-

Title: Single Target: Object Map

-

Description: Test exporting all triples to a single Target with a given object reference.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

29. RMLTTC0001d

-

Title: Single Target: Graph Map

-

Description: Test exporting all triples within a named graph to a single Target.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

30. RMLTTC0001e

-

Title: Single Target: Language Map

-

Description: Test exporting all triples with a given language tag to a single Target.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

31. RMLTTC0001f

-

Title: Single Target: Datatype Map

-

Description: Test exporting all triples with a given datatype to a single Target.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0001f/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-
-

32. RMLTTC0002a

-

Title: Multiple Targets: Same Term Map

-

Description: Test exporting all triples to multiple Targets in the same Term Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

33. RMLTTC0002b

-

Title: Multiple Targets: Subject Map and Predicate Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

34. RMLTTC0002c

-

Title: Multiple Targets: Subject Map and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

35. RMLTTC0002d

-

Title: Multiple Targets: Predicate Map and Object Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

36. RMLTTC0002e

-

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump3>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump3> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump3.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

37. RMLTTC0002f

-

Title: Multiple Targets: Subject Map and Graph Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002f/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

38. RMLTTC0002g

-

Title: Multiple Targets: Predicate Map and Graph Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002g/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

39. RMLTTC0002h

-

Title: Multiple Targets: Object Map and Graph Map

-

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002h/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

40. RMLTTC0002i

-

Title: Multiple Targets: Language Map and Graph Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002i/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

41. RMLTTC0002j

-

Title: Multiple Targets: Language Map and Object Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002j/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

42. RMLTTC0002k

-

Title: Multiple Targets: Datatype Map and Graph Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002k/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

43. RMLTTC0002l

-

Title: Multiple Targets: Datatype Map and Object Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002l/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

44. RMLTTC0002m

-

Title: Multiple Targets: Multiple Predicate Maps

-

Description: Test exporting all triples to Targets in multiple Predicate Maps.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002m/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

45. RMLTTC0002n

-

Title: Multiple Targets: Multiple Object Maps

-

Description: Test exporting all triples to Targets in multiple Object Maps.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002n/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

46. RMLTTC0002o

-

Title: Multiple Targets: Multiple Graph Maps

-

Description: Test exporting all triples to Targets in multiple Graph Maps.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002o/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph2> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph2> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph2> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph2> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph2> .
-
-
-

47. RMLTTC0002p

-

Title: Multiple Targets: Multiple Language Maps

-

Description: Test exporting all triples to Targets in multiple Language Maps.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002p/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "nl";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
-
-
-

48. RMLTTC0002q

-

Title: Multiple Targets: Multiple Datatype Maps

-

Description: Test exporting all triples to Targets in multiple Datatype Maps.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002q/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:double;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
-
-
-

49. RMLTTC0002r

-

Title: Multiple Targets: Multiple Term Maps with same Target

-

Description: Test exporting all triples to same Target in multiple Term Maps.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0002r/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

50. RMLTTC0003a

-

Title: Overriding Targets: Seperate Triples Map

-

Description: Test exporting some triples to a different Target with a separate Triples Map.

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0003a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump2.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

51. RMLTTC0004a

-

Title: Target JSON-LD

-

Description: Test export all triples as JSON-LD

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.jsonld>;
-  ];
-  rml:serialization formats:JSON-LD;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-  "@context": { 
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@graph": [
-    {                                                                                
-
-      "@id": "http://example.org/0",
-      "foaf:name": "Monica Geller",
-      "foaf:age": "33"
-    },
-    {                                                                                
-      "@id": "http://example.org/1",
-      "foaf:name": "Rachel Green",
-      "foaf:age": "34"
-    },
-    {                                                                                
-      "@id": "http://example.org/2",
-      "foaf:name": "Joey Tribbiani",
-      "foaf:age": "35"
-    },
-    {                                                                                
-      "@id": "http://example.org/3",
-      "foaf:name": "Chandler Bing",
-      "foaf:age": "36"
-    },
-      {                                                                                
-      "@id": "http://example.org/4",
-      "foaf:name": "Ross Geller",
-      "foaf:age": "37"
-    }
-  ]
-}
-
-
-

52. RMLTTC0004b

-

Title: Target N3

-

Description: Test export all triples as N3

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.n3>;
-  ];
-  rml:serialization formats:N3;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-ex:0 <foaf:age> "33" ;
-     <foaf:name> "Monica Geller" .
-ex:1 <foaf:age> "34" ;
-     <foaf:name> "Rachel Green" .
-ex:2 <foaf:age> "35" ;
-     <foaf:name> "Joey Tribbiani" .
-ex:3 <foaf:age> "36" ;
-     <foaf:name> "Chandler Bing" .
-ex:4 <foaf:age> "37" ;
-     <foaf:name> "Ross Geller" .
-
-
-

53. RMLTTC0004c

-

Title: Target N-Triples

-

Description: Test export all triples as N-Triples

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nt>;
-  ];
-  rml:serialization formats:N-Triples;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

54. RMLTTC0004d

-

Title: Target N-Quads

-

Description: Test export all triples as N-Quads

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

55. RMLTTC0004e

-

Title: Target RDF/JSON

-

Description: Test export all triples as RDF/JSON

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.rdfjson>;
-  ];
-  rml:serialization formats:RDF_JSON;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-    "http://example.org/0" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
-    },
-    "http://example.org/1" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
-    },
-    "http://example.org/2" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
-    },
-    "http://example.org/3" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
-    },
-    "http://example.org/4" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
-    }
-}
-
-
-

56. RMLTTC0004f

-

Title: Target RDF/XML

-

Description: Test export all triples as RDF/XML

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004f/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.rdfxml>;
-  ];
-  rml:serialization formats:RDF_XML;
-.
-
-

Output 1

-

-
-

Output 2

-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns:foaf="http://xmlns.com/foaf/0.1/">
-  <rdf:Description rdf:about="http://example.org/0">
-    <foaf:age>33</foaf:age>
-    <foaf:name>Monica Geller</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/1">
-    <foaf:age>34</foaf:age>
-    <foaf:name>Rachel Green</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/2">
-    <foaf:age>35</foaf:age>
-    <foaf:name>Joey Tribbiani</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/3">
-    <foaf:age>36</foaf:age>
-    <foaf:name>Chandler Bing</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/4">
-    <foaf:age>37</foaf:age>
-    <foaf:name>Ross Geller</foaf:name>
-  </rdf:Description>
-</rdf:RDF>
-
-
-

57. RMLTTC0004g

-

Title: Target Turtle

-

Description: Test export all triples as Turtle

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0004g/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.ttl>;
-  ];
-  rml:serialization formats:Turtle;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-
-<ex:0> <foaf:age> "33" .
-<ex:0> <foaf:name> "Monica Geller" .
-<ex:1> <foaf:age> "34" .
-<ex:1> <foaf:name> "Rachel Green" .
-<ex:2> <foaf:age> "35" .
-<ex:2> <foaf:name> "Joey Tribbiani" .
-<ex:3> <foaf:age> "36" .
-<ex:3> <foaf:name> "Chandler Bing" .
-<ex:4> <foaf:age> "37" .
-<ex:4> <foaf:name> "Ross Geller" .
-
-
-

58. RMLTTC0005a

-

Title: Target UTF-8

-

Description: Test export all triples with UTF-8 encoding

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-8;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

59. RMLTTC0005b

-

Title: Target UTF-16

-

Description: Test export all triples with UTF-16 encoding

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0005b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-16;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

60. RMLTTC0006a

-

Title: Target no compression

-

Description: Test export all triples with no compression

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006a/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq>;
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

61. RMLTTC0006b

-

Title: Target GZip compression

-

Description: Test export all triples with GZip compression

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006b/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.gz>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:gzip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.gz

-
-

62. RMLTTC0006c

-

Title: Target Zip compression

-

Description: Test export all triples with ZIP compression

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006c/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.zip>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:zip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.zip

-
-

63. RMLTTC0006d

-

Title: Target TarXz compression

-

Description: Test export all triples with TarXZ compression

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006d/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.tar.xz>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:tarxz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.xz

-
-

64. RMLTTC0006e

-

Title: Target TarGzip compression

-

Description: Test export all triples with TarGZip compression

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#DCATSourceAccess> a rml:Source, dcat:Distribution;
-    dcat:downloadURL <http://w3id.org/rml/resources/rml-io/RMLTTC0006e/Friends.json>;
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#DCATSourceAccess>;
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, dcat:Distribution;
-    dcat:downloadURL <file://./dump1.nq.tar.gz>;
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:targz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.gz

-
-

65. RMLTTC0007a

-

Title: Target with FilePath description

-

Description: Test export all triples to a target with File path access description

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLTTC0007a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath, rml:Source;
-      rml:root rml:CurrentWorkingDirectory;
-      rml:path "./Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/20250228/index.html b/src/test/resources/rml-io/docs/20250228/index.html deleted file mode 100644 index 87cb8a9..0000000 --- a/src/test/resources/rml-io/docs/20250228/index.html +++ /dev/null @@ -1,6190 +0,0 @@ - - - - - - -RML-IO: Test Cases - - - - - - - - - - - - - - -
- -

RML-IO: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-IO-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-IO test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTC0001a

-

Title: Source with UTF-8 encoding

-

Description: Test source with UTF-8 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

5. RMLSTC0001b

-

Title: Source with UTF-16 encoding

-

Description: Test source with UTF-16 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-UTF16.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

6. RMLSTC0002a

-

Title: Source no compression

-

Description: Test source without compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

7. RMLSTC0002b

-

Title: Source GZip compression

-

Description: Test source with GZip compression

-

Error expected? No

-

Input - Friends.json.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.gz";
-      rml:compression rml:gzip;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

8. RMLSTC0002c

-

Title: Source Zip compression

-

Description: Test source with ZIP compression

-

Error expected? No

-

Input - Friends.json.zip

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.zip";
-      rml:compression rml:zip;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

9. RMLSTC0002d

-

Title: Source TarXz compression

-

Description: Test source with TarXZ compression

-

Error expected? No

-

Input - Friends.json.tar.xz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.tar.xz";
-      rml:compression rml:tarxz;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

10. RMLSTC0002e

-

Title: Source TarGzip compression

-

Description: Test source with TarGZip compression

-

Error expected? No

-

Input - Friends.json.tar.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.tar.gz";
-      rml:compression rml:targz;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

11. RMLSTC0003

-

Title: Source with query

-

Description: Test source which requires a query

-

Error expected? No

-

Input

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-        rml:path "./Friends.nt";
-    ];
-    rml:iterator """
-    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-    SELECT ?person ?name ?age WHERE {
-        ?person foaf:name ?name .
-        ?person foaf:age ?age .
-    }
-    """;
-    rml:referenceFormulation formats:SPARQL_Results_CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:reference "person";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

12. RMLSTC0004a

-

Title: Source with default NULL values

-

Description: Test source with default NULL values

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

13. RMLSTC0004b

-

Title: Source with one NULL value

-

Description: Test source with one NULL value defined

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-      rml:null "";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

14. RMLSTC0004c

-

Title: Source with multiple NULL values

-

Description: Test source with multiple NULL values defined

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-6,NULL,NULL
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-      rml:null "";
-      rml:null "NULL";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-
- - - - Error response - - -

Error response

-

Error code: 404

-

Message: File not found.

-

Error code explanation: 404 - Nothing matches the given URI.

- -
-
- - - - Error response - - -

Error response

-

Error code: 404

-

Message: File not found.

-

Error code explanation: 404 - Nothing matches the given URI.

- -
-

15. RMLSTC0006a

-

Title: Source with D2RQ access description

-

Description: Test source with D2RQ access description for SQL databases

-

Error expected? No

-

Input

-
id, name, age
-0, Monica Geller, 33
-1, Rachel Green, 34
-2, Joey Tribbiani, 35
-3, Chandler Bing, 36
-4, Ross Geller, 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#D2RQSourceAccess> a rml:Source, d2rq:Database;
-  d2rq:jdbcDSN "$CONNECTIONDSN";
-  d2rq:username "$USERNAME";
-  d2rq:password "$PASSWORD"
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#D2RQSourceAccess>;
-    rml:referenceFormulation rml:SQL2008Table;
-    rml:iterator "Friends";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

16. RMLSTC0006b

-

Title: Source with a Relative Path Source

-

Description: Test access to a file

-

Error expected? No

-

Input

-
id, name, age
-0, Monica Geller, 33
-1, Rachel Green, 34
-2, Joey Tribbiani, 35
-3, Chandler Bing, 36
-4, Ross Geller, 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath, rml:Source;
-      rml:root rml:CurrentWorkingDirectory;
-      rml:path "./Friends.csv"
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

17. RMLSTC0007a

-

Title: Source with JSONPath reference formulation

-

Description: Test source with JSONPath reference formulation

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

18. RMLSTC0007b

-

Title: Source with CSV reference formulation

-

Description: Test source with Tabular reference formulation

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

19. RMLSTC0007c

-

Title: Source with XPath reference formulation

-

Description: Test source with XPath reference formulation

-

Error expected? No

-

Input

-
<Friends>
-  <Character id="0">
-    <name>Monica Geller</name>
-    <age>33</age>
-  </Character>
-  <Character id="1">
-    <name>Rachel Green</name>
-    <age>34</age>
-  </Character>
-  <Character id="2">
-    <name>Joey Tribbiani</name>
-    <age>35</age>
-  </Character>
-  <Character id="3">
-    <name>Chandler Bing</name>
-    <age>36</age>
-  </Character>
-  <Character id="4">
-    <name>Ross Geller</name>
-    <age>37</age>
-  </Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.xml"
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "//Friends/Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

20. RMLSTC0007d

-

Title: Source with XPath reference formulation with namespaces

-

Description: Test source with XPath reference formulation with namespaces

-

Error expected? No

-

Input

-
<Friends xmlns:ex="http://example.org">
-  <ex:Character id="0">
-    <ex:name>Monica Geller</ex:name>
-    <ex:age>33</ex:age>
-  </ex:Character>
-  <ex:Character id="1">
-    <ex:name>Rachel Green</ex:name>
-    <ex:age>34</ex:age>
-  </ex:Character>
-  <ex:Character id="2">
-    <ex:name>Joey Tribbiani</ex:name>
-    <ex:age>35</ex:age>
-  </ex:Character>
-  <ex:Character id="3">
-    <ex:name>Chandler Bing</ex:name>
-    <ex:age>36</ex:age>
-  </ex:Character>
-  <ex:Character id="4">
-    <ex:name>Ross Geller</ex:name>
-    <ex:age>37</ex:age>
-  </ex:Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.xml"
-    ];
-    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
-      rml:namespace [ a rml:Namespace;
-        rml:namespacePrefix "ex";
-        rml:namespaceURL "http://example.org";
-      ];
-    ];
-    rml:iterator "//Friends/ex:Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

21. RMLSTC0008a

-

Title: Multiple sources of same type

-

Description: Tests the generation of all triples from multiple homogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends2.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

22. RMLSTC0008b

-

Title: Multiple sources of different type

-

Description: Tests the generation of all triples from multiple heterogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

23. RMLTTC0000

-

Title: Default target

-

Description: Test exporting all triples to the default Target when not Targets are specified.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

24. RMLTTC0001a

-

Title: Single Target: Subject Map

-

Description: Test exporting all triples to a single Target with a given subject.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

25. RMLTTC0001b

-

Title: Single Target: Predicate Map

-

Description: Test exporting all triples to a single Target with a given predicate.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

26. RMLTTC0001c

-

Title: Single Target: Object Map

-

Description: Test exporting all triples to a single Target with a given object reference.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

27. RMLTTC0001d

-

Title: Single Target: Graph Map

-

Description: Test exporting all triples within a named graph to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

28. RMLTTC0001e

-

Title: Single Target: Language Map

-

Description: Test exporting all triples with a given language tag to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

29. RMLTTC0001f

-

Title: Single Target: Datatype Map

-

Description: Test exporting all triples with a given datatype to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-
-

30. RMLTTC0002a

-

Title: Multiple Targets: Same Term Map

-

Description: Test exporting all triples to multiple Targets in the same Term Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

31. RMLTTC0002b

-

Title: Multiple Targets: Subject Map and Predicate Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

32. RMLTTC0002c

-

Title: Multiple Targets: Subject Map and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

33. RMLTTC0002d

-

Title: Multiple Targets: Predicate Map and Object Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

34. RMLTTC0002e

-

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump3>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump3> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump3.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

35. RMLTTC0002f

-

Title: Multiple Targets: Subject Map and Graph Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

36. RMLTTC0002g

-

Title: Multiple Targets: Predicate Map and Graph Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

37. RMLTTC0002h

-

Title: Multiple Targets: Object Map and Graph Map

-

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

38. RMLTTC0002i

-

Title: Multiple Targets: Language Map and Graph Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

39. RMLTTC0002j

-

Title: Multiple Targets: Language Map and Object Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

40. RMLTTC0002k

-

Title: Multiple Targets: Datatype Map and Graph Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

41. RMLTTC0002l

-

Title: Multiple Targets: Datatype Map and Object Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

42. RMLTTC0002m

-

Title: Multiple Targets: Multiple Predicate Maps

-

Description: Test exporting all triples to Targets in multiple Predicate Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

43. RMLTTC0002n

-

Title: Multiple Targets: Multiple Object Maps

-

Description: Test exporting all triples to Targets in multiple Object Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

44. RMLTTC0002o

-

Title: Multiple Targets: Multiple Graph Maps

-

Description: Test exporting all triples to Targets in multiple Graph Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph2> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph2> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph2> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph2> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph2> .
-
-
-

45. RMLTTC0002p

-

Title: Multiple Targets: Multiple Language Maps

-

Description: Test exporting all triples to Targets in multiple Language Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "nl";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
-
-
-

46. RMLTTC0002q

-

Title: Multiple Targets: Multiple Datatype Maps

-

Description: Test exporting all triples to Targets in multiple Datatype Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:double;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
-
-
-

47. RMLTTC0002r

-

Title: Multiple Targets: Multiple Term Maps with same Target

-

Description: Test exporting all triples to same Target in multiple Term Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

48. RMLTTC0003a

-

Title: Overriding Targets: Seperate Triples Map

-

Description: Test exporting some triples to a different Target with a separate Triples Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

49. RMLTTC0004a

-

Title: Target JSON-LD

-

Description: Test export all triples as JSON-LD

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.jsonld";
-  ];
-  rml:serialization formats:JSON-LD;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-  "@context": { 
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@graph": [
-    {                                                                                
-
-      "@id": "http://example.org/0",
-      "foaf:name": "Monica Geller",
-      "foaf:age": "33"
-    },
-    {                                                                                
-      "@id": "http://example.org/1",
-      "foaf:name": "Rachel Green",
-      "foaf:age": "34"
-    },
-    {                                                                                
-      "@id": "http://example.org/2",
-      "foaf:name": "Joey Tribbiani",
-      "foaf:age": "35"
-    },
-    {                                                                                
-      "@id": "http://example.org/3",
-      "foaf:name": "Chandler Bing",
-      "foaf:age": "36"
-    },
-      {                                                                                
-      "@id": "http://example.org/4",
-      "foaf:name": "Ross Geller",
-      "foaf:age": "37"
-    }
-  ]
-}
-
-
-

50. RMLTTC0004b

-

Title: Target N3

-

Description: Test export all triples as N3

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.n3";
-  ];
-  rml:serialization formats:N3;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-ex:0 <foaf:age> "33" ;
-     <foaf:name> "Monica Geller" .
-ex:1 <foaf:age> "34" ;
-     <foaf:name> "Rachel Green" .
-ex:2 <foaf:age> "35" ;
-     <foaf:name> "Joey Tribbiani" .
-ex:3 <foaf:age> "36" ;
-     <foaf:name> "Chandler Bing" .
-ex:4 <foaf:age> "37" ;
-     <foaf:name> "Ross Geller" .
-
-
-

51. RMLTTC0004c

-

Title: Target N-Triples

-

Description: Test export all triples as N-Triples

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nt";
-  ];
-  rml:serialization formats:N-Triples;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

52. RMLTTC0004d

-

Title: Target N-Quads

-

Description: Test export all triples as N-Quads

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

53. RMLTTC0004e

-

Title: Target RDF/JSON

-

Description: Test export all triples as RDF/JSON

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.rdfjson";
-  ];
-  rml:serialization formats:RDF_JSON;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-    "http://example.org/0" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
-    },
-    "http://example.org/1" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
-    },
-    "http://example.org/2" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
-    },
-    "http://example.org/3" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
-    },
-    "http://example.org/4" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
-    }
-}
-
-
-

54. RMLTTC0004f

-

Title: Target RDF/XML

-

Description: Test export all triples as RDF/XML

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:RDF_XML;
-.
-
-

Output 1

-

-
-

Output 2

-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns:foaf="http://xmlns.com/foaf/0.1/">
-  <rdf:Description rdf:about="http://example.org/0">
-    <foaf:age>33</foaf:age>
-    <foaf:name>Monica Geller</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/1">
-    <foaf:age>34</foaf:age>
-    <foaf:name>Rachel Green</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/2">
-    <foaf:age>35</foaf:age>
-    <foaf:name>Joey Tribbiani</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/3">
-    <foaf:age>36</foaf:age>
-    <foaf:name>Chandler Bing</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/4">
-    <foaf:age>37</foaf:age>
-    <foaf:name>Ross Geller</foaf:name>
-  </rdf:Description>
-</rdf:RDF>
-
-
-

55. RMLTTC0004g

-

Title: Target Turtle

-

Description: Test export all triples as Turtle

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:Turtle;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-
-<ex:0> <foaf:age> "33" .
-<ex:0> <foaf:name> "Monica Geller" .
-<ex:1> <foaf:age> "34" .
-<ex:1> <foaf:name> "Rachel Green" .
-<ex:2> <foaf:age> "35" .
-<ex:2> <foaf:name> "Joey Tribbiani" .
-<ex:3> <foaf:age> "36" .
-<ex:3> <foaf:name> "Chandler Bing" .
-<ex:4> <foaf:age> "37" .
-<ex:4> <foaf:name> "Ross Geller" .
-
-
-

56. RMLTTC0005a

-

Title: Target UTF-8

-

Description: Test export all triples with UTF-8 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-8;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

57. RMLTTC0005b

-

Title: Target UTF-16

-

Description: Test export all triples with UTF-16 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-16;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

58. RMLTTC0006a

-

Title: Target no compression

-

Description: Test export all triples with no compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

59. RMLTTC0006b

-

Title: Target GZip compression

-

Description: Test export all triples with GZip compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.gz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:gzip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.gz

-
-

60. RMLTTC0006c

-

Title: Target Zip compression

-

Description: Test export all triples with ZIP compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.zip";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:zip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.zip

-
-

61. RMLTTC0006d

-

Title: Target TarXz compression

-

Description: Test export all triples with TarXZ compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.tar.xz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:tarxz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.xz

-
-

62. RMLTTC0006e

-

Title: Target TarGzip compression

-

Description: Test export all triples with TarGZip compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.tar.gz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:targz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.gz

-
-

63. RMLTTC0007a

-

Title: Target with FilePath description

-

Description: Test export all triples to a target with File path access description

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/20250630/index.html b/src/test/resources/rml-io/docs/20250630/index.html deleted file mode 100644 index 55fa3c7..0000000 --- a/src/test/resources/rml-io/docs/20250630/index.html +++ /dev/null @@ -1,6880 +0,0 @@ - - - - - - -RML-IO: Test Cases - - - - - - - - - - - - - - - -
- -

RML-IO: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-IO-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-IO test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTC0001a

-

Title: Source with UTF-8 encoding

-

Description: Test source with UTF-8 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

5. RMLSTC0001b

-

Title: Source with UTF-16 encoding

-

Description: Test source with UTF-16 encoding

-

Error expected? No

-

Input

-
��[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-UTF16.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

6. RMLSTC0002a

-

Title: Source no compression

-

Description: Test source without compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

7. RMLSTC0002b

-

Title: Source GZip compression

-

Description: Test source with GZip compression

-

Error expected? No

-

Input - Friends.json.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.gz";
-      rml:compression rml:gzip;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

8. RMLSTC0002c

-

Title: Source Zip compression

-

Description: Test source with ZIP compression

-

Error expected? No

-

Input - Friends.json.zip

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.zip";
-      rml:compression rml:zip;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

9. RMLSTC0002d

-

Title: Source TarXz compression

-

Description: Test source with TarXZ compression

-

Error expected? No

-

Input - Friends.json.tar.xz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.tar.xz";
-      rml:compression rml:tarxz;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

10. RMLSTC0002e

-

Title: Source TarGzip compression

-

Description: Test source with TarGZip compression

-

Error expected? No

-

Input - Friends.json.tar.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.tar.gz";
-      rml:compression rml:targz;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

11. RMLSTC0003

-

Title: Source with query

-

Description: Test source which requires a query

-

Error expected? No

-

Input

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-        rml:path "./Friends.nt";
-    ];
-    rml:iterator """
-    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-    SELECT ?person ?name ?age WHERE {
-        ?person foaf:name ?name .
-        ?person foaf:age ?age .
-    }
-    """;
-    rml:referenceFormulation formats:SPARQL_Results_CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:reference "person";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

12. RMLSTC0004a

-

Title: Source with default NULL values

-

Description: Test source with default NULL values

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

13. RMLSTC0004b

-

Title: Source with one NULL value

-

Description: Test source with one NULL value defined

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-      rml:null "";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

14. RMLSTC0004c

-

Title: Source with multiple NULL values

-

Description: Test source with multiple NULL values defined

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-6,NULL,NULL
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-      rml:null "";
-      rml:null "NULL";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

15. RMLSTC0006a

-

Title: Source with D2RQ access description

-

Description: Test source with D2RQ access description for SQL databases

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#D2RQSourceAccess> a rml:Source, d2rq:Database;
-  d2rq:jdbcDSN "$CONNECTIONDSN";
-  d2rq:username "$USERNAME";
-  d2rq:password "$PASSWORD"
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#D2RQSourceAccess>;
-    rml:referenceFormulation rml:SQL2008Table;
-    rml:iterator "Friends";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

16. RMLSTC0006b

-

Title: Source with a Relative Path Source

-

Description: Test access to a file

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath, rml:Source;
-      rml:root rml:CurrentWorkingDirectory;
-      rml:path "./Friends.csv"
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

17. RMLSTC0007a

-

Title: Source with JSONPath reference formulation

-

Description: Test source with JSONPath reference formulation

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

18. RMLSTC0007b

-

Title: Source with CSV reference formulation

-

Description: Test source with Tabular reference formulation

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

19. RMLSTC0007c

-

Title: Source with XPath reference formulation

-

Description: Test source with XPath reference formulation

-

Error expected? No

-

Input

-
<Friends>
-  <Character id="0">
-    <name>Monica Geller</name>
-    <age>33</age>
-  </Character>
-  <Character id="1">
-    <name>Rachel Green</name>
-    <age>34</age>
-  </Character>
-  <Character id="2">
-    <name>Joey Tribbiani</name>
-    <age>35</age>
-  </Character>
-  <Character id="3">
-    <name>Chandler Bing</name>
-    <age>36</age>
-  </Character>
-  <Character id="4">
-    <name>Ross Geller</name>
-    <age>37</age>
-  </Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.xml"
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "//Friends/Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

20. RMLSTC0007d

-

Title: Source with XPath reference formulation with namespaces

-

Description: Test source with XPath reference formulation with namespaces

-

Error expected? No

-

Input

-
<Friends xmlns:ex="http://example.org">
-  <ex:Character id="0">
-    <ex:name>Monica Geller</ex:name>
-    <ex:age>33</ex:age>
-  </ex:Character>
-  <ex:Character id="1">
-    <ex:name>Rachel Green</ex:name>
-    <ex:age>34</ex:age>
-  </ex:Character>
-  <ex:Character id="2">
-    <ex:name>Joey Tribbiani</ex:name>
-    <ex:age>35</ex:age>
-  </ex:Character>
-  <ex:Character id="3">
-    <ex:name>Chandler Bing</ex:name>
-    <ex:age>36</ex:age>
-  </ex:Character>
-  <ex:Character id="4">
-    <ex:name>Ross Geller</ex:name>
-    <ex:age>37</ex:age>
-  </ex:Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.xml"
-    ];
-    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
-      rml:namespace [ a rml:Namespace;
-        rml:namespacePrefix "ex";
-        rml:namespaceURL "http://example.org";
-      ];
-    ];
-    rml:iterator "//Friends/ex:Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

21. RMLSTC0008a

-

Title: Multiple sources of same type

-

Description: Tests the generation of all triples from multiple homogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends2.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

22. RMLSTC0008b

-

Title: Multiple sources of different type

-

Description: Tests the generation of all triples from multiple heterogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

23. RMLSTC0009a

-

Title: Source with quoted columns

-

Description: Tests the generation of triples where columns are quoted

-

Error expected? Yes

-

Input

-
"id","name","age"
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-
-

24. RMLSTC0010a

-

Title: Invalid CSV source, reference to invalid column

-

Description: Tests the identification of invalid CSV sources

-

Error expected? Yes

-

Input

-
id,name,age
-6,Phoebe Buffay 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ].
-
-
-

25. RMLSTC0010b

-

Title: Invalid CSV source, no reference to invalid column

-

Description: Tests the identification of invalid CSV sources, even when all columns referenced are valid

-

Error expected? Yes

-

Input

-
id,name,age
-6,Phoebe Buffay 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ].
-
-
-

26. RMLSTC0011a

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ].
-
-

Output

-
<http://example.org/InnovateX> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
-<http://example.org/TechCorp> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
-
-
-

27. RMLSTC0011b

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:department;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.departments[*].name";
-    ];
-  ].
-
-

Output

-
<http://example.org/InnovateX> <http://example.com/department> "Research & Development" .
-<http://example.org/InnovateX> <http://example.com/department> "Sales" .
-<http://example.org/TechCorp> <http://example.com/department> "Engineering" .
-<http://example.org/TechCorp> <http://example.com/department> "Marketing" .
-
-
-

28. RMLSTC0011c

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:employee;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.departments[*].employees[*].name";
-    ];
-  ].
-
-

Output

-
<http://example.org/InnovateX> <http://example.com/employee> "Liam Brown" .
-<http://example.org/InnovateX> <http://example.com/employee> "Olivia Martinez" .
-<http://example.org/InnovateX> <http://example.com/employee> "Sophia White" .
-<http://example.org/TechCorp> <http://example.com/employee> "Bob Smith" .
-<http://example.org/TechCorp> <http://example.com/employee> "Eve Davis" .
-<http://example.org/TechCorp> <http://example.com/employee> "Sarah Lee" .
-
-
-

29. RMLSTC0011d

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*].departments[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.manager.name";
-    ];
-  ].
-
-

Output

-
<http://example.org/Engineering> <http://xmlns.com/foaf/0.1/name> "Alice Johnson" .
-<http://example.org/Marketing> <http://xmlns.com/foaf/0.1/name> "John Doe" .
-<http://example.org/Research%20%26%20Development> <http://xmlns.com/foaf/0.1/name> "Emma Wilson" .
-<http://example.org/Sales> <http://xmlns.com/foaf/0.1/name> "Michael Green" .
-
-
-

30. RMLSTC0011e

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*].departments[*].employees[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:skill;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.skills[*]";
-    ];
-  ].
-
-

Output

-
<http://example.org/Bob%20Smith> <http://example.com/skill> "AWS" .
-<http://example.org/Bob%20Smith> <http://example.com/skill> "JavaScript" .
-<http://example.org/Bob%20Smith> <http://example.com/skill> "Python" .
-<http://example.org/Eve%20Davis> <http://example.com/skill> "Docker" .
-<http://example.org/Eve%20Davis> <http://example.com/skill> "Kubernetes" .
-<http://example.org/Eve%20Davis> <http://example.com/skill> "Terraform" .
-<http://example.org/Liam%20Brown> <http://example.com/skill> "Deep Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/skill> "Machine Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/skill> "Python" .
-<http://example.org/Olivia%20Martinez> <http://example.com/skill> "CRM" .
-<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Lead Generation" .
-<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Negotiation" .
-<http://example.org/Sarah%20Lee> <http://example.com/skill> "Copywriting" .
-<http://example.org/Sarah%20Lee> <http://example.com/skill> "Google Ads" .
-<http://example.org/Sarah%20Lee> <http://example.com/skill> "SEO" .
-<http://example.org/Sophia%20White> <http://example.com/skill> "Data Analysis" .
-<http://example.org/Sophia%20White> <http://example.com/skill> "R" .
-<http://example.org/Sophia%20White> <http://example.com/skill> "SQL" .
-
-
-

31. RMLSTC0012a

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
-<http://example.org/35> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
-
-
-

32. RMLSTC0012b

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{../@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:department;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "department/name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://example.com/department> "Engineering" .
-<http://example.org/25> <http://example.com/department> "Marketing" .
-<http://example.org/35> <http://example.com/department> "Research & Development" .
-<http://example.org/35> <http://example.com/department> "Sales" .
-
-
-

33. RMLSTC0012c

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments/department/employees";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{../../../@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:employee;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "employee/name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://example.com/employee> "Bob Smith" .
-<http://example.org/25> <http://example.com/employee> "Eve Davis" .
-<http://example.org/25> <http://example.com/employee> "Sarah Lee" .
-<http://example.org/35> <http://example.com/employee> "Liam Brown" .
-<http://example.org/35> <http://example.com/employee> "Olivia Martinez" .
-<http://example.org/35> <http://example.com/employee> "Sophia White" .
-
-
-

34. RMLSTC0012d

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments/department";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{../../@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:manager;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "manager/name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://example.com/manager> "Alice Johnson" .
-<http://example.org/25> <http://example.com/manager> "John Doe" .
-<http://example.org/35> <http://example.com/manager> "Emma Wilson" .
-<http://example.org/35> <http://example.com/manager> "Michael Green" .
-
-
-

35. RMLSTC0012e

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments/department/employees/employee";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:skill;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "skills/skill";
-    ];
-  ].
-
-

Output

-
<http://example.org/Bob%20Smith> <http://example.com/employee> "AWS" .
-<http://example.org/Bob%20Smith> <http://example.com/employee> "JavaScript" .
-<http://example.org/Bob%20Smith> <http://example.com/employee> "Python" .
-<http://example.org/Eve%20Davis> <http://example.com/employee> "Docker" .
-<http://example.org/Eve%20Davis> <http://example.com/employee> "Kubernetes" .
-<http://example.org/Eve%20Davis> <http://example.com/employee> "Terraform" .
-<http://example.org/Liam%20Brown> <http://example.com/employee> "Deep Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/employee> "Machine Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/employee> "Python" .
-<http://example.org/Olivia%20Martinez> <http://example.com/employee> "CRM" .
-<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Lead Generation" .
-<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Negotiation" .
-<http://example.org/Sarah%20Lee> <http://example.com/employee> "Copywriting" .
-<http://example.org/Sarah%20Lee> <http://example.com/employee> "Google Ads" .
-<http://example.org/Sarah%20Lee> <http://example.com/employee> "SEO" .
-<http://example.org/Sophia%20White> <http://example.com/employee> "Data Analysis" .
-<http://example.org/Sophia%20White> <http://example.com/employee> "R" .
-<http://example.org/Sophia%20White> <http://example.com/employee> "SQL" .
-
-
-

36. RMLTTC0000

-

Title: Default target

-

Description: Test exporting all triples to the default Target when not Targets are specified.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

37. RMLTTC0001a

-

Title: Single Target: Subject Map

-

Description: Test exporting all triples to a single Target with a given subject.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

38. RMLTTC0001b

-

Title: Single Target: Predicate Map

-

Description: Test exporting all triples to a single Target with a given predicate.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

39. RMLTTC0001c

-

Title: Single Target: Object Map

-

Description: Test exporting all triples to a single Target with a given object reference.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

40. RMLTTC0001d

-

Title: Single Target: Graph Map

-

Description: Test exporting all triples within a named graph to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

41. RMLTTC0001e

-

Title: Single Target: Language Map

-

Description: Test exporting all triples with a given language tag to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

42. RMLTTC0001f

-

Title: Single Target: Datatype Map

-

Description: Test exporting all triples with a given datatype to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-
-

43. RMLTTC0002a

-

Title: Multiple Targets: Same Term Map

-

Description: Test exporting all triples to multiple Targets in the same Term Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

44. RMLTTC0002b

-

Title: Multiple Targets: Subject Map and Predicate Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

45. RMLTTC0002c

-

Title: Multiple Targets: Subject Map and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

46. RMLTTC0002d

-

Title: Multiple Targets: Predicate Map and Object Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

47. RMLTTC0002e

-

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump3>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump3> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump3.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

48. RMLTTC0002f

-

Title: Multiple Targets: Subject Map and Graph Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

49. RMLTTC0002g

-

Title: Multiple Targets: Predicate Map and Graph Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

50. RMLTTC0002h

-

Title: Multiple Targets: Object Map and Graph Map

-

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

51. RMLTTC0002i

-

Title: Multiple Targets: Language Map and Graph Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

52. RMLTTC0002j

-

Title: Multiple Targets: Language Map and Object Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

53. RMLTTC0002k

-

Title: Multiple Targets: Datatype Map and Graph Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

54. RMLTTC0002l

-

Title: Multiple Targets: Datatype Map and Object Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

55. RMLTTC0002m

-

Title: Multiple Targets: Multiple Predicate Maps

-

Description: Test exporting all triples to Targets in multiple Predicate Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

56. RMLTTC0002n

-

Title: Multiple Targets: Multiple Object Maps

-

Description: Test exporting all triples to Targets in multiple Object Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

57. RMLTTC0002o

-

Title: Multiple Targets: Multiple Graph Maps

-

Description: Test exporting all triples to Targets in multiple Graph Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph2;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph2> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph2> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph2> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph2> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph2> .
-
-
-

58. RMLTTC0002p

-

Title: Multiple Targets: Multiple Language Maps

-

Description: Test exporting all triples to Targets in multiple Language Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "nl";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
-
-
-

59. RMLTTC0002q

-

Title: Multiple Targets: Multiple Datatype Maps

-

Description: Test exporting all triples to Targets in multiple Datatype Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:double;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
-
-
-

60. RMLTTC0002r

-

Title: Multiple Targets: Multiple Term Maps with same Target

-

Description: Test exporting all triples to same Target in multiple Term Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

61. RMLTTC0003a

-

Title: Overriding Targets: Seperate Triples Map

-

Description: Test exporting some triples to a different Target with a separate Triples Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

62. RMLTTC0004a

-

Title: Target JSON-LD

-

Description: Test export all triples as JSON-LD

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.jsonld";
-  ];
-  rml:serialization formats:JSON-LD;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-  "@context": { 
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@graph": [
-    {                                                                                
-
-      "@id": "http://example.org/0",
-      "foaf:name": "Monica Geller",
-      "foaf:age": "33"
-    },
-    {                                                                                
-      "@id": "http://example.org/1",
-      "foaf:name": "Rachel Green",
-      "foaf:age": "34"
-    },
-    {                                                                                
-      "@id": "http://example.org/2",
-      "foaf:name": "Joey Tribbiani",
-      "foaf:age": "35"
-    },
-    {                                                                                
-      "@id": "http://example.org/3",
-      "foaf:name": "Chandler Bing",
-      "foaf:age": "36"
-    },
-      {                                                                                
-      "@id": "http://example.org/4",
-      "foaf:name": "Ross Geller",
-      "foaf:age": "37"
-    }
-  ]
-}
-
-
-

63. RMLTTC0004b

-

Title: Target N3

-

Description: Test export all triples as N3

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.n3";
-  ];
-  rml:serialization formats:N3;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-ex:0 <foaf:age> "33" ;
-     <foaf:name> "Monica Geller" .
-ex:1 <foaf:age> "34" ;
-     <foaf:name> "Rachel Green" .
-ex:2 <foaf:age> "35" ;
-     <foaf:name> "Joey Tribbiani" .
-ex:3 <foaf:age> "36" ;
-     <foaf:name> "Chandler Bing" .
-ex:4 <foaf:age> "37" ;
-     <foaf:name> "Ross Geller" .
-
-
-

64. RMLTTC0004c

-

Title: Target N-Triples

-

Description: Test export all triples as N-Triples

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nt";
-  ];
-  rml:serialization formats:N-Triples;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

65. RMLTTC0004d

-

Title: Target N-Quads

-

Description: Test export all triples as N-Quads

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

66. RMLTTC0004e

-

Title: Target RDF/JSON

-

Description: Test export all triples as RDF/JSON

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.rdfjson";
-  ];
-  rml:serialization formats:RDF_JSON;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-    "http://example.org/0" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
-    },
-    "http://example.org/1" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
-    },
-    "http://example.org/2" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
-    },
-    "http://example.org/3" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
-    },
-    "http://example.org/4" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
-    }
-}
-
-
-

67. RMLTTC0004f

-

Title: Target RDF/XML

-

Description: Test export all triples as RDF/XML

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.rdfxml";
-  ];
-  rml:serialization formats:RDF_XML;
-.
-
-

Output 1

-

-
-

Output 2

-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns:foaf="http://xmlns.com/foaf/0.1/">
-  <rdf:Description rdf:about="http://example.org/0">
-    <foaf:age>33</foaf:age>
-    <foaf:name>Monica Geller</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/1">
-    <foaf:age>34</foaf:age>
-    <foaf:name>Rachel Green</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/2">
-    <foaf:age>35</foaf:age>
-    <foaf:name>Joey Tribbiani</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/3">
-    <foaf:age>36</foaf:age>
-    <foaf:name>Chandler Bing</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/4">
-    <foaf:age>37</foaf:age>
-    <foaf:name>Ross Geller</foaf:name>
-  </rdf:Description>
-</rdf:RDF>
-
-
-

68. RMLTTC0004g

-

Title: Target Turtle

-

Description: Test export all triples as Turtle

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.ttl";
-  ];
-  rml:serialization formats:Turtle;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

69. RMLTTC0005a

-

Title: Target UTF-8

-

Description: Test export all triples with UTF-8 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-8;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

70. RMLTTC0005b

-

Title: Target UTF-16

-

Description: Test export all triples with UTF-16 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-16;
-.
-
-

Output 1

-

-
-

Output 2

-
��<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-
-

71. RMLTTC0006a

-

Title: Target no compression

-

Description: Test export all triples with no compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

72. RMLTTC0006b

-

Title: Target GZip compression

-

Description: Test export all triples with GZip compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.gz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:gzip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.gz

-
-

73. RMLTTC0006c

-

Title: Target Zip compression

-

Description: Test export all triples with ZIP compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.zip";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:zip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.zip

-
-

74. RMLTTC0006d

-

Title: Target TarXz compression

-

Description: Test export all triples with TarXZ compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.tar.xz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:tarxz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.xz

-
-

75. RMLTTC0006e

-

Title: Target TarGzip compression

-

Description: Test export all triples with TarGZip compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.tar.gz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:targz;
-.
-
-

Output 1

-

-
-

Output 2

-
����j�0�\�)B -�ҋ��0�����j &N-�o?�޸9�l��	ϟ1���%��D/UjX�6��@F*%R�H('�$B�O)�➥&��
-�$�:�����jWv]�ȹ��v����bO�ח���e�⧠O\0�ua�t��~������LӃq�4s��j]z���8zh��s��%5�u��K0W�����jo�F�K����c��R��?�d}17I-�]���%�����۷�o�M��((
-
-
-

76. RMLTTC0007a

-

Title: Target with FilePath description

-

Description: Test export all triples to a target with File path access description

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/docs/index.html b/src/test/resources/rml-io/docs/index.html deleted file mode 100644 index 55fa3c7..0000000 --- a/src/test/resources/rml-io/docs/index.html +++ /dev/null @@ -1,6880 +0,0 @@ - - - - - - -RML-IO: Test Cases - - - - - - - - - - - - - - - -
- -

RML-IO: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-IO-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/io/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-IO test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTC0001a

-

Title: Source with UTF-8 encoding

-

Description: Test source with UTF-8 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

5. RMLSTC0001b

-

Title: Source with UTF-16 encoding

-

Description: Test source with UTF-16 encoding

-

Error expected? No

-

Input

-
��[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-UTF16.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

6. RMLSTC0002a

-

Title: Source no compression

-

Description: Test source without compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json"
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

7. RMLSTC0002b

-

Title: Source GZip compression

-

Description: Test source with GZip compression

-

Error expected? No

-

Input - Friends.json.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.gz";
-      rml:compression rml:gzip;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

8. RMLSTC0002c

-

Title: Source Zip compression

-

Description: Test source with ZIP compression

-

Error expected? No

-

Input - Friends.json.zip

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.zip";
-      rml:compression rml:zip;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

9. RMLSTC0002d

-

Title: Source TarXz compression

-

Description: Test source with TarXZ compression

-

Error expected? No

-

Input - Friends.json.tar.xz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.tar.xz";
-      rml:compression rml:tarxz;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

10. RMLSTC0002e

-

Title: Source TarGzip compression

-

Description: Test source with TarGZip compression

-

Error expected? No

-

Input - Friends.json.tar.gz

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json.tar.gz";
-      rml:compression rml:targz;
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

11. RMLSTC0003

-

Title: Source with query

-

Description: Test source which requires a query

-

Error expected? No

-

Input

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-        rml:path "./Friends.nt";
-    ];
-    rml:iterator """
-    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-    SELECT ?person ?name ?age WHERE {
-        ?person foaf:name ?name .
-        ?person foaf:age ?age .
-    }
-    """;
-    rml:referenceFormulation formats:SPARQL_Results_CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:reference "person";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

12. RMLSTC0004a

-

Title: Source with default NULL values

-

Description: Test source with default NULL values

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

13. RMLSTC0004b

-

Title: Source with one NULL value

-

Description: Test source with one NULL value defined

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-      rml:null "";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

14. RMLSTC0004c

-

Title: Source with multiple NULL values

-

Description: Test source with multiple NULL values defined

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-5,,
-6,NULL,NULL
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends-NULL.csv";
-      rml:null "";
-      rml:null "NULL";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

15. RMLSTC0006a

-

Title: Source with D2RQ access description

-

Description: Test source with D2RQ access description for SQL databases

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#D2RQSourceAccess> a rml:Source, d2rq:Database;
-  d2rq:jdbcDSN "$CONNECTIONDSN";
-  d2rq:username "$USERNAME";
-  d2rq:password "$PASSWORD"
-.
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source <#D2RQSourceAccess>;
-    rml:referenceFormulation rml:SQL2008Table;
-    rml:iterator "Friends";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

16. RMLSTC0006b

-

Title: Source with a Relative Path Source

-

Description: Test access to a file

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath, rml:Source;
-      rml:root rml:CurrentWorkingDirectory;
-      rml:path "./Friends.csv"
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

17. RMLSTC0007a

-

Title: Source with JSONPath reference formulation

-

Description: Test source with JSONPath reference formulation

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

18. RMLSTC0007b

-

Title: Source with CSV reference formulation

-

Description: Test source with Tabular reference formulation

-

Error expected? No

-

Input

-
id,name,age
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

19. RMLSTC0007c

-

Title: Source with XPath reference formulation

-

Description: Test source with XPath reference formulation

-

Error expected? No

-

Input

-
<Friends>
-  <Character id="0">
-    <name>Monica Geller</name>
-    <age>33</age>
-  </Character>
-  <Character id="1">
-    <name>Rachel Green</name>
-    <age>34</age>
-  </Character>
-  <Character id="2">
-    <name>Joey Tribbiani</name>
-    <age>35</age>
-  </Character>
-  <Character id="3">
-    <name>Chandler Bing</name>
-    <age>36</age>
-  </Character>
-  <Character id="4">
-    <name>Ross Geller</name>
-    <age>37</age>
-  </Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.xml"
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "//Friends/Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

20. RMLSTC0007d

-

Title: Source with XPath reference formulation with namespaces

-

Description: Test source with XPath reference formulation with namespaces

-

Error expected? No

-

Input

-
<Friends xmlns:ex="http://example.org">
-  <ex:Character id="0">
-    <ex:name>Monica Geller</ex:name>
-    <ex:age>33</ex:age>
-  </ex:Character>
-  <ex:Character id="1">
-    <ex:name>Rachel Green</ex:name>
-    <ex:age>34</ex:age>
-  </ex:Character>
-  <ex:Character id="2">
-    <ex:name>Joey Tribbiani</ex:name>
-    <ex:age>35</ex:age>
-  </ex:Character>
-  <ex:Character id="3">
-    <ex:name>Chandler Bing</ex:name>
-    <ex:age>36</ex:age>
-  </ex:Character>
-  <ex:Character id="4">
-    <ex:name>Ross Geller</ex:name>
-    <ex:age>37</ex:age>
-  </ex:Character>
-</Friends>
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.xml"
-    ];
-    rml:referenceFormulation [ a rml:XPathReferenceFormulation;
-      rml:namespace [ a rml:Namespace;
-        rml:namespacePrefix "ex";
-        rml:namespaceURL "http://example.org";
-      ];
-    ];
-    rml:iterator "//Friends/ex:Character";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:name/text()";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "ex:age/text()";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

21. RMLSTC0008a

-

Title: Multiple sources of same type

-

Description: Tests the generation of all triples from multiple homogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends2.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

22. RMLSTC0008b

-

Title: Multiple sources of different type

-

Description: Tests the generation of all triples from multiple heterogeneous sources

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:RelativePathSource;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/6> <http://xmlns.com/foaf/0.1/name> "Phoebe Buffay" .
-
-
-

23. RMLSTC0009a

-

Title: Source with quoted columns

-

Description: Tests the generation of triples where columns are quoted

-

Error expected? Yes

-

Input

-
"id","name","age"
-0,Monica Geller,33
-1,Rachel Green,34
-2,Joey Tribbiani,35
-3,Chandler Bing,36
-4,Ross Geller,37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ];
-.
-
-
-

24. RMLSTC0010a

-

Title: Invalid CSV source, reference to invalid column

-

Description: Tests the identification of invalid CSV sources

-

Error expected? Yes

-

Input

-
id,name,age
-6,Phoebe Buffay 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "age";
-    ];
-  ].
-
-
-

25. RMLSTC0010b

-

Title: Invalid CSV source, no reference to invalid column

-

Description: Tests the identification of invalid CSV sources, even when all columns referenced are valid

-

Error expected? Yes

-

Input

-
id,name,age
-6,Phoebe Buffay 37
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.csv";
-    ];
-    rml:referenceFormulation rml:CSV;
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ].
-
-
-

26. RMLSTC0011a

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ].
-
-

Output

-
<http://example.org/InnovateX> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
-<http://example.org/TechCorp> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
-
-
-

27. RMLSTC0011b

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:department;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.departments[*].name";
-    ];
-  ].
-
-

Output

-
<http://example.org/InnovateX> <http://example.com/department> "Research & Development" .
-<http://example.org/InnovateX> <http://example.com/department> "Sales" .
-<http://example.org/TechCorp> <http://example.com/department> "Engineering" .
-<http://example.org/TechCorp> <http://example.com/department> "Marketing" .
-
-
-

28. RMLSTC0011c

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:employee;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.departments[*].employees[*].name";
-    ];
-  ].
-
-

Output

-
<http://example.org/InnovateX> <http://example.com/employee> "Liam Brown" .
-<http://example.org/InnovateX> <http://example.com/employee> "Olivia Martinez" .
-<http://example.org/InnovateX> <http://example.com/employee> "Sophia White" .
-<http://example.org/TechCorp> <http://example.com/employee> "Bob Smith" .
-<http://example.org/TechCorp> <http://example.com/employee> "Eve Davis" .
-<http://example.org/TechCorp> <http://example.com/employee> "Sarah Lee" .
-
-
-

29. RMLSTC0011d

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*].departments[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.manager.name";
-    ];
-  ].
-
-

Output

-
<http://example.org/Engineering> <http://xmlns.com/foaf/0.1/name> "Alice Johnson" .
-<http://example.org/Marketing> <http://xmlns.com/foaf/0.1/name> "John Doe" .
-<http://example.org/Research%20%26%20Development> <http://xmlns.com/foaf/0.1/name> "Emma Wilson" .
-<http://example.org/Sales> <http://xmlns.com/foaf/0.1/name> "Michael Green" .
-
-
-

30. RMLSTC0011e

-

Title: Complex JSON source

-

Description: Tests the generation of triples from complex JSON sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$.companies[*].departments[*].employees[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:skill;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.skills[*]";
-    ];
-  ].
-
-

Output

-
<http://example.org/Bob%20Smith> <http://example.com/skill> "AWS" .
-<http://example.org/Bob%20Smith> <http://example.com/skill> "JavaScript" .
-<http://example.org/Bob%20Smith> <http://example.com/skill> "Python" .
-<http://example.org/Eve%20Davis> <http://example.com/skill> "Docker" .
-<http://example.org/Eve%20Davis> <http://example.com/skill> "Kubernetes" .
-<http://example.org/Eve%20Davis> <http://example.com/skill> "Terraform" .
-<http://example.org/Liam%20Brown> <http://example.com/skill> "Deep Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/skill> "Machine Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/skill> "Python" .
-<http://example.org/Olivia%20Martinez> <http://example.com/skill> "CRM" .
-<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Lead Generation" .
-<http://example.org/Olivia%20Martinez> <http://example.com/skill> "Negotiation" .
-<http://example.org/Sarah%20Lee> <http://example.com/skill> "Copywriting" .
-<http://example.org/Sarah%20Lee> <http://example.com/skill> "Google Ads" .
-<http://example.org/Sarah%20Lee> <http://example.com/skill> "SEO" .
-<http://example.org/Sophia%20White> <http://example.com/skill> "Data Analysis" .
-<http://example.org/Sophia%20White> <http://example.com/skill> "R" .
-<http://example.org/Sophia%20White> <http://example.com/skill> "SQL" .
-
-
-

31. RMLSTC0012a

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://xmlns.com/foaf/0.1/name> "TechCorp" .
-<http://example.org/35> <http://xmlns.com/foaf/0.1/name> "InnovateX" .
-
-
-

32. RMLSTC0012b

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{../@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:department;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "department/name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://example.com/department> "Engineering" .
-<http://example.org/25> <http://example.com/department> "Marketing" .
-<http://example.org/35> <http://example.com/department> "Research & Development" .
-<http://example.org/35> <http://example.com/department> "Sales" .
-
-
-

33. RMLSTC0012c

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments/department/employees";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{../../../@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:employee;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "employee/name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://example.com/employee> "Bob Smith" .
-<http://example.org/25> <http://example.com/employee> "Eve Davis" .
-<http://example.org/25> <http://example.com/employee> "Sarah Lee" .
-<http://example.org/35> <http://example.com/employee> "Liam Brown" .
-<http://example.org/35> <http://example.com/employee> "Olivia Martinez" .
-<http://example.org/35> <http://example.com/employee> "Sophia White" .
-
-
-

34. RMLSTC0012d

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments/department";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{../../@id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:manager;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "manager/name";
-    ];
-  ].
-
-

Output

-
<http://example.org/25> <http://example.com/manager> "Alice Johnson" .
-<http://example.org/25> <http://example.com/manager> "John Doe" .
-<http://example.org/35> <http://example.com/manager> "Emma Wilson" .
-<http://example.org/35> <http://example.com/manager> "Michael Green" .
-
-
-

35. RMLSTC0012e

-

Title: Complex XML source

-

Description: Tests the generation of triples from complex XML sources

-

Error expected? No

-

Input - http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.com/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "companies.xml";
-    ];
-    rml:referenceFormulation rml:XPath;
-    rml:iterator "/companies/company/departments/department/employees/employee";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{name}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant ex:skill;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "skills/skill";
-    ];
-  ].
-
-

Output

-
<http://example.org/Bob%20Smith> <http://example.com/employee> "AWS" .
-<http://example.org/Bob%20Smith> <http://example.com/employee> "JavaScript" .
-<http://example.org/Bob%20Smith> <http://example.com/employee> "Python" .
-<http://example.org/Eve%20Davis> <http://example.com/employee> "Docker" .
-<http://example.org/Eve%20Davis> <http://example.com/employee> "Kubernetes" .
-<http://example.org/Eve%20Davis> <http://example.com/employee> "Terraform" .
-<http://example.org/Liam%20Brown> <http://example.com/employee> "Deep Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/employee> "Machine Learning" .
-<http://example.org/Liam%20Brown> <http://example.com/employee> "Python" .
-<http://example.org/Olivia%20Martinez> <http://example.com/employee> "CRM" .
-<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Lead Generation" .
-<http://example.org/Olivia%20Martinez> <http://example.com/employee> "Negotiation" .
-<http://example.org/Sarah%20Lee> <http://example.com/employee> "Copywriting" .
-<http://example.org/Sarah%20Lee> <http://example.com/employee> "Google Ads" .
-<http://example.org/Sarah%20Lee> <http://example.com/employee> "SEO" .
-<http://example.org/Sophia%20White> <http://example.com/employee> "Data Analysis" .
-<http://example.org/Sophia%20White> <http://example.com/employee> "R" .
-<http://example.org/Sophia%20White> <http://example.com/employee> "SQL" .
-
-
-

36. RMLTTC0000

-

Title: Default target

-

Description: Test exporting all triples to the default Target when not Targets are specified.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-      rml:encoding rml:UTF-8
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-

Output

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

37. RMLTTC0001a

-

Title: Single Target: Subject Map

-

Description: Test exporting all triples to a single Target with a given subject.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

38. RMLTTC0001b

-

Title: Single Target: Predicate Map

-

Description: Test exporting all triples to a single Target with a given predicate.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

39. RMLTTC0001c

-

Title: Single Target: Object Map

-

Description: Test exporting all triples to a single Target with a given object reference.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

40. RMLTTC0001d

-

Title: Single Target: Graph Map

-

Description: Test exporting all triples within a named graph to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

41. RMLTTC0001e

-

Title: Single Target: Language Map

-

Description: Test exporting all triples with a given language tag to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

42. RMLTTC0001f

-

Title: Single Target: Datatype Map

-

Description: Test exporting all triples with a given datatype to a single Target.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-
-

43. RMLTTC0002a

-

Title: Multiple Targets: Same Term Map

-

Description: Test exporting all triples to multiple Targets in the same Term Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

44. RMLTTC0002b

-

Title: Multiple Targets: Subject Map and Predicate Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

45. RMLTTC0002c

-

Title: Multiple Targets: Subject Map and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

46. RMLTTC0002d

-

Title: Multiple Targets: Predicate Map and Object Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

47. RMLTTC0002e

-

Title: Multiple Targets: Subject Map, Predicate Map, and Object Map

-

Description: Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump3>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump3> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump3.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

48. RMLTTC0002f

-

Title: Multiple Targets: Subject Map and Graph Map

-

Description: Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

49. RMLTTC0002g

-

Title: Multiple Targets: Predicate Map and Graph Map

-

Description: Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

50. RMLTTC0002h

-

Title: Multiple Targets: Object Map and Graph Map

-

Description: Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph> .
-
-
-

51. RMLTTC0002i

-

Title: Multiple Targets: Language Map and Graph Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

52. RMLTTC0002j

-

Title: Multiple Targets: Language Map and Object Map

-

Description: Test exporting all triples to a Target in a Language Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-
-

53. RMLTTC0002k

-

Title: Multiple Targets: Datatype Map and Graph Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph; 
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.org/PeopleGraph> .
-
-
-

54. RMLTTC0002l

-

Title: Multiple Targets: Datatype Map and Object Map

-

Description: Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

55. RMLTTC0002m

-

Title: Multiple Targets: Multiple Predicate Maps

-

Description: Test exporting all triples to Targets in multiple Predicate Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

56. RMLTTC0002n

-

Title: Multiple Targets: Multiple Object Maps

-

Description: Test exporting all triples to Targets in multiple Object Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

57. RMLTTC0002o

-

Title: Multiple Targets: Multiple Graph Maps

-

Description: Test exporting all triples to Targets in multiple Graph Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix dcat: <http://www.w3.org/ns/dcat#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph1;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-    rml:graphMap [ a rml:GraphMap;
-      rml:constant ex:PeopleGraph2;
-      rml:logicalTarget <#TargetDump2>;
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" <http://example.org/PeopleGraph1>.
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" <http://example.org/PeopleGraph1> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" <http://example.org/PeopleGraph1> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" <http://example.org/PeopleGraph1> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" <http://example.org/PeopleGraph1> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph1> .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" <http://example.org/PeopleGraph2> .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" <http://example.org/PeopleGraph2> .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" <http://example.org/PeopleGraph2> .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" <http://example.org/PeopleGraph2> .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" <http://example.org/PeopleGraph2> .
-
-
-

58. RMLTTC0002p

-

Title: Multiple Targets: Multiple Language Maps

-

Description: Test exporting all triples to Targets in multiple Language Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "en";
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-      rml:languageMap [ a rml:LanguageMap;
-        rml:constant "nl";
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33".
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34".
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35".
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36".
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37".
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@en .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@en .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@en .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@en .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@en .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller"@nl .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green"@nl .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani"@nl .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing"@nl .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller"@nl .
-
-
-

59. RMLTTC0002q

-

Title: Multiple Targets: Multiple Datatype Maps

-

Description: Test exporting all triples to Targets in multiple Datatype Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:integer;
-        rml:logicalTarget <#TargetDump1>;
-      ];
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-      rml:datatypeMap [ a rml:DatatypeMap;
-        rml:constant xsd:double;
-        rml:logicalTarget <#TargetDump2>;
-      ];
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#integer>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#integer>.
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36"^^<http://www.w3.org/2001/XMLSchema#double>.
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37"^^<http://www.w3.org/2001/XMLSchema#double>.
-
-
-

60. RMLTTC0002r

-

Title: Multiple Targets: Multiple Term Maps with same Target

-

Description: Test exporting all triples to same Target in multiple Term Maps.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-      rml:logicalTarget <#TargetDump1>;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

61. RMLTTC0003a

-

Title: Overriding Targets: Seperate Triples Map

-

Description: Test exporting some triples to a different Target with a separate Triples Map.

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump2>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TriplesMap2> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-<#TargetDump2> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump2.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-

Output 3

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

62. RMLTTC0004a

-

Title: Target JSON-LD

-

Description: Test export all triples as JSON-LD

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.jsonld";
-  ];
-  rml:serialization formats:JSON-LD;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-  "@context": { 
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@graph": [
-    {                                                                                
-
-      "@id": "http://example.org/0",
-      "foaf:name": "Monica Geller",
-      "foaf:age": "33"
-    },
-    {                                                                                
-      "@id": "http://example.org/1",
-      "foaf:name": "Rachel Green",
-      "foaf:age": "34"
-    },
-    {                                                                                
-      "@id": "http://example.org/2",
-      "foaf:name": "Joey Tribbiani",
-      "foaf:age": "35"
-    },
-    {                                                                                
-      "@id": "http://example.org/3",
-      "foaf:name": "Chandler Bing",
-      "foaf:age": "36"
-    },
-      {                                                                                
-      "@id": "http://example.org/4",
-      "foaf:name": "Ross Geller",
-      "foaf:age": "37"
-    }
-  ]
-}
-
-
-

63. RMLTTC0004b

-

Title: Target N3

-

Description: Test export all triples as N3

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.n3";
-  ];
-  rml:serialization formats:N3;
-.
-
-

Output 1

-

-
-

Output 2

-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix ex: <http://example.org/> .
-ex:0 <foaf:age> "33" ;
-     <foaf:name> "Monica Geller" .
-ex:1 <foaf:age> "34" ;
-     <foaf:name> "Rachel Green" .
-ex:2 <foaf:age> "35" ;
-     <foaf:name> "Joey Tribbiani" .
-ex:3 <foaf:age> "36" ;
-     <foaf:name> "Chandler Bing" .
-ex:4 <foaf:age> "37" ;
-     <foaf:name> "Ross Geller" .
-
-
-

64. RMLTTC0004c

-

Title: Target N-Triples

-

Description: Test export all triples as N-Triples

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nt";
-  ];
-  rml:serialization formats:N-Triples;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

65. RMLTTC0004d

-

Title: Target N-Quads

-

Description: Test export all triples as N-Quads

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

66. RMLTTC0004e

-

Title: Target RDF/JSON

-

Description: Test export all triples as RDF/JSON

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.rdfjson";
-  ];
-  rml:serialization formats:RDF_JSON;
-.
-
-

Output 1

-

-
-

Output 2

-
{
-    "http://example.org/0" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "33" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Monica Geller" } ]
-    },
-    "http://example.org/1" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "34" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Rachel Green" } ]
-    },
-    "http://example.org/2" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "35" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Joey Tribbiani" } ]
-    },
-    "http://example.org/3" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "36" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Chandler Bing" } ]
-    },
-    "http://example.org/4" : {
-        "http://xmlns.com/foaf/0.1/age" : [ { "value" : "37" } ],
-        "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Ross Geller" } ]
-    }
-}
-
-
-

67. RMLTTC0004f

-

Title: Target RDF/XML

-

Description: Test export all triples as RDF/XML

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.rdfxml";
-  ];
-  rml:serialization formats:RDF_XML;
-.
-
-

Output 1

-

-
-

Output 2

-
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns:foaf="http://xmlns.com/foaf/0.1/">
-  <rdf:Description rdf:about="http://example.org/0">
-    <foaf:age>33</foaf:age>
-    <foaf:name>Monica Geller</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/1">
-    <foaf:age>34</foaf:age>
-    <foaf:name>Rachel Green</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/2">
-    <foaf:age>35</foaf:age>
-    <foaf:name>Joey Tribbiani</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/3">
-    <foaf:age>36</foaf:age>
-    <foaf:name>Chandler Bing</foaf:name>
-  </rdf:Description>
-  <rdf:Description rdf:about="http://example.org/4">
-    <foaf:age>37</foaf:age>
-    <foaf:name>Ross Geller</foaf:name>
-  </rdf:Description>
-</rdf:RDF>
-
-
-

68. RMLTTC0004g

-

Title: Target Turtle

-

Description: Test export all triples as Turtle

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.ttl";
-  ];
-  rml:serialization formats:Turtle;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-
-
-

69. RMLTTC0005a

-

Title: Target UTF-8

-

Description: Test export all triples with UTF-8 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-8;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

70. RMLTTC0005b

-

Title: Target UTF-16

-

Description: Test export all triples with UTF-16 encoding

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:encoding rml:UTF-16;
-.
-
-

Output 1

-

-
-

Output 2

-
��<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-
-

71. RMLTTC0006a

-

Title: Target no compression

-

Description: Test export all triples with no compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
-

72. RMLTTC0006b

-

Title: Target GZip compression

-

Description: Test export all triples with GZip compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.gz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:gzip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.gz

-
-

73. RMLTTC0006c

-

Title: Target Zip compression

-

Description: Test export all triples with ZIP compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.zip";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:zip;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.zip

-
-

74. RMLTTC0006d

-

Title: Target TarXz compression

-

Description: Test export all triples with TarXZ compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@prefix ex: <http://example.org/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.tar.xz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:tarxz;
-.
-
-

Output 1

-

-
-

Output 2 - dump1.nq.tar.xz

-
-

75. RMLTTC0006e

-

Title: Target TarGzip compression

-

Description: Test export all triples with TarGZip compression

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq.tar.gz";
-  ];
-  rml:serialization formats:N-Quads;
-  rml:compression rml:targz;
-.
-
-

Output 1

-

-
-

Output 2

-
����j�0�\�)B -�ҋ��0�����j &N-�o?�޸9�l��	ϟ1���%��D/UjX�6��@F*%R�H('�$B�O)�➥&��
-�$�:�����jWv]�ȹ��v����bO�ח���e�⧠O\0�ua�t��~������LӃq�4s��j]z���8zh��s��%5�u��K0W�����jo�F�K����c��R��?�d}17I-�]���%�����۷�o�M��((
-
-
-

76. RMLTTC0007a

-

Title: Target with FilePath description

-

Description: Test export all triples to a target with File path access description

-

Error expected? No

-

Input

-
[
-  { 
-    "id": 0,
-    "name": "Monica Geller",
-    "age": 33
-  },
-  { 
-    "id": 1,
-    "name": "Rachel Green",
-    "age": 34
-  },
-  { 
-    "id": 2,
-    "name": "Joey Tribbiani",
-    "age": 35
-  },
-  { 
-    "id": 3,
-    "name": "Chandler Bing",
-    "age": 36
-  },
-  { 
-    "id": 4,
-    "name": "Ross Geller",
-    "age": 37
-  }
-]
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix formats: <http://www.w3.org/ns/formats/> .
-@base <http://example.com/rules/> .
-
-<#TriplesMap> a rml:TriplesMap;
-  rml:logicalSource [ a rml:LogicalSource;
-    rml:source [ a rml:FilePath;
-      rml:root rml:MappingDirectory;
-      rml:path "Friends.json";
-    ];
-    rml:referenceFormulation rml:JSONPath;
-    rml:iterator "$[*]";
-  ];
-  rml:subjectMap [ a rml:SubjectMap;
-    rml:template "http://example.org/{$.id}";
-    rml:logicalTarget <#TargetDump1>;
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:name;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.name";
-    ];
-  ];
-  rml:predicateObjectMap [ a rml:PredicateObjectMap;
-    rml:predicateMap [ a rml:PredicateMap;
-      rml:constant foaf:age;
-    ];
-    rml:objectMap [ a rml:ObjectMap;
-      rml:reference "$.age";
-    ];
-  ];
-.
-
-<#TargetDump1> a rml:LogicalTarget;
-  rml:target [ a rml:Target, rml:FilePath;
-    rml:root rml:CurrentWorkingDirectory;
-    rml:path "./dump1.nq";
-  ];
-  rml:serialization formats:N-Quads;
-.
-
-

Output 1

-

-
-

Output 2

-
<http://example.org/0> <http://xmlns.com/foaf/0.1/age> "33" .
-<http://example.org/0> <http://xmlns.com/foaf/0.1/name> "Monica Geller" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/age> "34" .
-<http://example.org/1> <http://xmlns.com/foaf/0.1/name> "Rachel Green" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/age> "35" .
-<http://example.org/2> <http://xmlns.com/foaf/0.1/name> "Joey Tribbiani" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/age> "36" .
-<http://example.org/3> <http://xmlns.com/foaf/0.1/name> "Chandler Bing" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/age> "37" .
-<http://example.org/4> <http://xmlns.com/foaf/0.1/name> "Ross Geller" .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-io/list.sh b/src/test/resources/rml-io/list.sh deleted file mode 100755 index 12c3203..0000000 --- a/src/test/resources/rml-io/list.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -for i in RML*; do - echo "
" -done diff --git a/src/test/resources/rml-io/make-metadata.py b/src/test/resources/rml-io/make-metadata.py deleted file mode 100755 index 1b38686..0000000 --- a/src/test/resources/rml-io/make-metadata.py +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import glob -import csv - -def get_title_description(testcase: str): - with open ('descriptions.csv') as csvfile: - reader = csv.reader(csvfile) - for row in reader: - if row[0] == testcase: - return row[1], row[2] - -def main(spec: str): - with open ('metadata.csv', 'w', newline='') as csvfile: - writer = csv.writer(csvfile) - writer.writerow(['ID', 'title', 'description', 'specification', - 'mapping', 'input_format1', 'input_format2', - 'input_format3', 'output_format1', 'output_format2', - 'output_format3', 'input1', 'input2', 'input3', - 'output1', 'output2', 'output3', 'error']) - for testcase in glob.glob('RML*'): - print(testcase) - title, description = get_title_description(testcase) - error = 'false' - input1 = '' - input2 = '' - input3 = '' - input_format1 = '' - input_format2 = '' - input_format3 = '' - output1 = '' - output2 = '' - output3 = '' - output_format1 = '' - output_format2 = '' - output_format3 = '' - - # Input file - if os.path.exists(os.path.join(testcase, 'Friends.json')): - input1 = 'Friends.json' - input_format1 = 'application/json' - elif os.path.exists(os.path.join(testcase, 'Friends-UTF16.json')): - input1 = 'Friends-UTF16.json' - input_format1 = 'application/json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.gz')): - input1 = 'Friends.json.gz' - input_format1 = 'application/gzip+json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.zip')): - input1 = 'Friends.json.zip' - input_format1 = 'application/gzip+json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.xz')): - input1 = 'Friends.json.tar.xz' - input_format1 = 'application/tarxz+json' - elif os.path.exists(os.path.join(testcase, 'Friends.json.tar.gz')): - input1 = 'Friends.json.tar.gz' - input_format1 = 'application/targz+json' - elif os.path.exists(os.path.join(testcase, 'Friends-NULL.csv')): - input1 = 'Friends-NULL.csv' - input_format1 = 'text/csv' - elif os.path.exists(os.path.join(testcase, 'Friends-NULL2.csv')): - input1 = 'Friends-NULL2.csv' - input_format1 = 'text/csv' - elif os.path.exists(os.path.join(testcase, 'Friends.nt')): - input1 = 'Friends.nt' - input_format1 = 'application/n-triples' - elif os.path.exists(os.path.join(testcase, 'Friends.csv')): - input1 = 'Friends.csv' - input_format1 = 'text/csv' - elif os.path.exists(os.path.join(testcase, 'Friends.json')): - input1 = 'Friends.json' - input_format1 = 'application/json' - elif os.path.exists(os.path.join(testcase, 'Friends.xml')): - input1 = 'Friends.xml' - input_format1 = 'text/xml' - else: - input1 = f'http://w3id.org/rml/resources/rml-io/{testcase}/Friends.json' - input_format1 = 'application/json' - - # Mapping file - if os.path.exists(os.path.join(testcase, 'mapping.ttl')): - mapping_file = 'mapping.ttl' - else: - raise ValueError('Mapping file missing!') - - # Output files - if os.path.exists(os.path.join(testcase, 'default.nq')): - output1 = 'default.nq' - output_format1 = 'application/n-quads' - else: - error = 'true' - - if os.path.exists(os.path.join(testcase, 'dump1.nq')): - output2 = 'dump1.nq' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nt')): - output2 = 'dump1.nt' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.n3')): - output2 = 'dump1.n3' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.jsonld')): - output2 = 'dump1.jsonld' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.rdfjson')): - output2 = 'dump1.rdfjson' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.rdfxml')): - output2 = 'dump1.rdfxml' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.ttl')): - output2 = 'dump1.ttl' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.gz')): - output2 = 'dump1.nq.gz' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.zip')): - output2 = 'dump1.nq.zip' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.xz')): - output2 = 'dump1.nq.tar.xz' - output_format2 = 'application/n-quads' - elif os.path.exists(os.path.join(testcase, 'dump1.nq.tar.gz')): - output2 = 'dump1.nq.tar.gz' - output_format2 = 'application/n-quads' - - if os.path.exists(os.path.join(testcase, 'dump2.nq')): - output3 = 'dump2.nq' - output_format3 = 'application/n-quads' - - writer.writerow([testcase, title, description, spec, mapping_file, - input_format1, input_format2, input_format3, - output_format1, output_format2, output_format3, - input1, input2, input3, output1, output2, - output3, error]) - lines = [] - # Title and description - lines.append(f'## {testcase}\n\n') - lines.append(f'**Title**: {title}\n\n') - lines.append(f'**Description**: {description}\n\n') - if error == 'true': - error_html = 'Yes' - else: - error_html = 'No' - lines.append(f'**Error expected?** {error_html}\n\n') - - # Input - inputCount = '' - - for index, i in enumerate([input1, input2, input3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeError: - input_html = f'**Input{inputCount}**\n `{i}`\n\n' - - lines.append(input_html) - inputCount = f' {index + 1}' - - # Mapping - with open(os.path.join(testcase, mapping_file)) as f: - mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' - lines.append(mapping_html) - - # Output - outputCount = '' - if output2 or output3: - outputCount = ' 1' - - for index, i in enumerate([output1, output2, output3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - output_html = f'**Output{outputCount}**\n `{i}`\n\n' - - lines.append(output_html) - outputCount = f' {index + 2}' - - - with open(os.path.join(testcase, 'README.md'), 'w') as f: - f.writelines(lines) - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('Usage: ./make-metadata.py ') - sys.exit(1) - main(sys.argv[1]) diff --git a/src/test/resources/rml-io/manifest.rml.ttl b/src/test/resources/rml-io/manifest.rml.ttl deleted file mode 100644 index 3f5dfbb..0000000 --- a/src/test/resources/rml-io/manifest.rml.ttl +++ /dev/null @@ -1,267 +0,0 @@ -@prefix xsd: . -@prefix dcterms: . -@prefix rml: . -@prefix rmltest: . -@prefix test: . -@base . - -# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/io/test/ - -_:source - rml:source [ - a rml:RelativePathSource ; - rml:path "metadata.csv" ; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; -. - -<#TriplesMapTestcase> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:reference "ID"; - rml:class test:TestCase; - ]; - - rml:predicateObjectMap [ - rml:predicate dcterms:identifier; - rml:objectMap [ - rml:reference "ID"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:hasError; - rml:objectMap [ - rml:reference "error"; - rml:datatype xsd:boolean; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:mappingDocument; - rml:objectMap [ - rml:reference "mapping"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; -. - -<#TriplesMapInput1> - a rml:TriplesMap; - - rml:logicalSource _:source ; - - rml:subjectMap [ - rml:template "{ID}/input/{input1}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format1"; - ]; - ]; -. - -<#TriplesMapInput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input2}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format2"; - ]; - ]; -. - -<#TriplesMapInput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input3}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format3"; - ]; - ]; -. - -<#TriplesMapOutput1> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output1}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format1"; - ]; - ]; -. - -<#TriplesMapOutput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output2}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format2"; - ]; - ]; -. - -<#TriplesMapOutput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output3}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format3"; - ]; - ]; -. - diff --git a/src/test/resources/rml-io/manifest.ttl b/src/test/resources/rml-io/manifest.ttl deleted file mode 100644 index 2eb9a28..0000000 --- a/src/test/resources/rml-io/manifest.ttl +++ /dev/null @@ -1,1096 +0,0 @@ - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0001a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends-UTF16.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0001b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0002a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json.gz" . - "application/gzip+json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0002b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json.zip" . - "application/gzip+json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0002c" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json.tar.xz" . - "application/tarxz+json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0002d" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json.tar.gz" . - "application/targz+json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0002e" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.nt" . - "application/n-triples" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0003" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends-NULL.csv" . - "text/csv" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0004a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends-NULL.csv" . - "text/csv" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0004b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends-NULL.csv" . - "text/csv" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0004c" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.csv" . - "text/csv" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0006a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.csv" . - "text/csv" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0006b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0007a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.csv" . - "text/csv" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0007b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.xml" . - "text/xml" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0007c" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.xml" . - "text/xml" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0007d" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0008a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0008b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.csv" . - "text/csv" . - . - "RMLSTC0009a" . - "true"^^ . - . - "mapping.ttl" . - . - "Friends.csv" . - "text/csv" . - . - "RMLSTC0010a" . - "true"^^ . - . - "mapping.ttl" . - . - "Friends.csv" . - "text/csv" . - . - "RMLSTC0010b" . - "true"^^ . - . - "mapping.ttl" . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0011a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0011b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0011c" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0011d" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0011e" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0012a" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0012b" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0012c" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0012d" . - "false"^^ . - . - "mapping.ttl" . - . - . - "http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLSTC0012e" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "RMLTTC0000" . - "false"^^ . - . - "mapping.ttl" . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0001a" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0001b" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0001c" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0001d" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0001e" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0001f" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002a" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002b" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002c" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002d" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002e" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002f" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002g" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002h" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002i" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002j" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002k" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002l" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002m" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002n" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002o" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002p" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0002q" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0002r" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "dump2.nq" . - "application/n-quads" . - . - "RMLTTC0003a" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.jsonld" . - "application/n-quads" . - . - "RMLTTC0004a" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.n3" . - "application/n-quads" . - . - "RMLTTC0004b" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nt" . - "application/n-quads" . - . - "RMLTTC0004c" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0004d" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.rdfjson" . - "application/n-quads" . - . - "RMLTTC0004e" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.rdfxml" . - "application/n-quads" . - . - "RMLTTC0004f" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.ttl" . - "application/n-quads" . - . - "RMLTTC0004g" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0005a" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0005b" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0006a" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq.gz" . - "application/n-quads" . - . - "RMLTTC0006b" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq.zip" . - "application/n-quads" . - . - "RMLTTC0006c" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq.tar.xz" . - "application/n-quads" . - . - "RMLTTC0006d" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq.tar.gz" . - "application/n-quads" . - . - "RMLTTC0006e" . - "false"^^ . - . - "mapping.ttl" . - . - . - . - "Friends.json" . - "application/json" . - . - "default.nq" . - "application/n-quads" . - . - "dump1.nq" . - "application/n-quads" . - . - "RMLTTC0007a" . - "false"^^ . - . - "mapping.ttl" . - . - . - . diff --git a/src/test/resources/rml-io/metadata.csv b/src/test/resources/rml-io/metadata.csv deleted file mode 100644 index c89d031..0000000 --- a/src/test/resources/rml-io/metadata.csv +++ /dev/null @@ -1,74 +0,0 @@ -ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error -RMLSTC0001a,Source with UTF-8 encoding,Test source with UTF-8 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false -RMLSTC0001b,Source with UTF-16 encoding,Test source with UTF-16 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends-UTF16.json,,,default.nq,,,false -RMLSTC0002a,Source no compression,Test source without compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false -RMLSTC0002b,Source GZip compression,Test source with GZip compression,http://w3id.org/rml/io/,mapping.ttl,application/gzip+json,,,application/n-quads,,,Friends.json.gz,,,default.nq,,,false -RMLSTC0002c,Source Zip compression,Test source with ZIP compression,http://w3id.org/rml/io/,mapping.ttl,application/gzip+json,,,application/n-quads,,,Friends.json.zip,,,default.nq,,,false -RMLSTC0002d,Source TarXz compression,Test source with TarXZ compression,http://w3id.org/rml/io/,mapping.ttl,application/tarxz+json,,,application/n-quads,,,Friends.json.tar.xz,,,default.nq,,,false -RMLSTC0002e,Source TarGzip compression,Test source with TarGZip compression,http://w3id.org/rml/io/,mapping.ttl,application/targz+json,,,application/n-quads,,,Friends.json.tar.gz,,,default.nq,,,false -RMLSTC0003,Source with query,Test source which requires a query,http://w3id.org/rml/io/,mapping.ttl,application/n-triples,,,application/n-quads,,,Friends.nt,,,default.nq,,,false -RMLSTC0004a,Source with default NULL values,Test source with default NULL values,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends-NULL.csv,,,default.nq,,,false -RMLSTC0004b,Source with one NULL value,Test source with one NULL value defined,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends-NULL.csv,,,default.nq,,,false -RMLSTC0004c,Source with multiple NULL values,Test source with multiple NULL values defined,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends-NULL.csv,,,default.nq,,,false -RMLSTC0006a,Source with D2RQ access description,Test source with D2RQ access description for SQL databases,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends.csv,,,default.nq,,,false -RMLSTC0006b,Source with a Relative Path Source,Test access to a file,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends.csv,,,default.nq,,,false -RMLSTC0007a,Source with JSONPath reference formulation,Test source with JSONPath reference formulation,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false -RMLSTC0007b,Source with CSV reference formulation,Test source with Tabular reference formulation,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,application/n-quads,,,Friends.csv,,,default.nq,,,false -RMLSTC0007c,Source with XPath reference formulation,Test source with XPath reference formulation,http://w3id.org/rml/io/,mapping.ttl,text/xml,,,application/n-quads,,,Friends.xml,,,default.nq,,,false -RMLSTC0007d,Source with XPath reference formulation with namespaces,Test source with XPath reference formulation with namespaces,http://w3id.org/rml/io/,mapping.ttl,text/xml,,,application/n-quads,,,Friends.xml,,,default.nq,,,false -RMLSTC0008a,Multiple sources of same type,Tests the generation of all triples from multiple homogeneous sources ,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false -RMLSTC0008b,Multiple sources of different type,Tests the generation of all triples from multiple heterogeneous sources ,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false -RMLSTC0009a,Source with quoted columns,Tests the generation of triples where columns are quoted,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,,,,Friends.csv,,,,,,true -RMLSTC0010a,"Invalid CSV source, reference to invalid column",Tests the identification of invalid CSV sources,http://w3id.org/rml/io/,mapping.ttl,text/csv,,,,,,Friends.csv,,,,,,true -RMLSTC0010b,"Invalid CSV source, no reference to invalid column","Tests the identification of invalid CSV sources, even when all columns referenced are valid",http://w3id.org/rml/io/,mapping.ttl,text/csv,,,,,,Friends.csv,,,,,,true -RMLSTC0011a,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011a/Friends.json,,,default.nq,,,false -RMLSTC0011b,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011b/Friends.json,,,default.nq,,,false -RMLSTC0011c,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011c/Friends.json,,,default.nq,,,false -RMLSTC0011d,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011d/Friends.json,,,default.nq,,,false -RMLSTC0011e,Complex JSON source,Tests the generation of triples from complex JSON sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0011e/Friends.json,,,default.nq,,,false -RMLSTC0012a,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012a/Friends.json,,,default.nq,,,false -RMLSTC0012b,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012b/Friends.json,,,default.nq,,,false -RMLSTC0012c,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012c/Friends.json,,,default.nq,,,false -RMLSTC0012d,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012d/Friends.json,,,default.nq,,,false -RMLSTC0012e,Complex XML source,Tests the generation of triples from complex XML sources,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,http://w3id.org/rml/resources/rml-io/RMLSTC0012e/Friends.json,,,default.nq,,,false -RMLTTC0000,Default target,Test exporting all triples to the default Target when not Targets are specified.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,,,Friends.json,,,default.nq,,,false -RMLTTC0001a,Single Target: Subject Map,Test exporting all triples to a single Target with a given subject.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0001b,Single Target: Predicate Map,Test exporting all triples to a single Target with a given predicate.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0001c,Single Target: Object Map,Test exporting all triples to a single Target with a given object reference.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0001d,Single Target: Graph Map,Test exporting all triples within a named graph to a single Target.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0001e,Single Target: Language Map,Test exporting all triples with a given language tag to a single Target.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0001f,Single Target: Datatype Map,Test exporting all triples with a given datatype to a single Target.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0002a,Multiple Targets: Same Term Map,Test exporting all triples to multiple Targets in the same Term Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002b,Multiple Targets: Subject Map and Predicate Map,Test exporting all triples to a Target in a Subject Map and a Target in a Predicate Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002c,Multiple Targets: Subject Map and Object Map,Test exporting all triples to a Target in a Subject Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002d,Multiple Targets: Predicate Map and Object Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002e,"Multiple Targets: Subject Map, Predicate Map, and Object Map","Test exporting all triples to a Target in a Subject Map, a Target in a Predicate Map, and a Target in a Object Map.",http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002f,Multiple Targets: Subject Map and Graph Map,Test exporting all triples to a Target in a Subject Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002g,Multiple Targets: Predicate Map and Graph Map,Test exporting all triples to a Target in a Predicate Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002h,Multiple Targets: Object Map and Graph Map,Test exporting all triples to a Target in a Object Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002i,Multiple Targets: Language Map and Graph Map,Test exporting all triples to a Target in a Language Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002j,Multiple Targets: Language Map and Object Map,Test exporting all triples to a Target in a Language Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002k,Multiple Targets: Datatype Map and Graph Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Graph Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002l,Multiple Targets: Datatype Map and Object Map,Test exporting all triples to a Target in a Datatype Map and a Target in a Object Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002m,Multiple Targets: Multiple Predicate Maps,Test exporting all triples to Targets in multiple Predicate Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002n,Multiple Targets: Multiple Object Maps,Test exporting all triples to Targets in multiple Object Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002o,Multiple Targets: Multiple Graph Maps,Test exporting all triples to Targets in multiple Graph Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002p,Multiple Targets: Multiple Language Maps,Test exporting all triples to Targets in multiple Language Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002q,Multiple Targets: Multiple Datatype Maps,Test exporting all triples to Targets in multiple Datatype Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0002r,Multiple Targets: Multiple Term Maps with same Target,Test exporting all triples to same Target in multiple Term Maps.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0003a,Overriding Targets: Seperate Triples Map,Test exporting some triples to a different Target with a separate Triples Map.,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,application/n-quads,Friends.json,,,default.nq,dump1.nq,dump2.nq,false -RMLTTC0004a,Target JSON-LD,Test export all triples as JSON-LD,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.jsonld,,false -RMLTTC0004b,Target N3,Test export all triples as N3,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.n3,,false -RMLTTC0004c,Target N-Triples,Test export all triples as N-Triples,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nt,,false -RMLTTC0004d,Target N-Quads,Test export all triples as N-Quads,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0004e,Target RDF/JSON,Test export all triples as RDF/JSON,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.rdfjson,,false -RMLTTC0004f,Target RDF/XML,Test export all triples as RDF/XML,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.rdfxml,,false -RMLTTC0004g,Target Turtle,Test export all triples as Turtle,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.ttl,,false -RMLTTC0005a,Target UTF-8,Test export all triples with UTF-8 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0005b,Target UTF-16,Test export all triples with UTF-16 encoding,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0006a,Target no compression,Test export all triples with no compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false -RMLTTC0006b,Target GZip compression,Test export all triples with GZip compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.gz,,false -RMLTTC0006c,Target Zip compression,Test export all triples with ZIP compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.zip,,false -RMLTTC0006d,Target TarXz compression,Test export all triples with TarXZ compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.tar.xz,,false -RMLTTC0006e,Target TarGzip compression,Test export all triples with TarGZip compression,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq.tar.gz,,false -RMLTTC0007a,Target with FilePath description,Test export all triples to a target with File path access description,http://w3id.org/rml/io/,mapping.ttl,application/json,,,application/n-quads,application/n-quads,,Friends.json,,,default.nq,dump1.nq,,false diff --git a/src/test/resources/rml-io/section/abstract.md b/src/test/resources/rml-io/section/abstract.md deleted file mode 100644 index 5b514ad..0000000 --- a/src/test/resources/rml-io/section/abstract.md +++ /dev/null @@ -1 +0,0 @@ -This document defines the RML-IO test cases to the determine the RML-IO specification conformance of tools. diff --git a/src/test/resources/rml-io/section/data-model.md b/src/test/resources/rml-io/section/data-model.md deleted file mode 100644 index f4c3ad6..0000000 --- a/src/test/resources/rml-io/section/data-model.md +++ /dev/null @@ -1,12 +0,0 @@ -# Data model - -The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). -Each `test:Testcase` as the following properties: - -- `dcterms:identifier`: unique ID of the test case. -- `rmltest:hasError`: if an error of the RML Processor is expected or not. -- `rmltest:input`: One or more input data of the test case. -- `rmltest:output`: One or more output data of the test case. -- `rmltest:inputFormat`: the input data format. -- `rmltest:outputFormat`: the output data format. -- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-io/section/introduction.md b/src/test/resources/rml-io/section/introduction.md deleted file mode 100644 index 086c84b..0000000 --- a/src/test/resources/rml-io/section/introduction.md +++ /dev/null @@ -1,4 +0,0 @@ -# Introduction - -This document defines the RML-IO test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-IO specification. diff --git a/src/test/resources/rml-io/section/test-cases.md b/src/test/resources/rml-io/section/test-cases.md deleted file mode 100644 index 5fd1ecf..0000000 --- a/src/test/resources/rml-io/section/test-cases.md +++ /dev/null @@ -1,10 +0,0 @@ -# Test cases - -This section describes the RML-IO test cases. These descriptions are also available as RDF. -The files are available on [GitHub](https://github.com/kg-construct/rml-io/tree/main/test-cases) in the folder `test-cases`. -Each test case is contained in a single folder, containing three types of files: - - - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. - - One file with the RML rules, called `mapping.ttl`, in the Turtle format. - - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. - diff --git a/src/test/resources/rml-lv/README.md b/src/test/resources/rml-lv/README.md deleted file mode 100644 index 57adbc3..0000000 --- a/src/test/resources/rml-lv/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# RML LV test cases - -The test cases publication (html pages) can be generated as followed: - -1. Add the testcase description in `descriptions.csv` or fetch it from the [Google spreadsheet](https://docs.google.com/spreadsheets/d/1Ui216z2cF8bNAbdZvws-JoAhcjj4M2k_NlfzmCh1jh8/edit?gid=1769343477#gid=1769343477). -2. Navigate to folder ./test-cases -3. Execute the `make-metadata.py` script: `python3 make-metadata.py http://w3id.org/rml/lv/` - (This is based on the content of the folders with the test cases, and on the file descriptions.csv for the descriptions of the cases) -4. Download burp: `curl -LO https://github.com/kg-construct/BURP/releases/download/v0.1.1/burp.jar` -5. Generate the manifest with [Burp](https://github.com/kg-construct/BURP): `java -jar burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/lv/test/` -6. Run list.sh and insert output in dev.html -7. To publish the new HTML verson of the test cases, export `dev.html` as `index.html` in ./docs and in a subfolder with the date of the publication (maybe adapt the publication date) diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/README.md b/src/test/resources/rml-lv/RMLLVTC0000a/README.md deleted file mode 100644 index 6fa5a1e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000a/README.md +++ /dev/null @@ -1,82 +0,0 @@ -## RMLLVTC0000a - -**Title**: Logical view on JSON source - -**Description**: Test a view on a hierarchical source - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . - -``` - -**Output** -``` - "alice" . - "bob" . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0000a/mapping.ttl deleted file mode 100644 index ac68a61..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000a/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/output.nq b/src/test/resources/rml-lv/RMLLVTC0000a/output.nq deleted file mode 100644 index 1112907..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000a/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "alice" . - "bob" . diff --git a/src/test/resources/rml-lv/RMLLVTC0000a/people.json b/src/test/resources/rml-lv/RMLLVTC0000a/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000a/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/README.md b/src/test/resources/rml-lv/RMLLVTC0000b/README.md deleted file mode 100644 index f94dd6f..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000b/README.md +++ /dev/null @@ -1,59 +0,0 @@ -## RMLLVTC0000b - -**Title**: Logical view on CSV source - -**Description**: Test a view on a tabular source - -**Error expected?** No - -**Input** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . - -``` - -**Output** -``` - "alice" . - "bob" . - "tobias" . -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0000b/mapping.ttl deleted file mode 100644 index 75c424e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000b/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix rml: . -@prefix : . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/output.nq b/src/test/resources/rml-lv/RMLLVTC0000b/output.nq deleted file mode 100644 index f611f1d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000b/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "alice" . - "bob" . - "tobias" . \ No newline at end of file diff --git a/src/test/resources/rml-lv/RMLLVTC0000b/people.csv b/src/test/resources/rml-lv/RMLLVTC0000b/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000b/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/README.md b/src/test/resources/rml-lv/RMLLVTC0000c/README.md deleted file mode 100644 index ba0afbb..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000c/README.md +++ /dev/null @@ -1,90 +0,0 @@ -## RMLLVTC0000c - -**Title**: Logical View on Logical View - -**Description**: Test a view on a logical view - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:jsonViewOnJsonView a rml:LogicalView ; - rml:viewOn :jsonView ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "newName" ; - rml:reference "name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonViewOnJsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{newName}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "newName" ; - ] ; - ] . - -``` - -**Output** -``` - "alice" . - "bob" . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0000c/mapping.ttl deleted file mode 100644 index 3f5abf0..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000c/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:jsonViewOnJsonView a rml:LogicalView ; - rml:viewOn :jsonView ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "newName" ; - rml:reference "name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonViewOnJsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{newName}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "newName" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/output.nq b/src/test/resources/rml-lv/RMLLVTC0000c/output.nq deleted file mode 100644 index 1112907..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000c/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "alice" . - "bob" . diff --git a/src/test/resources/rml-lv/RMLLVTC0000c/people.json b/src/test/resources/rml-lv/RMLLVTC0000c/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0000c/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/README.md b/src/test/resources/rml-lv/RMLLVTC0001a/README.md deleted file mode 100644 index ae41024..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001a/README.md +++ /dev/null @@ -1,82 +0,0 @@ -## RMLLVTC0001a - -**Title**: Expression Field: Reference - -**Description**: Test a reference in an expression field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . - -``` - -**Output** -``` - "alice" . - "bob" . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001a/mapping.ttl deleted file mode 100644 index ac68a61..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001a/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/output.nq b/src/test/resources/rml-lv/RMLLVTC0001a/output.nq deleted file mode 100644 index 1112907..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001a/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "alice" . - "bob" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001a/people.json b/src/test/resources/rml-lv/RMLLVTC0001a/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001a/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/README.md b/src/test/resources/rml-lv/RMLLVTC0001b/README.md deleted file mode 100644 index 3eb3a77..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001b/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## RMLLVTC0001b - -**Title**: Expression Field: Template - -**Description**: Test a template in an expression field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "race" ; - rml:constant "human" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasRace ; - rml:objectMap [ - rml:reference "race" ; - ] ; - ] . - -``` - -**Output** -``` - "human" . - "human" . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001b/mapping.ttl deleted file mode 100644 index ff5012c..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001b/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "race" ; - rml:constant "human" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasRace ; - rml:objectMap [ - rml:reference "race" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/output.nq b/src/test/resources/rml-lv/RMLLVTC0001b/output.nq deleted file mode 100644 index dcc01ba..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001b/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "human" . - "human" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001b/people.json b/src/test/resources/rml-lv/RMLLVTC0001b/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001b/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/README.md b/src/test/resources/rml-lv/RMLLVTC0001c/README.md deleted file mode 100644 index d393dd6..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001c/README.md +++ /dev/null @@ -1,89 +0,0 @@ -## RMLLVTC0001c - -**Title**: Expression Field: Constant - -**Description**: Test a constant expression in an expression field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "lastName": "smith", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "lastName": "jones", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "fullName" ; - rml:template "{name} {lastName}" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasFullName ; - rml:objectMap [ - rml:reference "fullName" ; - ] ; - ] . - -``` - -**Output** -``` - "alice smith" . - "bob jones" . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001c/mapping.ttl deleted file mode 100644 index 1429104..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001c/mapping.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "fullName" ; - rml:template "{name} {lastName}" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasFullName ; - rml:objectMap [ - rml:reference "fullName" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/output.nq b/src/test/resources/rml-lv/RMLLVTC0001c/output.nq deleted file mode 100644 index 69788f7..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001c/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "alice smith" . - "bob jones" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001c/people.json b/src/test/resources/rml-lv/RMLLVTC0001c/people.json deleted file mode 100644 index 4996965..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001c/people.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "lastName": "smith", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "lastName": "jones", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/README.md b/src/test/resources/rml-lv/RMLLVTC0001d/README.md deleted file mode 100644 index 325b3a8..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001d/README.md +++ /dev/null @@ -1,90 +0,0 @@ -## RMLLVTC0001d - -**Title**: Expression Field Siblings - -**Description**: Test multiple expression fields with the same parent - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "lastName": "smith", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "lastName": "jones", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "lastName" ; - rml:reference "$.lastName" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasFullName ; - rml:objectMap [ - rml:template "{name} {lastName}" ; - rml:termType rml:Literal ; - ] ; - ] . - -``` - -**Output** -``` - "alice smith" . - "bob jones" . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0001d/mapping.ttl deleted file mode 100644 index a380b39..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001d/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "lastName" ; - rml:reference "$.lastName" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasFullName ; - rml:objectMap [ - rml:template "{name} {lastName}" ; - rml:termType rml:Literal ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/output.nq b/src/test/resources/rml-lv/RMLLVTC0001d/output.nq deleted file mode 100644 index 69788f7..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001d/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "alice smith" . - "bob jones" . diff --git a/src/test/resources/rml-lv/RMLLVTC0001d/people.json b/src/test/resources/rml-lv/RMLLVTC0001d/people.json deleted file mode 100644 index 4996965..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0001d/people.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "lastName": "smith", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "lastName": "jones", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/README.md b/src/test/resources/rml-lv/RMLLVTC0002a/README.md deleted file mode 100644 index b3b38af..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002a/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLLVTC0002a - -**Title**: Iterable Field - -**Description**: Test a nested field construction: iterable field with expression field as child - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - ] . - -``` - -**Output** -``` - . - . - . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0002a/mapping.ttl deleted file mode 100644 index 34c964e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002a/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/output.nq b/src/test/resources/rml-lv/RMLLVTC0002a/output.nq deleted file mode 100644 index c4b9514..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002a/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - . - . - . diff --git a/src/test/resources/rml-lv/RMLLVTC0002a/people.json b/src/test/resources/rml-lv/RMLLVTC0002a/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002a/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/README.md b/src/test/resources/rml-lv/RMLLVTC0002b/README.md deleted file mode 100644 index 658f01e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002b/README.md +++ /dev/null @@ -1,109 +0,0 @@ -## RMLLVTC0002b - -**Title**: Iterable Field with Multiple Children - -**Description**: Test a nested field construction: iterable field with mulitple expression fields as children - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "item.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "item.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . - -``` - -**Output** -``` - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0002b/mapping.ttl deleted file mode 100644 index d7ad0c7..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002b/mapping.ttl +++ /dev/null @@ -1,54 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "item.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "item.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/output.nq b/src/test/resources/rml-lv/RMLLVTC0002b/output.nq deleted file mode 100644 index 83d339e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002b/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0002b/people.json b/src/test/resources/rml-lv/RMLLVTC0002b/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002b/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/README.md b/src/test/resources/rml-lv/RMLLVTC0002c/README.md deleted file mode 100644 index b81753d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002c/README.md +++ /dev/null @@ -1,112 +0,0 @@ -## RMLLVTC0002c - -**Title**: Nested Iterable Fields - -**Description**: Test a nested field construction: iterable field with an iterable field as child - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "measures": { - "weight": 1500, - "length": 30 - } - }, - { - "type": "shield", - "measures": { - "weight": 2500 - } - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "measures" : { - "weight": 15, - "length" : 15 - } - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "measures"; - rml:iterator "$.measures"; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ]; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "item.measures.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . - -``` - -**Output** -``` - "1500"^^ . - "2500"^^ . - "15"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0002c/mapping.ttl deleted file mode 100644 index 01a2ad1..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002c/mapping.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "measures"; - rml:iterator "$.measures"; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ]; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "item.measures.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/output.nq b/src/test/resources/rml-lv/RMLLVTC0002c/output.nq deleted file mode 100644 index 21ccc91..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002c/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "1500"^^ . - "2500"^^ . - "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0002c/people.json b/src/test/resources/rml-lv/RMLLVTC0002c/people.json deleted file mode 100644 index 485614f..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0002c/people.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "measures": { - "weight": 1500, - "length": 30 - } - }, - { - "type": "shield", - "measures": { - "weight": 2500 - } - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "measures" : { - "weight": 15, - "length" : 15 - } - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/README.md b/src/test/resources/rml-lv/RMLLVTC0003a/README.md deleted file mode 100644 index d91733b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003a/README.md +++ /dev/null @@ -1,84 +0,0 @@ -## RMLLVTC0003a - -**Title**: Index Key: # - -**Description**: Test a reference to the index key # - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "#" ; - rml:datatype xsd:integer ; - ] ; - ] . - -``` - -**Output** -``` - "0"^^ . - "1"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0003a/mapping.ttl deleted file mode 100644 index bd016a2..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003a/mapping.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "#" ; - rml:datatype xsd:integer ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/output.nq b/src/test/resources/rml-lv/RMLLVTC0003a/output.nq deleted file mode 100644 index 3962998..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003a/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "0"^^ . - "1"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0003a/people.json b/src/test/resources/rml-lv/RMLLVTC0003a/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003a/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/README.md b/src/test/resources/rml-lv/RMLLVTC0003b/README.md deleted file mode 100644 index b968da6..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003b/README.md +++ /dev/null @@ -1,94 +0,0 @@ -## RMLLVTC0003b - -**Title**: Index Key: Iterable Field - -**Description**: Test a reference to the index key of an iterable field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "item.type" ; - ] ; - ] . - -``` - -**Output** -``` - "sword" . - "shield" . - "flower" . - - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0003b/mapping.ttl deleted file mode 100644 index a1f8128..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003b/mapping.ttl +++ /dev/null @@ -1,41 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "item.type" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/output.nq b/src/test/resources/rml-lv/RMLLVTC0003b/output.nq deleted file mode 100644 index 7a70164..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003b/output.nq +++ /dev/null @@ -1,4 +0,0 @@ - "sword" . - "shield" . - "flower" . - diff --git a/src/test/resources/rml-lv/RMLLVTC0003b/people.json b/src/test/resources/rml-lv/RMLLVTC0003b/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003b/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/README.md b/src/test/resources/rml-lv/RMLLVTC0003c/README.md deleted file mode 100644 index 2db9a5f..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003c/README.md +++ /dev/null @@ -1,80 +0,0 @@ -## RMLLVTC0003c - -**Title**: Index Key: Expression field - -**Description**: Test a reference to the index key of an expression field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "item" ; - ] ; - ] . - -``` - -**Output** -``` - "sword" . - "shield" . - "flower" . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0003c/mapping.ttl deleted file mode 100644 index 56ec415..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003c/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "item" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/output.nq b/src/test/resources/rml-lv/RMLLVTC0003c/output.nq deleted file mode 100644 index 55e161e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003c/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "sword" . - "shield" . - "flower" . diff --git a/src/test/resources/rml-lv/RMLLVTC0003c/people.json b/src/test/resources/rml-lv/RMLLVTC0003c/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0003c/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/README.md b/src/test/resources/rml-lv/RMLLVTC0004a/README.md deleted file mode 100644 index 63999a1..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004a/README.md +++ /dev/null @@ -1,82 +0,0 @@ -## RMLLVTC0004a - -**Title**: Natural Datatype: Index # - -**Description**: Test the natural datatype mapping for the index # - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "#" ; - ] ; - ] . - -``` - -**Output** -``` - "0"^^ . - "1"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004a/mapping.ttl deleted file mode 100644 index 12e315b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004a/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "#" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/output.nq b/src/test/resources/rml-lv/RMLLVTC0004a/output.nq deleted file mode 100644 index 3962998..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004a/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "0"^^ . - "1"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004a/people.json b/src/test/resources/rml-lv/RMLLVTC0004a/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004a/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/README.md b/src/test/resources/rml-lv/RMLLVTC0004b/README.md deleted file mode 100644 index d598e0e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004b/README.md +++ /dev/null @@ -1,93 +0,0 @@ -## RMLLVTC0004b - -**Title**: Natural Datatype: Index Expression Field - -**Description**: Test the natural datatype mapping for the index of an expression field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "item.#" ; - ] ; - ] . - -``` - -**Output** -``` - "0"^^ . - "1"^^ . - "0"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004b/mapping.ttl deleted file mode 100644 index 95dc2d4..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004b/mapping.ttl +++ /dev/null @@ -1,41 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.type}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "item.#" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/output.nq b/src/test/resources/rml-lv/RMLLVTC0004b/output.nq deleted file mode 100644 index ad32975..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004b/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "0"^^ . - "1"^^ . - "0"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004b/people.json b/src/test/resources/rml-lv/RMLLVTC0004b/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004b/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/README.md b/src/test/resources/rml-lv/RMLLVTC0004c/README.md deleted file mode 100644 index 8ab10b2..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004c/README.md +++ /dev/null @@ -1,80 +0,0 @@ -## RMLLVTC0004c - -**Title**: Natural Datatype: Index Iterable Field - -**Description**: Test the natural datatype mapping for the index of an iterable field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "item.#" ; - ] ; - ] . - -``` - -**Output** -``` - "0"^^ . - "1"^^ . - "0"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004c/mapping.ttl deleted file mode 100644 index 5d4e57d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004c/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasSequenceNumber ; - rml:objectMap [ - rml:reference "item.#" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/output.nq b/src/test/resources/rml-lv/RMLLVTC0004c/output.nq deleted file mode 100644 index ad32975..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004c/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "0"^^ . - "1"^^ . - "0"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004c/people.json b/src/test/resources/rml-lv/RMLLVTC0004c/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004c/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/README.md b/src/test/resources/rml-lv/RMLLVTC0004d/README.md deleted file mode 100644 index 66c92b6..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004d/README.md +++ /dev/null @@ -1,74 +0,0 @@ -## RMLLVTC0004d - -**Title**: Natural Datatype: Record Expression Field - -**Description**: Test the natural datatype mapping for a record of an expression field - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "birth_year": 1995 - }, - { - "name": "bob", - "birth_year": 1999 - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "$.birth_year" ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - ] ; - ] . - -``` - -**Output** -``` - "1995"^^ . - "1999"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0004d/mapping.ttl deleted file mode 100644 index f7a7b45..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004d/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "$.birth_year" ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/output.nq b/src/test/resources/rml-lv/RMLLVTC0004d/output.nq deleted file mode 100644 index 3eda03c..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004d/output.nq +++ /dev/null @@ -1,2 +0,0 @@ - "1995"^^ . - "1999"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0004d/people.json b/src/test/resources/rml-lv/RMLLVTC0004d/people.json deleted file mode 100644 index 8ed0174..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0004d/people.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "birth_year": 1995 - }, - { - "name": "bob", - "birth_year": 1999 - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0005a/README.md b/src/test/resources/rml-lv/RMLLVTC0005a/README.md deleted file mode 100644 index 915c20b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005a/README.md +++ /dev/null @@ -1,75 +0,0 @@ -## RMLLVTC0005a - -**Title**: Referencing a Non-Existing Key - -**Description**: Test a reference to a non-existing key - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{Name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "Name" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0005a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0005a/mapping.ttl deleted file mode 100644 index c5ff6f4..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005a/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{Name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "Name" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0005a/people.json b/src/test/resources/rml-lv/RMLLVTC0005a/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005a/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0005b/README.md b/src/test/resources/rml-lv/RMLLVTC0005b/README.md deleted file mode 100644 index d56b87e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005b/README.md +++ /dev/null @@ -1,75 +0,0 @@ -## RMLLVTC0005b - -**Title**: Referencing the Record Key - -**Description**: Test a reference to the record key - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :isDerivedFrom ; - rml:objectMap [ - rml:reference "" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0005b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0005b/mapping.ttl deleted file mode 100644 index 3e9544b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005b/mapping.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :isDerivedFrom ; - rml:objectMap [ - rml:reference "" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0005b/people.json b/src/test/resources/rml-lv/RMLLVTC0005b/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005b/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0005c/README.md b/src/test/resources/rml-lv/RMLLVTC0005c/README.md deleted file mode 100644 index 5881d48..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005c/README.md +++ /dev/null @@ -1,86 +0,0 @@ -## RMLLVTC0005c - -**Title**: Referencing the Record Key of an Iterable Field - -**Description**: Test a reference to the record key of an iterable field - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/{item}" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0005c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0005c/mapping.ttl deleted file mode 100644 index 5249099..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005c/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:IterableField ; - rml:fieldName "item" ; - rml:iterator "$.items[*]" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/{item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0005c/people.json b/src/test/resources/rml-lv/RMLLVTC0005c/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0005c/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/README.md b/src/test/resources/rml-lv/RMLLVTC0006a/README.md deleted file mode 100644 index 6b61668..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006a/README.md +++ /dev/null @@ -1,133 +0,0 @@ -## RMLLVTC0006a - -**Title**: Left Join - -**Description**: Test a left join - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{json_item}" ; - ] ; - ] . - -``` - -**Output** -``` - "1995"^^ . - . - . - "1999"^^ . - . - "2005"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006a/mapping.ttl deleted file mode 100644 index 57e7107..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006a/mapping.ttl +++ /dev/null @@ -1,78 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{json_item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/output.nq b/src/test/resources/rml-lv/RMLLVTC0006a/output.nq deleted file mode 100644 index f9fd2a8..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006a/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "1995"^^ . - . - . - "1999"^^ . - . - "2005"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/people.csv b/src/test/resources/rml-lv/RMLLVTC0006a/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006a/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006a/people.json b/src/test/resources/rml-lv/RMLLVTC0006a/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006a/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/README.md b/src/test/resources/rml-lv/RMLLVTC0006b/README.md deleted file mode 100644 index b470492..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006b/README.md +++ /dev/null @@ -1,132 +0,0 @@ -## RMLLVTC0006b - -**Title**: Inner Join - -**Description**: Test an inner join - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{json_item}" ; - ] ; - ] . - -``` - -**Output** -``` - "1995"^^ . - . - . - "1999"^^ . - . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006b/mapping.ttl deleted file mode 100644 index ee5f0a2..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006b/mapping.ttl +++ /dev/null @@ -1,78 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{json_item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/output.nq b/src/test/resources/rml-lv/RMLLVTC0006b/output.nq deleted file mode 100644 index 24fec8f..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006b/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "1995"^^ . - . - . - "1999"^^ . - . diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/people.csv b/src/test/resources/rml-lv/RMLLVTC0006b/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006b/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006b/people.json b/src/test/resources/rml-lv/RMLLVTC0006b/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006b/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/README.md b/src/test/resources/rml-lv/RMLLVTC0006c/README.md deleted file mode 100644 index 34ac370..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006c/README.md +++ /dev/null @@ -1,176 +0,0 @@ -## RMLLVTC0006c - -**Title**: Two Left Joins - -**Description**: Test two left joins in one logical view - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Input 2** -``` -name,id -alice,123 -bob,456 -tobias,789 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv2_id" ; - rml:reference "id" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{csv2_id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; - ] ; - ] . - -``` - -**Output** -``` - "1995"^^ . - . - . - "1999"^^ . - . - "2005"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006c/mapping.ttl deleted file mode 100644 index cdcc7ec..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006c/mapping.ttl +++ /dev/null @@ -1,112 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv2_id" ; - rml:reference "id" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{csv2_id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/output.nq b/src/test/resources/rml-lv/RMLLVTC0006c/output.nq deleted file mode 100644 index 43c6b6d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006c/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "1995"^^ . - . - . - "1999"^^ . - . - "2005"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/people.csv b/src/test/resources/rml-lv/RMLLVTC0006c/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006c/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/people.json b/src/test/resources/rml-lv/RMLLVTC0006c/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006c/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0006c/people2.csv b/src/test/resources/rml-lv/RMLLVTC0006c/people2.csv deleted file mode 100644 index 103cc9b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006c/people2.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,id -alice,123 -bob,456 -tobias,789 diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/README.md b/src/test/resources/rml-lv/RMLLVTC0006d/README.md deleted file mode 100644 index 203731c..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006d/README.md +++ /dev/null @@ -1,175 +0,0 @@ -## RMLLVTC0006d - -**Title**: Inner Join and Left Join - -**Description**: Test an inner join and a left join in one logical view - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Input 2** -``` -name,id -alice,123 -bob,456 -tobias,789 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv2_id" ; - rml:reference "id" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{csv2_id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; - ] ; - ] . - -``` - -**Output** -``` - "1995"^^ . - . - . - "1999"^^ . - . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006d/mapping.ttl deleted file mode 100644 index 84508df..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006d/mapping.ttl +++ /dev/null @@ -1,112 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv2_id" ; - rml:reference "id" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{csv2_id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/output.nq b/src/test/resources/rml-lv/RMLLVTC0006d/output.nq deleted file mode 100644 index dffa206..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006d/output.nq +++ /dev/null @@ -1,5 +0,0 @@ - "1995"^^ . - . - . - "1999"^^ . - . diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/people.csv b/src/test/resources/rml-lv/RMLLVTC0006d/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006d/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/people.json b/src/test/resources/rml-lv/RMLLVTC0006d/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006d/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0006d/people2.csv b/src/test/resources/rml-lv/RMLLVTC0006d/people2.csv deleted file mode 100644 index 103cc9b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006d/people2.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,id -alice,123 -bob,456 -tobias,789 diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/README.md b/src/test/resources/rml-lv/RMLLVTC0006e/README.md deleted file mode 100644 index 2e9ac2e..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006e/README.md +++ /dev/null @@ -1,171 +0,0 @@ -## RMLLVTC0006e - -**Title**: Two Inner Joins - -**Description**: Test two left joins in one logical view - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Input 2** -``` -name,id -alice,123 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv2_id" ; - rml:reference "id" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{csv2_id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; - ] ; - ] . - -``` - -**Output** -``` - "1995"^^ . - . - . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006e/mapping.ttl deleted file mode 100644 index 8cad87c..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006e/mapping.ttl +++ /dev/null @@ -1,112 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv2_id" ; - rml:reference "id" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{csv2_id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/output.nq b/src/test/resources/rml-lv/RMLLVTC0006e/output.nq deleted file mode 100644 index 2449c7d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006e/output.nq +++ /dev/null @@ -1,3 +0,0 @@ - "1995"^^ . - . - . diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/people.csv b/src/test/resources/rml-lv/RMLLVTC0006e/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006e/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/people.json b/src/test/resources/rml-lv/RMLLVTC0006e/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006e/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0006e/people2.csv b/src/test/resources/rml-lv/RMLLVTC0006e/people2.csv deleted file mode 100644 index 526c93c..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006e/people2.csv +++ /dev/null @@ -1,2 +0,0 @@ -name,id -alice,123 diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/README.md b/src/test/resources/rml-lv/RMLLVTC0006f/README.md deleted file mode 100644 index 009bccb..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006f/README.md +++ /dev/null @@ -1,133 +0,0 @@ -## RMLLVTC0006f - -**Title**: Index Key of Field in Join - -**Description**: Test references to indexes of fields from a join - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -tobias,2005 -bob,1999 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ; - ] ; - ] . - -``` - -**Output** -``` - "1995"^^ . - . - . - "1999"^^ . - . - - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0006f/mapping.ttl deleted file mode 100644 index 3b109d9..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006f/mapping.ttl +++ /dev/null @@ -1,78 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:innerJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/output.nq b/src/test/resources/rml-lv/RMLLVTC0006f/output.nq deleted file mode 100644 index 5a12537..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006f/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "1995"^^ . - . - . - "1999"^^ . - . - diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/people.csv b/src/test/resources/rml-lv/RMLLVTC0006f/people.csv deleted file mode 100644 index 0bf782c..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006f/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -tobias,2005 -bob,1999 diff --git a/src/test/resources/rml-lv/RMLLVTC0006f/people.json b/src/test/resources/rml-lv/RMLLVTC0006f/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0006f/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/README.md b/src/test/resources/rml-lv/RMLLVTC0007a/README.md deleted file mode 100644 index 3d2571d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007a/README.md +++ /dev/null @@ -1,91 +0,0 @@ -## RMLLVTC0007a - -**Title**: Change Reference Formulations: CSV including JSON array - -**Description**: Test a change of reference formulations: csv source including json array - -**Error expected?** No - -**Input** -``` -name,items -alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]" -bob,"[{""type"":""flower"",""weight"":15}]" - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:mixedCSVSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:mixedCSVView a rml:LogicalView ; - rml:viewOn :mixedCSVSource ; - rml:field [ - a rml:ExpressionField; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "items" ; - rml:reference "items" ; - rml:field [ - a rml:IterableField ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]" ; - rml:fieldName "item" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ] ; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :mixedCSVView ; - rml:subjectMap [ - rml:template "http://example.org/item_{#}_{items.item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "items.item.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "items.item.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . - -``` - -**Output** -``` - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0007a/mapping.ttl deleted file mode 100644 index 6f8c6f1..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007a/mapping.ttl +++ /dev/null @@ -1,59 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:mixedCSVSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:mixedCSVView a rml:LogicalView ; - rml:viewOn :mixedCSVSource ; - rml:field [ - a rml:ExpressionField; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "items" ; - rml:reference "items" ; - rml:field [ - a rml:IterableField ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$[*]" ; - rml:fieldName "item" ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ] ; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :mixedCSVView ; - rml:subjectMap [ - rml:template "http://example.org/item_{#}_{items.item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "items.item.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "items.item.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/output.nq b/src/test/resources/rml-lv/RMLLVTC0007a/output.nq deleted file mode 100644 index da66633..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007a/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0007a/people.csv b/src/test/resources/rml-lv/RMLLVTC0007a/people.csv deleted file mode 100644 index cec6cb6..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007a/people.csv +++ /dev/null @@ -1,3 +0,0 @@ -name,items -alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]" -bob,"[{""type"":""flower"",""weight"":15}]" diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/README.md b/src/test/resources/rml-lv/RMLLVTC0007b/README.md deleted file mode 100644 index 6b1c2d3..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007b/README.md +++ /dev/null @@ -1,91 +0,0 @@ -## RMLLVTC0007b - -**Title**: Change Reference Formulations: CSV including JSON object - -**Description**: Test a change of reference formulations: csv source including json object - -**Error expected?** No - -**Input** -``` -name,item -alice,"{""type"":""sword"",""weight"":1500}" -alice,"{""type"":""shield"",""weight"":2500}" -bob,"{""type"":""flower"",""weight"":15}" - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:mixedCSVSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:mixedCSVView a rml:LogicalView ; - rml:viewOn :mixedCSVSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "item" ; - rml:field [ - a rml:IterableField ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$" ; - rml:fieldName "itemJson" ; - rml:field [ - a rml:ExpressionField; - rml:fieldName "type" ; - rml:reference "$.type" ; ] ; - rml:field [ - a rml:ExpressionField; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ] ; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :mixedCSVView ; - rml:subjectMap [ - rml:template "http://example.org/item_{#}_{item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "item.itemJson.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "item.itemJson.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . - -``` - -**Output** -``` - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0007b/mapping.ttl deleted file mode 100644 index e984ea5..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007b/mapping.ttl +++ /dev/null @@ -1,58 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:mixedCSVSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:mixedCSVView a rml:LogicalView ; - rml:viewOn :mixedCSVSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "item" ; - rml:field [ - a rml:IterableField ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$" ; - rml:fieldName "itemJson" ; - rml:field [ - a rml:ExpressionField; - rml:fieldName "type" ; - rml:reference "$.type" ; ] ; - rml:field [ - a rml:ExpressionField; - rml:fieldName "weight" ; - rml:reference "$.weight" ; - ] ; - ] ; - ] . - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :mixedCSVView ; - rml:subjectMap [ - rml:template "http://example.org/item_{#}_{item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "item.itemJson.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "item.itemJson.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/output.nq b/src/test/resources/rml-lv/RMLLVTC0007b/output.nq deleted file mode 100644 index e52543f..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007b/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0007b/people.csv b/src/test/resources/rml-lv/RMLLVTC0007b/people.csv deleted file mode 100644 index eda1eb0..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007b/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,item -alice,"{""type"":""sword"",""weight"":1500}" -alice,"{""type"":""shield"",""weight"":2500}" -bob,"{""type"":""flower"",""weight"":15}" diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/README.md b/src/test/resources/rml-lv/RMLLVTC0007c/README.md deleted file mode 100644 index 1dbd066..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007c/README.md +++ /dev/null @@ -1,100 +0,0 @@ -## RMLLVTC0007c - -**Title**: Change Reference Formulations: JSON including CSV - -**Description**: Test a change of reference formulations: json source including csv data - -**Error expected?** No - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": "type,weight\nsword,1500\nshield,2500" - }, - { - "name": "bob", - "items": "type,weight\nflower,15" - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:mixedJSONSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:mixedJSONView a rml:LogicalView ; - rml:viewOn :mixedJSONSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "items" ; - rml:reference "$.items" ; - rml:field [ - a rml:IterableField ; - rml:referenceFormulation rml:CSV ; - rml:fieldName "item"; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "type" ; - ] ; - rml:field [ - a rml:expressionField ; - rml:fieldName "weight" ; - rml:reference "weight" ; - ] ; - ] ; - ]. - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :mixedJSONView ; - rml:subjectMap [ - rml:template "http://example.org/item_{#}_{items.item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "items.item.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "items.item.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . - -``` - -**Output** -``` - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0007c/mapping.ttl deleted file mode 100644 index 0bec70b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007c/mapping.ttl +++ /dev/null @@ -1,59 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:mixedJSONSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:mixedJSONView a rml:LogicalView ; - rml:viewOn :mixedJSONSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "items" ; - rml:reference "$.items" ; - rml:field [ - a rml:IterableField ; - rml:referenceFormulation rml:CSV ; - rml:fieldName "item"; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "type" ; - ] ; - rml:field [ - a rml:expressionField ; - rml:fieldName "weight" ; - rml:reference "weight" ; - ] ; - ] ; - ]. - -:triplesMapItem a rml:TriplesMap ; - rml:logicalSource :mixedJSONView ; - rml:subjectMap [ - rml:template "http://example.org/item_{#}_{items.item.#}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasType ; - rml:objectMap [ - rml:reference "items.item.type" ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasWeight ; - rml:objectMap [ - rml:reference "items.item.weight" ; - rml:datatype xsd:integer ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/output.nq b/src/test/resources/rml-lv/RMLLVTC0007c/output.nq deleted file mode 100644 index da66633..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007c/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0007c/people.json b/src/test/resources/rml-lv/RMLLVTC0007c/people.json deleted file mode 100644 index af0dd76..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0007c/people.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": "type,weight\nsword,1500\nshield,2500" - }, - { - "name": "bob", - "items": "type,weight\nflower,15" - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0008a/README.md b/src/test/resources/rml-lv/RMLLVTC0008a/README.md deleted file mode 100644 index 8dab087..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008a/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## RMLLVTC0008a - -**Title**: Cycle: Abstract Logical Source - -**Description**: Test a cycle in the abstract logical source of a logical view - -**Error expected?** Yes - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:view1 a rml:LogicalView ; - rml:viewOn :view2 ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name1" ; - rml:reference "name2" ; - ] . - -:view2 a rml:LogicalView ; - rml:viewOn :view1 ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name2" ; - rml:reference "name1" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :view2 ; - rml:subjectMap [ - rml:template "http://example.org/person/{name2}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name2" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0008a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008a/mapping.ttl deleted file mode 100644 index 8295ade..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008a/mapping.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix rml: . -@prefix : . - -:view1 a rml:LogicalView ; - rml:viewOn :view2 ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name1" ; - rml:reference "name2" ; - ] . - -:view2 a rml:LogicalView ; - rml:viewOn :view1 ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name2" ; - rml:reference "name1" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :view2 ; - rml:subjectMap [ - rml:template "http://example.org/person/{name2}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name2" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/README.md b/src/test/resources/rml-lv/RMLLVTC0008b/README.md deleted file mode 100644 index bfa0672..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008b/README.md +++ /dev/null @@ -1,134 +0,0 @@ -## RMLLVTC0008b - -**Title**: Cycle: Joins - -**Description**: Test a cycle in two joins of two logical views - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :csvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv_birthyear" ; - rml:reference "birthyear" ; - ] ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{json_item}" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008b/mapping.ttl deleted file mode 100644 index fed9db6..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008b/mapping.ttl +++ /dev/null @@ -1,90 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "$.items[*]" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :csvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csv_birthyear" ; - rml:reference "birthyear" ; - ] ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "json_item" ; - rml:reference "item" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{name}/item/{json_item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/output.nq b/src/test/resources/rml-lv/RMLLVTC0008b/output.nq deleted file mode 100644 index f9fd2a8..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008b/output.nq +++ /dev/null @@ -1,6 +0,0 @@ - "1995"^^ . - . - . - "1999"^^ . - . - "2005"^^ . diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/people.csv b/src/test/resources/rml-lv/RMLLVTC0008b/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008b/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0008b/people.json b/src/test/resources/rml-lv/RMLLVTC0008b/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008b/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0008c/README.md b/src/test/resources/rml-lv/RMLLVTC0008c/README.md deleted file mode 100644 index 2a3de1b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008c/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## RMLLVTC0008c - -**Title**: Cycle: Self-Join - -**Description**: Test a cycle in a join of a logical view: self-join - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "newName" ; - rml:reference "name" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{newName}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "newName" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0008c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008c/mapping.ttl deleted file mode 100644 index b238c10..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008c/mapping.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "newName" ; - rml:reference "name" ; - ] ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{newName}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "newName" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0008c/people.json b/src/test/resources/rml-lv/RMLLVTC0008c/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008c/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0008d/README.md b/src/test/resources/rml-lv/RMLLVTC0008d/README.md deleted file mode 100644 index 02362e3..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008d/README.md +++ /dev/null @@ -1,70 +0,0 @@ -## RMLLVTC0008d - -**Title**: Cycle: Fields - -**Description**: Test a cycle in nested fields - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field :field1 . - -:field1 a rml:IterableField ; - rml:fieldName "item" ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.items[*]" ; - rml:field :field2. - -:field2 a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - rml:field :field1. - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0008d/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0008d/mapping.ttl deleted file mode 100644 index 6d32c26..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008d/mapping.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field :field1 . - -:field1 a rml:IterableField ; - rml:fieldName "item" ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.items[*]" ; - rml:field :field2. - -:field2 a rml:ExpressionField ; - rml:fieldName "type" ; - rml:reference "$.type" ; - rml:field :field1. diff --git a/src/test/resources/rml-lv/RMLLVTC0008d/people.json b/src/test/resources/rml-lv/RMLLVTC0008d/people.json deleted file mode 100644 index 87d5629..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0008d/people.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - { - "type": "sword", - "weight": 1500 - }, - { - "type": "shield", - "weight": 2500 - } - ] - }, - { - "name": "bob", - "items": [ - { - "type": "flower", - "weight": 15 - } - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0009a/README.md b/src/test/resources/rml-lv/RMLLVTC0009a/README.md deleted file mode 100644 index 547b910..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009a/README.md +++ /dev/null @@ -1,65 +0,0 @@ -## RMLLVTC0009a - -**Title**: Name collision: between Fields with the same Parent - -**Description**: Test a name collision between fields with the same parent - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "givenName": "Alice", - "familyName": "Smith" - }, - { - "givenName": "Bob", - "familyName": "Johnson" - } - ] -} - -``` - -**Mapping** -``` -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.givenName" ; - ], [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.familyName" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0009a/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0009a/mapping.ttl deleted file mode 100644 index a5e4612..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009a/mapping.ttl +++ /dev/null @@ -1,35 +0,0 @@ -@prefix rml: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.givenName" ; - ], [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.familyName" ; - ] . - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :jsonView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasName ; - rml:objectMap [ - rml:reference "name" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0009a/people.json b/src/test/resources/rml-lv/RMLLVTC0009a/people.json deleted file mode 100644 index 2361327..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009a/people.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "people": [ - { - "givenName": "Alice", - "familyName": "Smith" - }, - { - "givenName": "Bob", - "familyName": "Johnson" - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/README.md b/src/test/resources/rml-lv/RMLLVTC0009b/README.md deleted file mode 100644 index 6916b82..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009b/README.md +++ /dev/null @@ -1,118 +0,0 @@ -## RMLLVTC0009b - -**Title**: Name collision: caused by Field from a Join - -**Description**: Test a name collision caused by a field from a join - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "givenName": "alice", - "familyName": "smith", - "items": [ - "sword", - "shield" - ] - }, - { - "givenName": "bob", - "familyName": "johnson", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,birthyear -alice,1995 -bob,1999 -tobias,2005 - -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "givenName" ; - rml:reference "$.givenName" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "familyName" ; - rml:reference "$.familyName" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "givenName" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "familyName" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0009b/mapping.ttl deleted file mode 100644 index 458d72f..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009b/mapping.ttl +++ /dev/null @@ -1,72 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "givenName" ; - rml:reference "$.givenName" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "familyName" ; - rml:reference "$.familyName" ; - ] . - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "birthyear" ; - rml:reference "birthyear" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "givenName" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "familyName" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{name}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasBirthYear ; - rml:objectMap [ - rml:reference "birthyear" ; - rml:datatype xsd:gYear ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/people.csv b/src/test/resources/rml-lv/RMLLVTC0009b/people.csv deleted file mode 100644 index edc942d..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009b/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,birthyear -alice,1995 -bob,1999 -tobias,2005 diff --git a/src/test/resources/rml-lv/RMLLVTC0009b/people.json b/src/test/resources/rml-lv/RMLLVTC0009b/people.json deleted file mode 100644 index 35085f7..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009b/people.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "people": [ - { - "givenName": "alice", - "familyName": "smith", - "items": [ - "sword", - "shield" - ] - }, - { - "givenName": "bob", - "familyName": "johnson", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/README.md b/src/test/resources/rml-lv/RMLLVTC0009c/README.md deleted file mode 100644 index 88b86d1..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009c/README.md +++ /dev/null @@ -1,156 +0,0 @@ -## RMLLVTC0009c - -**Title**: Name collision: between Fields from different Joins - -**Description**: Test a name collision between fields from different joins - -**Error expected?** Yes - -**Input** -``` -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} - -``` - -**Input 1** -``` -name,id -alice,123 -bob,456 -tobias,789 - -``` - -**Input 2** -``` -name,item -alice,lantern -bob,leaf -``` - -**Mapping** -``` -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "jsonitem" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csvitem" ; - rml:reference "item" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "jsonitem" ; - ] ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "csvitem" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{id}/item/{item}" ; - ] ; - ] . - -``` - diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/mapping.ttl b/src/test/resources/rml-lv/RMLLVTC0009c/mapping.ttl deleted file mode 100644 index b569569..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009c/mapping.ttl +++ /dev/null @@ -1,105 +0,0 @@ -@prefix rml: . -@prefix xsd: . -@prefix : . - -:jsonSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.json" ; - ] ; - rml:referenceFormulation rml:JSONPath ; - rml:iterator "$.people[*]" . - -:jsonView a rml:LogicalView ; - rml:viewOn :jsonSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "$.name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "jsonitem" ; - rml:reference "$.items[*]" ; - ] . - -:additionalCsvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people2.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:additionalCsvView a rml:LogicalView ; - rml:viewOn :additionalCsvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "csvitem" ; - rml:reference "item" ; - ] ; -. - -:csvSource a rml:LogicalSource ; - rml:source [ - a rml:RelativePathSource , rml:Source ; - rml:root rml:MappingDirectory ; - rml:path "people.csv" ; - ] ; - rml:referenceFormulation rml:CSV . - -:csvView a rml:LogicalView ; - rml:viewOn :csvSource ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "name" ; - rml:reference "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "id" ; - rml:reference "id" ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :jsonView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "jsonitem" ; - ] ; - ] ; - rml:leftJoin [ - rml:parentLogicalView :additionalCsvView ; - rml:joinCondition [ - rml:parent "name" ; - rml:child "name" ; - ] ; - rml:field [ - a rml:ExpressionField ; - rml:fieldName "item" ; - rml:reference "csvitem" ; - ] ; - ] . - - -:triplesMapPerson a rml:TriplesMap ; - rml:logicalSource :csvView ; - rml:subjectMap [ - rml:template "http://example.org/person/{id}" ; - ] ; - rml:predicateObjectMap [ - rml:predicate :hasItem ; - rml:objectMap [ - rml:template "http://example.org/person/{id}/item/{item}" ; - ] ; - ] . diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/people.csv b/src/test/resources/rml-lv/RMLLVTC0009c/people.csv deleted file mode 100644 index 103cc9b..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009c/people.csv +++ /dev/null @@ -1,4 +0,0 @@ -name,id -alice,123 -bob,456 -tobias,789 diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/people.json b/src/test/resources/rml-lv/RMLLVTC0009c/people.json deleted file mode 100644 index c2fd489..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009c/people.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "people": [ - { - "name": "alice", - "items": [ - "sword", - "shield" - ] - }, - { - "name": "bob", - "items": [ - "flower" - ] - } - ] -} diff --git a/src/test/resources/rml-lv/RMLLVTC0009c/people2.csv b/src/test/resources/rml-lv/RMLLVTC0009c/people2.csv deleted file mode 100644 index 54d2522..0000000 --- a/src/test/resources/rml-lv/RMLLVTC0009c/people2.csv +++ /dev/null @@ -1,3 +0,0 @@ -name,item -alice,lantern -bob,leaf \ No newline at end of file diff --git a/src/test/resources/rml-lv/config.js b/src/test/resources/rml-lv/config.js deleted file mode 100644 index 7973ff3..0000000 --- a/src/test/resources/rml-lv/config.js +++ /dev/null @@ -1,87 +0,0 @@ -async function loadTurtle() { - //this is the function you call in 'preProcess', to load the highlighter - const worker = await new Promise(resolve => { - require(["core/worker"], ({ worker }) => resolve(worker)); - }); - const action = "highlight-load-lang"; - const langURL = - "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; - const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded - const lang = "turtle"; // this is the class you use to identify the language - worker.postMessage({ action, langURL, propName, lang }); - return new Promise(resolve => { - worker.addEventListener("message", function listener({ data }) { - const { action: responseAction, lang: responseLang } = data; - if (responseAction === action && responseLang === lang) { - worker.removeEventListener("message", listener); - resolve(); - } - }); - }); -} - -var respecConfig = { - // check https://respec.org/docs/ for the meaning of these keys - preProcess: [loadTurtle], - authors: [ - { - name: "Pano Maria", - mailto: "pano@skemu.com", - url: "https://panomaria.com", - company: "Skemu", - companyURL: "https://skemu.com" - }, - { - name: "Els de Vleeschauwer", - mailto: "els.devleeschauwer@ugent.be", - company: "Ghent University – imec – IDLab", - orcidid: "0000-0002-8630-3947", - companyURL: "https://idlab.technology/" - } - ], - edDraftURI: "https://w3id.org/rml/lv/test-cases/", - editors: [ - { - name: "Pano Maria", - mailto: "pano@skemu.com", - url: "https://panomaria.com", - company: "Skemu", - companyURL: "https://skemu.com" - }, - { - name: "Els de Vleeschauwer", - mailto: "els.devleeschauwer@ugent.be", - company: "Ghent University – imec – IDLab", - orcidid: "0000-0002-8630-3947", - companyURL: "https://idlab.technology/" - } - ], - formerEditors: [ - ], - github: "https://github.com/kg-construct/rml-lv", - license: "w3c-software-doc", - localBiblio: { - "RML-Core": { - title: "RML-Core", - href: "https://w3id.org/rml/core/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "07 August 2024", - }, - "RML-IO": { - title: "RML-IO", - href: "https://w3id.org/rml/io/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "12 March 2024", - }, - }, - publishDate: "2025-08-05", - otherLinks: [], - shortName: "RML-LV-Testcases", - specStatus: "CG-DRAFT", - // W3C config - copyrightStart: "2024", - doJsonLd: true, - group: "kg-construct", -}; diff --git a/src/test/resources/rml-lv/descriptions.csv b/src/test/resources/rml-lv/descriptions.csv deleted file mode 100644 index f95d42a..0000000 --- a/src/test/resources/rml-lv/descriptions.csv +++ /dev/null @@ -1,41 +0,0 @@ -RML ID,Title,Purpose,"Error -expected?","Input -1","Input -2","Input -3","Output -default","Output -1","Output -2","Output -3",Comment -RMLLVTC0000a,Logical view on JSON source,Test a view on a hierarchical source,no,people.json,,,output.nq,,,, -RMLLVTC0000b,Logical view on CSV source,Test a view on a tabular source,no,people.csv,,,output.nq,,,, -RMLLVTC0000c,Logical View on Logical View,Test a view on a logical view,no,people.json,,,output.nq,,,, -RMLLVTC0001a,Expression Field: Reference,Test a reference in an expression field,no,people.json,,,output.nq,,,, -RMLLVTC0001b,Expression Field: Template,Test a template in an expression field,no,people.json,,,output.nq,,,, -RMLLVTC0001c,Expression Field: Constant,Test a constant expression in an expression field,no,people.json,,,output.nq,,,, -RMLLVTC0001d,Expression Field Siblings,Test multiple expression fields with the same parent,no,people.json,,,output.nq,,,, -RMLLVTC0002a,Iterable Field,Test a nested field construction: iterable field with expression field as child,no,people.json,,,output.nq,,,, -RMLLVTC0002b,Iterable Field with Multiple Children,Test a nested field construction: iterable field with mulitple expression fields as children,no,people.json,,,output.nq,,,, -RMLLVTC0002c,Nested Iterable Fields,Test a nested field construction: iterable field with an iterable field as child,no,people.json,,,output.nq,,,, -RMLLVTC0003a,Index Key: #,Test a reference to the index key #,no,people.json,,,output.nq,,,, -RMLLVTC0003b,Index Key: Iterable Field,Test a reference to the index key of an iterable field,no,people.json,,,output.nq,,,, -RMLLVTC0003c,Index Key: Expression field,Test a reference to the index key of an expression field,no,people.json,,,output.nq,,,, -RMLLVTC0004a,Natural Datatype: Index #,Test the natural datatype mapping for the index #,no,people.json,,,output.nq,,,, -RMLLVTC0004b,Natural Datatype: Index Expression Field,Test the natural datatype mapping for the index of an expression field,no,people.json,,,output.nq,,,, -RMLLVTC0004c,Natural Datatype: Index Iterable Field,Test the natural datatype mapping for the index of an iterable field,no,people.json,,,output.nq,,,, -RMLLVTC0004d,Natural Datatype: Record Expression Field,Test the natural datatype mapping for a record of an expression field,no,people.json,,,output.nq,,,, -RMLLVTC0005a,Referencing a Non-Existing Key,Test a reference to a non-existing key,yes,people.json,,,,,,, -RMLLVTC0005b,Referencing the Record Key ,Test a reference to the record key ,yes,people.json,,,,,,, -RMLLVTC0005c,Referencing the Record Key of an Iterable Field,Test a reference to the record key of an iterable field,yes,people.json,,,,,,, -RMLLVTC0006a,Left Join,Test a left join,no,people.json,people.csv,,output.nq,,,, -RMLLVTC0006b,Inner Join,Test an inner join,no,people.json,people.csv,,output.nq,,,, -RMLLVTC0006c,Two Left Joins,Test two left joins in one logical view,no,people.json,people.csv,people2.csv,output.nq,,,, -RMLLVTC0006d,Inner Join and Left Join,Test an inner join and a left join in one logical view,no,people.json,people.csv,people2.csv,output.nq,,,, -RMLLVTC0006e,Two Inner Joins,Test two left joins in one logical view,no,people.json,people.csv,people2.csv,output.nq,,,, -RMLLVTC0006f,Index Key of Field in Join,Test references to indexes of fields from a join,no,people.json,people.csv,,output.nq,,,, -RMLLVTC0007a,Change Reference Formulations: CSV including JSON array,Test a change of reference formulations: csv source including json array,no,people.csv,,,output.nq,,,, -RMLLVTC0007b,Change Reference Formulations: CSV including JSON object,Test a change of reference formulations: csv source including json object,no,people.csv,,,output.nq,,,, -RMLLVTC0007c,Change Reference Formulations: JSON including CSV,Test a change of reference formulations: json source including csv data,no,people.json,,,output.nq,,,, -RMLLVTC0008a,Cycle: Abstract Logical Source,Test a cycle in the abstract logical source of a logical view,yes,,,,,,,, -RMLLVTC0008b,Cycle: Joins,Test a cycle in two joins of two logical views,yes,people.json,people.csv,,,,,, -RMLLVTC0008c,Cycle: Self-Join,Test a cycle in a join of a logical view: self-join,yes,people.json,people.csv,,,,,, diff --git a/src/test/resources/rml-lv/dev.html b/src/test/resources/rml-lv/dev.html deleted file mode 100644 index 9868a5e..0000000 --- a/src/test/resources/rml-lv/dev.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - RML-LV: Test Cases - - - - - - - - - - -
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - diff --git a/src/test/resources/rml-lv/docs/20250130/index.html b/src/test/resources/rml-lv/docs/20250130/index.html deleted file mode 100644 index ac943f8..0000000 --- a/src/test/resources/rml-lv/docs/20250130/index.html +++ /dev/null @@ -1,1742 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0001

-

Title: Expression Field

-

Description: Test expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/people/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
-<http://example.org/people/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0002

-

Title: Iterable Field

-

Description: Test nested expression field, with iterable field as parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

6. RMLLVTC0003

-

Title: Left Join

-

Description: Test left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item_type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-<http://example.org/person/tobias> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

7. RMLLVTC0004

-

Title: Inner Join

-

Description: Test inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [ a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item_type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLLVTC0005

-

Title: Index

-

Description: Test references to index keys, including joins

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/people/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "item_{#}_{item_type.#}" ;
-    rml:termType rml:BlankNode ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
-<http://example.org/people/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_0 .
-<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_1 .
-_:item_0_0 <http://example.org/hasType> "sword" .
-_:item_0_0 <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:item_0_1 <http://example.org/hasType> "shield" .
-_:item_0_1 <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/people/bob> <http://example.org/hasName> "bob" .
-<http://example.org/people/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/bob> <http://example.org/hasItem> _:item_1_0 .
-_:item_1_0 <http://example.org/hasType> "flower" .
-_:item_1_0 <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

9. RMLLVTC0006

-

Title: Change Reference Formulations: CSV, including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

10. RMLLVTC0007

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

11. RMLLVTC0008

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

12. RMLLVTC0009

-

Title: Two Left Joins

-

Description: Test two left joins

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [ a
-    rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-  :additionalCsvSource a rml:LogicalSource ;
-    rml:source [
-      a rml:RelativePathSource , rml:Source ;
-      rml:root rml:MappingDirectory ;
-      rml:path "people2.csv" ;
-    ] ;
-    rml:referenceFormulation rml:CSV .
-
-  :additionalCsvView a rml:LogicalView ;
-    rml:viewOn :additionalCsvSource ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "name" ;
-      rml:reference "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "id" ;
-      rml:reference "id" ;
-    ] ;
-    .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/people/{id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item_type.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/people/123> <http://example.org/hasName> "alice" .
-<http://example.org/people/123> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_0> .
-<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_1> .
-<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/people/456> <http://example.org/hasName> "bob" .
-<http://example.org/people/456> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/456> <http://example.org/hasItem> <http://example.org/item_1_0> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/people/789> <http://example.org/hasName> "tobias" .
-<http://example.org/people/789> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250204/index.html b/src/test/resources/rml-lv/docs/20250204/index.html deleted file mode 100644 index 8fa4666..0000000 --- a/src/test/resources/rml-lv/docs/20250204/index.html +++ /dev/null @@ -1,1742 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0001

-

Title: Expression Field

-

Description: Test expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/people/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
-<http://example.org/people/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0002

-

Title: Iterable Field

-

Description: Test nested expression field, with iterable field as parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

6. RMLLVTC0003

-

Title: Left Join

-

Description: Test left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item_type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-<http://example.org/person/tobias> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

7. RMLLVTC0004

-

Title: Inner Join

-

Description: Test inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [ a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item_type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/alice/item/sword> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasType> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasType> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLLVTC0005

-

Title: Index

-

Description: Test references to index keys, including joins

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/people/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "item_{#}_{item_type.#}" ;
-    rml:termType rml:BlankNode ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/people/alice> <http://example.org/hasName> "alice" .
-<http://example.org/people/alice> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_0 .
-<http://example.org/people/alice> <http://example.org/hasItem> _:item_0_1 .
-_:item_0_0 <http://example.org/hasType> "sword" .
-_:item_0_0 <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-_:item_0_1 <http://example.org/hasType> "shield" .
-_:item_0_1 <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/people/bob> <http://example.org/hasName> "bob" .
-<http://example.org/people/bob> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/bob> <http://example.org/hasItem> _:item_1_0 .
-_:item_1_0 <http://example.org/hasType> "flower" .
-_:item_1_0 <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

9. RMLLVTC0006

-

Title: Change Reference Formulations: CSV, including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

10. RMLLVTC0007

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

11. RMLLVTC0008

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

12. RMLLVTC0009

-

Title: Two Left Joins

-

Description: Test two left joins

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [ a
-    rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-  :additionalCsvSource a rml:LogicalSource ;
-    rml:source [
-      a rml:RelativePathSource , rml:Source ;
-      rml:root rml:MappingDirectory ;
-      rml:path "people2.csv" ;
-    ] ;
-    rml:referenceFormulation rml:CSV .
-
-  :additionalCsvView a rml:LogicalView ;
-    rml:viewOn :additionalCsvSource ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "name" ;
-      rml:reference "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "id" ;
-      rml:reference "id" ;
-    ] ;
-    .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_type" ;
-      rml:reference "item.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item_weight" ;
-      rml:reference "item.weight" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/people/{id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthyear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:parentTriplesMap :triplesMapItem ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item_type.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item_type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item_weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/people/123> <http://example.org/hasName> "alice" .
-<http://example.org/people/123> <http://example.org/hasBirthyear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_0> .
-<http://example.org/people/123> <http://example.org/hasItem> <http://example.org/item_0_1> .
-<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/people/456> <http://example.org/hasName> "bob" .
-<http://example.org/people/456> <http://example.org/hasBirthyear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/people/456> <http://example.org/hasItem> <http://example.org/item_1_0> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/people/789> <http://example.org/hasName> "tobias" .
-<http://example.org/people/789> <http://example.org/hasBirthyear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250216/index.html b/src/test/resources/rml-lv/docs/20250216/index.html deleted file mode 100644 index 3588dcc..0000000 --- a/src/test/resources/rml-lv/docs/20250216/index.html +++ /dev/null @@ -1,2142 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
- -
Authors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0000a

-

Title: Logical view on JSON source

-

Description: Test a view on a hierarchical source

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0000b

-

Title: Logical view on CSV source

-

Description: Test a view on a tabular source

-

Error expected? No

-

Input

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-
-
-

6. RMLLVTC0000c

-

Title: Logical View on Logical View

-

Description: Test a view on a logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:jsonViewOnJsonView a rml:LogicalView ;
-  rml:viewOn :jsonView ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "newName" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonViewOnJsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

7. RMLLVTC0001a

-

Title: Expression Field: Reference

-

Description: Test a reference in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

8. RMLLVTC0001b

-

Title: Expression Field: Template

-

Description: Test a template in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "race" ;
-    rml:constant "human" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasRace ;
-    rml:objectMap [
-      rml:reference "race" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
-<http://example.org/person/bob> <http://example.org/hasRace> "human" .
-
-
-

9. RMLLVTC0001c

-

Title: Expression Field: Constant

-

Description: Test a constant expression in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "fullName" ;
-    rml:template "{name} {lastName}" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:reference "fullName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

10. RMLLVTC0001d

-

Title: Expression Field Siblings

-

Description: Test multiple expression fields with the same parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "lastName" ;
-    rml:reference "$.lastName" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:template "{name} {lastName}" ;
-      rml:termType rml:Literal ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

11. RMLLVTC0002a

-

Title: Iterable Field

-

Description: Test a nested field construction: iterable field with expression field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{item.type}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

12. RMLLVTC0002b

-

Title: Iterable Field with Multiple Children

-

Description: Test a nested field construction: iterable field with mulitple expression fields as children

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

13. RMLLVTC0002c

-

Title: Nested Iterable Fields

-

Description: Test a nested field construction: iterable field with an iterable field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "measures": {
-            "weight": 1500,
-            "length": 30
-          }
-        },
-        {
-          "type": "shield",
-          "measures": {
-            "weight": 2500
-          }
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "measures" : {
-            "weight": 15,
-            "length" : 15
-          }
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:IterableField ;
-      rml:fieldName "measures";
-      rml:iterator "$.measures";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-        ];
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "length" ;
-        rml:reference "$.length" ;
-      ]
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.measures.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

14. RMLLVTC0003a

-

Title: Index Key: #

-

Description: Test a reference to the index key #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

15. RMLLVTC0003b

-

Title: Index Key: Iterable Field

-

Description: Test a reference to the index key of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-
-

16. RMLLVTC0003c

-

Title: Index Key: Expression field

-

Description: Test a reference to the index key of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-

17. RMLLVTC0004a

-

Title: Natural Datatype: Index #

-

Description: Test the natural datatype mapping for the index #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

18. RMLLVTC0007a

-

Title: Change Reference Formulations: CSV including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Input

-
name,items
-alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
-bob,"[{""type"":""flower"",""weight"":15}]"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

19. RMLLVTC0007b

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Input

-
name,item
-alice,"{""type"":""sword"",""weight"":1500}"
-alice,"{""type"":""shield"",""weight"":2500}"
-bob,"{""type"":""flower"",""weight"":15}"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

20. RMLLVTC0007c

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

21. RMLLVTC0008a

-

Title: Cycle: Abstract Logical Source

-

Description: Test a cycle in the abstract logical source of a logical view

-

Error expected? Yes

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:view1 a rml:LogicalView ;
-  rml:viewOn :view2 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name1" ;
-    rml:reference "name2" ;
-  ] .
-
-:view2 a rml:LogicalView ;
-  rml:viewOn :view1 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name2" ;
-    rml:reference "name1" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :view2 ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name2}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name2" ;
-    ] ;
-  ] .
-
-
-

22. RMLLVTC0008b

-

Title: Cycle: Joins

-

Description: Test a cycle in two joins of two logical views

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :csvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv_birthyear" ;
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

23. RMLLVTC0008c

-

Title: Cycle: Self-Join

-

Description: Test a cycle in a join of a logical view: self-join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "newName" ;
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250228/index.html b/src/test/resources/rml-lv/docs/20250228/index.html deleted file mode 100644 index f95999f..0000000 --- a/src/test/resources/rml-lv/docs/20250228/index.html +++ /dev/null @@ -1,3383 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
- -
Authors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0000a

-

Title: Logical view on JSON source

-

Description: Test a view on a hierarchical source

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0000b

-

Title: Logical view on CSV source

-

Description: Test a view on a tabular source

-

Error expected? No

-

Input

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-
-
-

6. RMLLVTC0000c

-

Title: Logical View on Logical View

-

Description: Test a view on a logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:jsonViewOnJsonView a rml:LogicalView ;
-  rml:viewOn :jsonView ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "newName" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonViewOnJsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

7. RMLLVTC0001a

-

Title: Expression Field: Reference

-

Description: Test a reference in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

8. RMLLVTC0001b

-

Title: Expression Field: Template

-

Description: Test a template in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "race" ;
-    rml:constant "human" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasRace ;
-    rml:objectMap [
-      rml:reference "race" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
-<http://example.org/person/bob> <http://example.org/hasRace> "human" .
-
-
-

9. RMLLVTC0001c

-

Title: Expression Field: Constant

-

Description: Test a constant expression in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "fullName" ;
-    rml:template "{name} {lastName}" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:reference "fullName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

10. RMLLVTC0001d

-

Title: Expression Field Siblings

-

Description: Test multiple expression fields with the same parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "lastName" ;
-    rml:reference "$.lastName" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:template "{name} {lastName}" ;
-      rml:termType rml:Literal ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

11. RMLLVTC0002a

-

Title: Iterable Field

-

Description: Test a nested field construction: iterable field with expression field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{item.type}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

12. RMLLVTC0002b

-

Title: Iterable Field with Multiple Children

-

Description: Test a nested field construction: iterable field with mulitple expression fields as children

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

13. RMLLVTC0002c

-

Title: Nested Iterable Fields

-

Description: Test a nested field construction: iterable field with an iterable field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "measures": {
-            "weight": 1500,
-            "length": 30
-          }
-        },
-        {
-          "type": "shield",
-          "measures": {
-            "weight": 2500
-          }
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "measures" : {
-            "weight": 15,
-            "length" : 15
-          }
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:IterableField ;
-      rml:fieldName "measures";
-      rml:iterator "$.measures";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-        ];
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "length" ;
-        rml:reference "$.length" ;
-      ]
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.measures.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

14. RMLLVTC0003a

-

Title: Index Key: #

-

Description: Test a reference to the index key #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

15. RMLLVTC0003b

-

Title: Index Key: Iterable Field

-

Description: Test a reference to the index key of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-
-

16. RMLLVTC0003c

-

Title: Index Key: Expression field

-

Description: Test a reference to the index key of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-

17. RMLLVTC0004a

-

Title: Natural Datatype: Index #

-

Description: Test the natural datatype mapping for the index #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

18. RMLLVTC0004b

-

Title: Natural Datatype: Index Expression Field

-

Description: Test the natural datatype mapping for the index of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

19. RMLLVTC0004c

-

Title: Natural Datatype: Index Iterable Field

-

Description: Test the natural datatype mapping for the index of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

20. RMLLVTC0004d

-

Title: Natural Datatype: Record Expression Field

-

Description: Test the natural datatype mapping for a record of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "birth_year": 1995
-    },
-    {
-      "name": "bob",
-      "birth_year": 1999
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "$.birth_year" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

21. RMLLVTC0005a

-

Title: Referencing a Non-Existing Key

-

Description: Test a reference to a non-existing key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{Name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "Name" ;
-    ] ;
-  ] .
-
-
-

22. RMLLVTC0005b

-

Title: Referencing the Record Key

-

Description: Test a reference to the record key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :isDerivedFrom ;
-    rml:objectMap [
-      rml:reference "<it>" ;
-    ] ;
-  ] .
-
-
-

23. RMLLVTC0005c

-

Title: Referencing the Record Key of an Iterable Field

-

Description: Test a reference to the record key of an iterable field

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/{item}" ;
-    ] ;
-  ] .
-
-
-

24. RMLLVTC0006a

-

Title: Left Join

-

Description: Test a left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

25. RMLLVTC0006b

-

Title: Inner Join

-

Description: Test an inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

26. RMLLVTC0006c

-

Title: Two Left Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

27. RMLLVTC0006d

-

Title: Inner Join and Left Join

-

Description: Test an inner join and a left join in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-
-
-

28. RMLLVTC0006e

-

Title: Two Inner Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-
-
-

29. RMLLVTC0006f

-

Title: Index Key of Field in Join

-

Description: Test references to indexes of fields from a join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-tobias,2005
-bob,1999
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
-<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
-
-
-
-

30. RMLLVTC0007a

-

Title: Change Reference Formulations: CSV including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Input

-
name,items
-alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
-bob,"[{""type"":""flower"",""weight"":15}]"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

31. RMLLVTC0007b

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Input

-
name,item
-alice,"{""type"":""sword"",""weight"":1500}"
-alice,"{""type"":""shield"",""weight"":2500}"
-bob,"{""type"":""flower"",""weight"":15}"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

32. RMLLVTC0007c

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

33. RMLLVTC0008a

-

Title: Cycle: Abstract Logical Source

-

Description: Test a cycle in the abstract logical source of a logical view

-

Error expected? Yes

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:view1 a rml:LogicalView ;
-  rml:viewOn :view2 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name1" ;
-    rml:reference "name2" ;
-  ] .
-
-:view2 a rml:LogicalView ;
-  rml:viewOn :view1 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name2" ;
-    rml:reference "name1" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :view2 ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name2}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name2" ;
-    ] ;
-  ] .
-
-
-

34. RMLLVTC0008b

-

Title: Cycle: Joins

-

Description: Test a cycle in two joins of two logical views

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :csvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv_birthyear" ;
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

35. RMLLVTC0008c

-

Title: Cycle: Self-Join

-

Description: Test a cycle in a join of a logical view: self-join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "newName" ;
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250508/index.html b/src/test/resources/rml-lv/docs/20250508/index.html deleted file mode 100644 index 70bbcb8..0000000 --- a/src/test/resources/rml-lv/docs/20250508/index.html +++ /dev/null @@ -1,3529 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
- -
Authors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0000a

-

Title: Logical view on JSON source

-

Description: Test a view on a hierarchical source

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0000b

-

Title: Logical view on CSV source

-

Description: Test a view on a tabular source

-

Error expected? No

-

Input

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-
-
-

6. RMLLVTC0000c

-

Title: Logical View on Logical View

-

Description: Test a view on a logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:jsonViewOnJsonView a rml:LogicalView ;
-  rml:viewOn :jsonView ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "newName" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonViewOnJsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

7. RMLLVTC0001a

-

Title: Expression Field: Reference

-

Description: Test a reference in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

8. RMLLVTC0001b

-

Title: Expression Field: Template

-

Description: Test a template in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "race" ;
-    rml:constant "human" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasRace ;
-    rml:objectMap [
-      rml:reference "race" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
-<http://example.org/person/bob> <http://example.org/hasRace> "human" .
-
-
-

9. RMLLVTC0001c

-

Title: Expression Field: Constant

-

Description: Test a constant expression in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "fullName" ;
-    rml:template "{name} {lastName}" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:reference "fullName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

10. RMLLVTC0001d

-

Title: Expression Field Siblings

-

Description: Test multiple expression fields with the same parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "lastName" ;
-    rml:reference "$.lastName" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:template "{name} {lastName}" ;
-      rml:termType rml:Literal ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

11. RMLLVTC0002a

-

Title: Iterable Field

-

Description: Test a nested field construction: iterable field with expression field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{item.type}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

12. RMLLVTC0002b

-

Title: Iterable Field with Multiple Children

-

Description: Test a nested field construction: iterable field with mulitple expression fields as children

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

13. RMLLVTC0002c

-

Title: Nested Iterable Fields

-

Description: Test a nested field construction: iterable field with an iterable field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "measures": {
-            "weight": 1500,
-            "length": 30
-          }
-        },
-        {
-          "type": "shield",
-          "measures": {
-            "weight": 2500
-          }
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "measures" : {
-            "weight": 15,
-            "length" : 15
-          }
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:IterableField ;
-      rml:fieldName "measures";
-      rml:iterator "$.measures";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-        ];
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "length" ;
-        rml:reference "$.length" ;
-      ]
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.measures.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

14. RMLLVTC0003a

-

Title: Index Key: #

-

Description: Test a reference to the index key #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

15. RMLLVTC0003b

-

Title: Index Key: Iterable Field

-

Description: Test a reference to the index key of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-
-

16. RMLLVTC0003c

-

Title: Index Key: Expression field

-

Description: Test a reference to the index key of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-

17. RMLLVTC0004a

-

Title: Natural Datatype: Index #

-

Description: Test the natural datatype mapping for the index #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

18. RMLLVTC0004b

-

Title: Natural Datatype: Index Expression Field

-

Description: Test the natural datatype mapping for the index of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

19. RMLLVTC0004c

-

Title: Natural Datatype: Index Iterable Field

-

Description: Test the natural datatype mapping for the index of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

20. RMLLVTC0004d

-

Title: Natural Datatype: Record Expression Field

-

Description: Test the natural datatype mapping for a record of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "birth_year": 1995
-    },
-    {
-      "name": "bob",
-      "birth_year": 1999
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "$.birth_year" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

21. RMLLVTC0005a

-

Title: Referencing a Non-Existing Key

-

Description: Test a reference to a non-existing key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{Name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "Name" ;
-    ] ;
-  ] .
-
-
-

22. RMLLVTC0005b

-

Title: Referencing the Record Key

-

Description: Test a reference to the record key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :isDerivedFrom ;
-    rml:objectMap [
-      rml:reference "<it>" ;
-    ] ;
-  ] .
-
-
-

23. RMLLVTC0005c

-

Title: Referencing the Record Key of an Iterable Field

-

Description: Test a reference to the record key of an iterable field

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/{item}" ;
-    ] ;
-  ] .
-
-
-

24. RMLLVTC0006a

-

Title: Left Join

-

Description: Test a left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

25. RMLLVTC0006b

-

Title: Inner Join

-

Description: Test an inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

26. RMLLVTC0006c

-

Title: Two Left Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

27. RMLLVTC0006d

-

Title: Inner Join and Left Join

-

Description: Test an inner join and a left join in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-
-
-

28. RMLLVTC0006e

-

Title: Two Inner Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-
-
-

29. RMLLVTC0006f

-

Title: Index Key of Field in Join

-

Description: Test references to indexes of fields from a join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-tobias,2005
-bob,1999
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
-<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
-
-
-
-

30. RMLLVTC0007a

-

Title: Change Reference Formulations: CSV including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Input

-
name,items
-alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
-bob,"[{""type"":""flower"",""weight"":15}]"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

31. RMLLVTC0007b

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Input

-
name,item
-alice,"{""type"":""sword"",""weight"":1500}"
-alice,"{""type"":""shield"",""weight"":2500}"
-bob,"{""type"":""flower"",""weight"":15}"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

32. RMLLVTC0007c

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

33. RMLLVTC0008a

-

Title: Cycle: Abstract Logical Source

-

Description: Test a cycle in the abstract logical source of a logical view

-

Error expected? Yes

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:view1 a rml:LogicalView ;
-  rml:viewOn :view2 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name1" ;
-    rml:reference "name2" ;
-  ] .
-
-:view2 a rml:LogicalView ;
-  rml:viewOn :view1 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name2" ;
-    rml:reference "name1" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :view2 ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name2}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name2" ;
-    ] ;
-  ] .
-
-
-

34. RMLLVTC0008b

-

Title: Cycle: Joins

-

Description: Test a cycle in two joins of two logical views

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :csvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv_birthyear" ;
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-
-

35. RMLLVTC0008c

-

Title: Cycle: Self-Join

-

Description: Test a cycle in a join of a logical view: self-join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "newName" ;
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-
- - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250725/index.html b/src/test/resources/rml-lv/docs/20250725/index.html deleted file mode 100644 index b0c480a..0000000 --- a/src/test/resources/rml-lv/docs/20250725/index.html +++ /dev/null @@ -1,3490 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
- -
Authors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0000a

-

Title: Logical view on JSON source

-

Description: Test a view on a hierarchical source

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0000b

-

Title: Logical view on CSV source

-

Description: Test a view on a tabular source

-

Error expected? No

-

Input

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-
-
-

6. RMLLVTC0000c

-

Title: Logical View on Logical View

-

Description: Test a view on a logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:jsonViewOnJsonView a rml:LogicalView ;
-  rml:viewOn :jsonView ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "newName" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonViewOnJsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

7. RMLLVTC0001a

-

Title: Expression Field: Reference

-

Description: Test a reference in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

8. RMLLVTC0001b

-

Title: Expression Field: Template

-

Description: Test a template in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "race" ;
-    rml:constant "human" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasRace ;
-    rml:objectMap [
-      rml:reference "race" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
-<http://example.org/person/bob> <http://example.org/hasRace> "human" .
-
-
-

9. RMLLVTC0001c

-

Title: Expression Field: Constant

-

Description: Test a constant expression in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "fullName" ;
-    rml:template "{name} {lastName}" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:reference "fullName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

10. RMLLVTC0001d

-

Title: Expression Field Siblings

-

Description: Test multiple expression fields with the same parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "lastName" ;
-    rml:reference "$.lastName" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:template "{name} {lastName}" ;
-      rml:termType rml:Literal ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

11. RMLLVTC0002a

-

Title: Iterable Field

-

Description: Test a nested field construction: iterable field with expression field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{item.type}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

12. RMLLVTC0002b

-

Title: Iterable Field with Multiple Children

-

Description: Test a nested field construction: iterable field with mulitple expression fields as children

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

13. RMLLVTC0002c

-

Title: Nested Iterable Fields

-

Description: Test a nested field construction: iterable field with an iterable field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "measures": {
-            "weight": 1500,
-            "length": 30
-          }
-        },
-        {
-          "type": "shield",
-          "measures": {
-            "weight": 2500
-          }
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "measures" : {
-            "weight": 15,
-            "length" : 15
-          }
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:IterableField ;
-      rml:fieldName "measures";
-      rml:iterator "$.measures";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-        ];
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "length" ;
-        rml:reference "$.length" ;
-      ]
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.measures.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

14. RMLLVTC0003a

-

Title: Index Key: #

-

Description: Test a reference to the index key #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

15. RMLLVTC0003b

-

Title: Index Key: Iterable Field

-

Description: Test a reference to the index key of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-
-

16. RMLLVTC0003c

-

Title: Index Key: Expression field

-

Description: Test a reference to the index key of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-

17. RMLLVTC0004a

-

Title: Natural Datatype: Index #

-

Description: Test the natural datatype mapping for the index #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

18. RMLLVTC0004b

-

Title: Natural Datatype: Index Expression Field

-

Description: Test the natural datatype mapping for the index of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

19. RMLLVTC0004c

-

Title: Natural Datatype: Index Iterable Field

-

Description: Test the natural datatype mapping for the index of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

20. RMLLVTC0004d

-

Title: Natural Datatype: Record Expression Field

-

Description: Test the natural datatype mapping for a record of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "birth_year": 1995
-    },
-    {
-      "name": "bob",
-      "birth_year": 1999
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "$.birth_year" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

21. RMLLVTC0005a

-

Title: Referencing a Non-Existing Key

-

Description: Test a reference to a non-existing key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{Name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "Name" ;
-    ] ;
-  ] .
-
-
-

22. RMLLVTC0005b

-

Title: Referencing the Record Key

-

Description: Test a reference to the record key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :isDerivedFrom ;
-    rml:objectMap [
-      rml:reference "<it>" ;
-    ] ;
-  ] .
-
-
-

23. RMLLVTC0005c

-

Title: Referencing the Record Key of an Iterable Field

-

Description: Test a reference to the record key of an iterable field

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/{item}" ;
-    ] ;
-  ] .
-
-
-

24. RMLLVTC0006a

-

Title: Left Join

-

Description: Test a left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

25. RMLLVTC0006b

-

Title: Inner Join

-

Description: Test an inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

26. RMLLVTC0006c

-

Title: Two Left Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

27. RMLLVTC0006d

-

Title: Inner Join and Left Join

-

Description: Test an inner join and a left join in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-
-
-

28. RMLLVTC0006e

-

Title: Two Inner Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-
-
-

29. RMLLVTC0006f

-

Title: Index Key of Field in Join

-

Description: Test references to indexes of fields from a join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-tobias,2005
-bob,1999
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
-<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
-
-
-
-

30. RMLLVTC0007a

-

Title: Change Reference Formulations: CSV including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Input

-
name,items
-alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
-bob,"[{""type"":""flower"",""weight"":15}]"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

31. RMLLVTC0007b

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Input

-
name,item
-alice,"{""type"":""sword"",""weight"":1500}"
-alice,"{""type"":""shield"",""weight"":2500}"
-bob,"{""type"":""flower"",""weight"":15}"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

32. RMLLVTC0007c

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

33. RMLLVTC0008a

-

Title: Cycle: Abstract Logical Source

-

Description: Test a cycle in the abstract logical source of a logical view

-

Error expected? Yes

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:view1 a rml:LogicalView ;
-  rml:viewOn :view2 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name1" ;
-    rml:reference "name2" ;
-  ] .
-
-:view2 a rml:LogicalView ;
-  rml:viewOn :view1 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name2" ;
-    rml:reference "name1" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :view2 ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name2}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name2" ;
-    ] ;
-  ] .
-
-
-

34. RMLLVTC0008b

-

Title: Cycle: Joins

-

Description: Test a cycle in two joins of two logical views

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :csvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv_birthyear" ;
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-
-

35. RMLLVTC0008c

-

Title: Cycle: Self-Join

-

Description: Test a cycle in a join of a logical view: self-join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "newName" ;
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-
- - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20250805/index.html b/src/test/resources/rml-lv/docs/20250805/index.html deleted file mode 100644 index c74314d..0000000 --- a/src/test/resources/rml-lv/docs/20250805/index.html +++ /dev/null @@ -1,3524 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
- -
Authors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0000a

-

Title: Logical view on JSON source

-

Description: Test a view on a hierarchical source

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0000b

-

Title: Logical view on CSV source

-

Description: Test a view on a tabular source

-

Error expected? No

-

Input

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-
-
-

6. RMLLVTC0000c

-

Title: Logical View on Logical View

-

Description: Test a view on a logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:jsonViewOnJsonView a rml:LogicalView ;
-  rml:viewOn :jsonView ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "newName" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonViewOnJsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

7. RMLLVTC0001a

-

Title: Expression Field: Reference

-

Description: Test a reference in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

8. RMLLVTC0001b

-

Title: Expression Field: Template

-

Description: Test a template in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "race" ;
-    rml:constant "human" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasRace ;
-    rml:objectMap [
-      rml:reference "race" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
-<http://example.org/person/bob> <http://example.org/hasRace> "human" .
-
-
-

9. RMLLVTC0001c

-

Title: Expression Field: Constant

-

Description: Test a constant expression in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "fullName" ;
-    rml:template "{name} {lastName}" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:reference "fullName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

10. RMLLVTC0001d

-

Title: Expression Field Siblings

-

Description: Test multiple expression fields with the same parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "lastName" ;
-    rml:reference "$.lastName" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:template "{name} {lastName}" ;
-      rml:termType rml:Literal ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

11. RMLLVTC0002a

-

Title: Iterable Field

-

Description: Test a nested field construction: iterable field with expression field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{item.type}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

12. RMLLVTC0002b

-

Title: Iterable Field with Multiple Children

-

Description: Test a nested field construction: iterable field with mulitple expression fields as children

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

13. RMLLVTC0002c

-

Title: Nested Iterable Fields

-

Description: Test a nested field construction: iterable field with an iterable field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "measures": {
-            "weight": 1500,
-            "length": 30
-          }
-        },
-        {
-          "type": "shield",
-          "measures": {
-            "weight": 2500
-          }
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "measures" : {
-            "weight": 15,
-            "length" : 15
-          }
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:IterableField ;
-      rml:fieldName "measures";
-      rml:iterator "$.measures";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-        ];
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.measures.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

14. RMLLVTC0003a

-

Title: Index Key: #

-

Description: Test a reference to the index key #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

15. RMLLVTC0003b

-

Title: Index Key: Iterable Field

-

Description: Test a reference to the index key of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-
-

16. RMLLVTC0003c

-

Title: Index Key: Expression field

-

Description: Test a reference to the index key of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-

17. RMLLVTC0004a

-

Title: Natural Datatype: Index #

-

Description: Test the natural datatype mapping for the index #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

18. RMLLVTC0004b

-

Title: Natural Datatype: Index Expression Field

-

Description: Test the natural datatype mapping for the index of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

19. RMLLVTC0004c

-

Title: Natural Datatype: Index Iterable Field

-

Description: Test the natural datatype mapping for the index of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

20. RMLLVTC0004d

-

Title: Natural Datatype: Record Expression Field

-

Description: Test the natural datatype mapping for a record of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "birth_year": 1995
-    },
-    {
-      "name": "bob",
-      "birth_year": 1999
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "$.birth_year" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

21. RMLLVTC0005a

-

Title: Referencing a Non-Existing Key

-

Description: Test a reference to a non-existing key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{Name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "Name" ;
-    ] ;
-  ] .
-
-
-

22. RMLLVTC0005b

-

Title: Referencing the Record Key

-

Description: Test a reference to the record key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :isDerivedFrom ;
-    rml:objectMap [
-      rml:reference "<it>" ;
-    ] ;
-  ] .
-
-
-

23. RMLLVTC0005c

-

Title: Referencing the Record Key of an Iterable Field

-

Description: Test a reference to the record key of an iterable field

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/{item}" ;
-    ] ;
-  ] .
-
-
-

24. RMLLVTC0006a

-

Title: Left Join

-

Description: Test a left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

25. RMLLVTC0006b

-

Title: Inner Join

-

Description: Test an inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

26. RMLLVTC0006c

-

Title: Two Left Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

27. RMLLVTC0006d

-

Title: Inner Join and Left Join

-

Description: Test an inner join and a left join in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-
-
-

28. RMLLVTC0006e

-

Title: Two Inner Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-
-
-

29. RMLLVTC0006f

-

Title: Index Key of Field in Join

-

Description: Test references to indexes of fields from a join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-tobias,2005
-bob,1999
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
-<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
-
-
-
-

30. RMLLVTC0007a

-

Title: Change Reference Formulations: CSV including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Input

-
name,items
-alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
-bob,"[{""type"":""flower"",""weight"":15}]"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

31. RMLLVTC0007b

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Input

-
name,item
-alice,"{""type"":""sword"",""weight"":1500}"
-alice,"{""type"":""shield"",""weight"":2500}"
-bob,"{""type"":""flower"",""weight"":15}"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

32. RMLLVTC0007c

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

33. RMLLVTC0008a

-

Title: Cycle: Abstract Logical Source

-

Description: Test a cycle in the abstract logical source of a logical view

-

Error expected? Yes

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:view1 a rml:LogicalView ;
-  rml:viewOn :view2 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name1" ;
-    rml:reference "name2" ;
-  ] .
-
-:view2 a rml:LogicalView ;
-  rml:viewOn :view1 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name2" ;
-    rml:reference "name1" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :view2 ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name2}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name2" ;
-    ] ;
-  ] .
-
-
-

34. RMLLVTC0008b

-

Title: Cycle: Joins

-

Description: Test a cycle in two joins of two logical views

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :csvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv_birthyear" ;
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-
-

35. RMLLVTC0008c

-

Title: Cycle: Self-Join

-

Description: Test a cycle in a join of a logical view: self-join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "newName" ;
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-
- - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/20251029/index.html b/src/test/resources/rml-lv/docs/20251029/index.html deleted file mode 100644 index 9cc552a..0000000 --- a/src/test/resources/rml-lv/docs/20251029/index.html +++ /dev/null @@ -1,3850 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
- -
Authors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0000a

-

Title: Logical view on JSON source

-

Description: Test a view on a hierarchical source

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0000b

-

Title: Logical view on CSV source

-

Description: Test a view on a tabular source

-

Error expected? No

-

Input

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-
-
-

6. RMLLVTC0000c

-

Title: Logical View on Logical View

-

Description: Test a view on a logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:jsonViewOnJsonView a rml:LogicalView ;
-  rml:viewOn :jsonView ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "newName" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonViewOnJsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

7. RMLLVTC0001a

-

Title: Expression Field: Reference

-

Description: Test a reference in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

8. RMLLVTC0001b

-

Title: Expression Field: Template

-

Description: Test a template in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "race" ;
-    rml:constant "human" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasRace ;
-    rml:objectMap [
-      rml:reference "race" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
-<http://example.org/person/bob> <http://example.org/hasRace> "human" .
-
-
-

9. RMLLVTC0001c

-

Title: Expression Field: Constant

-

Description: Test a constant expression in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "fullName" ;
-    rml:template "{name} {lastName}" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:reference "fullName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

10. RMLLVTC0001d

-

Title: Expression Field Siblings

-

Description: Test multiple expression fields with the same parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "lastName" ;
-    rml:reference "$.lastName" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:template "{name} {lastName}" ;
-      rml:termType rml:Literal ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

11. RMLLVTC0002a

-

Title: Iterable Field

-

Description: Test a nested field construction: iterable field with expression field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{item.type}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

12. RMLLVTC0002b

-

Title: Iterable Field with Multiple Children

-

Description: Test a nested field construction: iterable field with mulitple expression fields as children

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

13. RMLLVTC0002c

-

Title: Nested Iterable Fields

-

Description: Test a nested field construction: iterable field with an iterable field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "measures": {
-            "weight": 1500,
-            "length": 30
-          }
-        },
-        {
-          "type": "shield",
-          "measures": {
-            "weight": 2500
-          }
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "measures" : {
-            "weight": 15,
-            "length" : 15
-          }
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:IterableField ;
-      rml:fieldName "measures";
-      rml:iterator "$.measures";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-        ];
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.measures.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

14. RMLLVTC0003a

-

Title: Index Key: #

-

Description: Test a reference to the index key #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

15. RMLLVTC0003b

-

Title: Index Key: Iterable Field

-

Description: Test a reference to the index key of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-
-

16. RMLLVTC0003c

-

Title: Index Key: Expression field

-

Description: Test a reference to the index key of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-

17. RMLLVTC0004a

-

Title: Natural Datatype: Index #

-

Description: Test the natural datatype mapping for the index #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

18. RMLLVTC0004b

-

Title: Natural Datatype: Index Expression Field

-

Description: Test the natural datatype mapping for the index of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

19. RMLLVTC0004c

-

Title: Natural Datatype: Index Iterable Field

-

Description: Test the natural datatype mapping for the index of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

20. RMLLVTC0004d

-

Title: Natural Datatype: Record Expression Field

-

Description: Test the natural datatype mapping for a record of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "birth_year": 1995
-    },
-    {
-      "name": "bob",
-      "birth_year": 1999
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "$.birth_year" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

21. RMLLVTC0005a

-

Title: Referencing a Non-Existing Key

-

Description: Test a reference to a non-existing key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{Name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "Name" ;
-    ] ;
-  ] .
-
-
-

22. RMLLVTC0005b

-

Title: Referencing the Record Key

-

Description: Test a reference to the record key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :isDerivedFrom ;
-    rml:objectMap [
-      rml:reference "<it>" ;
-    ] ;
-  ] .
-
-
-

23. RMLLVTC0005c

-

Title: Referencing the Record Key of an Iterable Field

-

Description: Test a reference to the record key of an iterable field

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/{item}" ;
-    ] ;
-  ] .
-
-
-

24. RMLLVTC0006a

-

Title: Left Join

-

Description: Test a left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

25. RMLLVTC0006b

-

Title: Inner Join

-

Description: Test an inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

26. RMLLVTC0006c

-

Title: Two Left Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

27. RMLLVTC0006d

-

Title: Inner Join and Left Join

-

Description: Test an inner join and a left join in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-
-
-

28. RMLLVTC0006e

-

Title: Two Inner Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-
-
-

29. RMLLVTC0006f

-

Title: Index Key of Field in Join

-

Description: Test references to indexes of fields from a join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-tobias,2005
-bob,1999
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
-<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
-
-
-
-

30. RMLLVTC0007a

-

Title: Change Reference Formulations: CSV including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Input

-
name,items
-alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
-bob,"[{""type"":""flower"",""weight"":15}]"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

31. RMLLVTC0007b

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Input

-
name,item
-alice,"{""type"":""sword"",""weight"":1500}"
-alice,"{""type"":""shield"",""weight"":2500}"
-bob,"{""type"":""flower"",""weight"":15}"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

32. RMLLVTC0007c

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

33. RMLLVTC0008a

-

Title: Cycle: Abstract Logical Source

-

Description: Test a cycle in the abstract logical source of a logical view

-

Error expected? Yes

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:view1 a rml:LogicalView ;
-  rml:viewOn :view2 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name1" ;
-    rml:reference "name2" ;
-  ] .
-
-:view2 a rml:LogicalView ;
-  rml:viewOn :view1 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name2" ;
-    rml:reference "name1" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :view2 ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name2}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name2" ;
-    ] ;
-  ] .
-
-
-

34. RMLLVTC0008b

-

Title: Cycle: Joins

-

Description: Test a cycle in two joins of two logical views

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :csvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv_birthyear" ;
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-
-

35. RMLLVTC0008c

-

Title: Cycle: Self-Join

-

Description: Test a cycle in a join of a logical view: self-join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "newName" ;
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-
-

36. RMLLVTC0008d

-

Title: Cycle: Fields

-

Description: Test a cycle in nested fields

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field :field1 .
-
-:field1 a rml:IterableField ;
-  rml:fieldName "item" ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.items[*]" ;
-  rml:field :field2.
-
-:field2 a rml:ExpressionField ;
-  rml:fieldName "type" ;
-  rml:reference "$.type" ;
-  rml:field :field1.
-
-
-

37. RMLLVTC0009a

-

Title: Name collision: between Fields with the same Parent

-

Description: Test a name collision between fields with the same parent

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "givenName": "Alice",
-      "familyName": "Smith"
-    },
-    {
-      "givenName": "Bob",
-      "familyName": "Johnson"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.givenName" ;
-  ], [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.familyName" ;
-  ]  .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-
-

38. RMLLVTC0009b

-

Title: Name collision: caused by Field from a Join

-

Description: Test a name collision caused by a field from a join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "givenName": "alice",
-      "familyName": "smith",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "givenName": "bob",
-      "familyName": "johnson",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "givenName" ;
-    rml:reference "$.givenName" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "familyName" ;
-    rml:reference "$.familyName" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "givenName" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "name" ;
-      rml:reference "familyName" ;
-    ] ; 
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] .
-
-
-

39. RMLLVTC0009c

-

Title: Name collision: between Fields from different Joins

-

Description: Test a name collision between fields from different joins

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Input 2

-
name,item
-alice,lantern
-bob,leaf
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "jsonitem" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "csvitem" ;
-     rml:reference "item" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "id" ;
-    rml:reference "id" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item" ;
-      rml:reference "jsonitem" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "item" ;
-      rml:reference "csvitem" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{id}/item/{item}" ;
-    ] ;
-  ] .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/docs/index.html b/src/test/resources/rml-lv/docs/index.html deleted file mode 100644 index c74314d..0000000 --- a/src/test/resources/rml-lv/docs/index.html +++ /dev/null @@ -1,3524 +0,0 @@ - - - - - - -RML-LV: Test Cases - - - - - - - - - - - - - - - -
- -

RML-LV: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-LV-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/lv/test-cases/
- - - - -
Editors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
- -
Authors:
- (Skemu) -
- (Ghent University – imec – IDLab) -
-
Feedback:
- GitHub kg-construct/rml-lv - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLLVTC0000a

-

Title: Logical view on JSON source

-

Description: Test a view on a hierarchical source

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

5. RMLLVTC0000b

-

Title: Logical view on CSV source

-

Description: Test a view on a tabular source

-

Error expected? No

-

Input

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-<http://example.org/person/tobias> <http://example.org/hasName> "tobias" .
-
-
-

6. RMLLVTC0000c

-

Title: Logical View on Logical View

-

Description: Test a view on a logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:jsonViewOnJsonView a rml:LogicalView ;
-  rml:viewOn :jsonView ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "newName" ;
-    rml:reference "name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonViewOnJsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

7. RMLLVTC0001a

-

Title: Expression Field: Reference

-

Description: Test a reference in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasName> "alice" .
-<http://example.org/person/bob> <http://example.org/hasName> "bob" .
-
-
-

8. RMLLVTC0001b

-

Title: Expression Field: Template

-

Description: Test a template in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "race" ;
-    rml:constant "human" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasRace ;
-    rml:objectMap [
-      rml:reference "race" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasRace> "human" .
-<http://example.org/person/bob> <http://example.org/hasRace> "human" .
-
-
-

9. RMLLVTC0001c

-

Title: Expression Field: Constant

-

Description: Test a constant expression in an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "fullName" ;
-    rml:template "{name} {lastName}" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:reference "fullName" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

10. RMLLVTC0001d

-

Title: Expression Field Siblings

-

Description: Test multiple expression fields with the same parent

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "lastName": "smith",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "lastName": "jones",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "lastName" ;
-    rml:reference "$.lastName" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasFullName ;
-    rml:objectMap [
-      rml:template "{name} {lastName}" ;
-      rml:termType rml:Literal ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasFullName> "alice smith" .
-<http://example.org/person/bob> <http://example.org/hasFullName> "bob jones" .
-
-
-

11. RMLLVTC0002a

-

Title: Iterable Field

-

Description: Test a nested field construction: iterable field with expression field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{item.type}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

12. RMLLVTC0002b

-

Title: Iterable Field with Multiple Children

-

Description: Test a nested field construction: iterable field with mulitple expression fields as children

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "weight" ;
-      rml:reference "$.weight" ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasName> "sword" .
-<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasName> "shield" .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasName> "flower" .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

13. RMLLVTC0002c

-

Title: Nested Iterable Fields

-

Description: Test a nested field construction: iterable field with an iterable field as child

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "measures": {
-            "weight": 1500,
-            "length": 30
-          }
-        },
-        {
-          "type": "shield",
-          "measures": {
-            "weight": 2500
-          }
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "measures" : {
-            "weight": 15,
-            "length" : 15
-          }
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-    rml:field [
-      a rml:IterableField ;
-      rml:fieldName "measures";
-      rml:iterator "$.measures";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-        ];
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.measures.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

14. RMLLVTC0003a

-

Title: Index Key: #

-

Description: Test a reference to the index key #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

15. RMLLVTC0003b

-

Title: Index Key: Iterable Field

-

Description: Test a reference to the index key of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.type" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-
-

16. RMLLVTC0003c

-

Title: Index Key: Expression field

-

Description: Test a reference to the index key of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/0> <http://example.org/hasType> "sword" .
-<http://example.org/person/alice/item/1> <http://example.org/hasType> "shield" .
-<http://example.org/person/bob/item/0> <http://example.org/hasType> "flower" .
-
-
-

17. RMLLVTC0004a

-

Title: Natural Datatype: Index #

-

Description: Test the natural datatype mapping for the index #

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

18. RMLLVTC0004b

-

Title: Natural Datatype: Index Expression Field

-

Description: Test the natural datatype mapping for the index of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item.type}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

19. RMLLVTC0004c

-

Title: Natural Datatype: Index Iterable Field

-

Description: Test the natural datatype mapping for the index of an iterable field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}/item/{item}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasSequenceNumber ;
-    rml:objectMap [
-      rml:reference "item.#" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice/item/sword> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/alice/item/shield> <http://example.org/hasSequenceNumber> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob/item/flower> <http://example.org/hasSequenceNumber> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

20. RMLLVTC0004d

-

Title: Natural Datatype: Record Expression Field

-

Description: Test the natural datatype mapping for a record of an expression field

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "birth_year": 1995
-    },
-    {
-      "name": "bob",
-      "birth_year": 1999
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "$.birth_year" ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

21. RMLLVTC0005a

-

Title: Referencing a Non-Existing Key

-

Description: Test a reference to a non-existing key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{Name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "Name" ;
-    ] ;
-  ] .
-
-
-

22. RMLLVTC0005b

-

Title: Referencing the Record Key

-

Description: Test a reference to the record key

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :isDerivedFrom ;
-    rml:objectMap [
-      rml:reference "<it>" ;
-    ] ;
-  ] .
-
-
-

23. RMLLVTC0005c

-

Title: Referencing the Record Key of an Iterable Field

-

Description: Test a reference to the record key of an iterable field

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:IterableField ;
-    rml:fieldName "item" ;
-    rml:iterator "$.items[*]" ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "type" ;
-      rml:reference "$.type" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/{item}" ;
-    ] ;
-  ] .
-
-
-

24. RMLLVTC0006a

-

Title: Left Join

-

Description: Test a left join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-<http://example.org/person/tobias> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

25. RMLLVTC0006b

-

Title: Inner Join

-

Description: Test an inner join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/alice> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/sword> .
-<http://example.org/person/alice> <http://example.org/hasItem> <http://example.org/person/alice/item/shield> .
-<http://example.org/person/bob> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/bob> <http://example.org/hasItem> <http://example.org/person/bob/item/flower> .
-
-
-

26. RMLLVTC0006c

-

Title: Two Left Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-<http://example.org/person/789> <http://example.org/hasBirthYear> "2005"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-
-
-

27. RMLLVTC0006d

-

Title: Inner Join and Left Join

-

Description: Test an inner join and a left join in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-bob,456
-tobias,789
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-<http://example.org/person/456> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/456> <http://example.org/hasItem> <http://example.org/person/456/item/flower> .
-
-
-

28. RMLLVTC0006e

-

Title: Two Inner Joins

-

Description: Test two left joins in one logical view

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Input 2

-
name,id
-alice,123
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:additionalCsvSource a rml:LogicalSource ;
-  rml:source [
-   a rml:RelativePathSource , rml:Source ;
-   rml:root rml:MappingDirectory ;
-   rml:path "people2.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:additionalCsvView a rml:LogicalView ;
-  rml:viewOn :additionalCsvSource ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "name" ;
-     rml:reference "name" ;
-    ] ;
-    rml:field [
-     a rml:ExpressionField ;
-     rml:fieldName "id" ;
-     rml:reference "id" ;
-    ] ;
-.
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :additionalCsvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv2_id" ;
-      rml:reference "id" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{csv2_id}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{csv2_id}/item/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/123> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/sword> .
-<http://example.org/person/123> <http://example.org/hasItem> <http://example.org/person/123/item/shield> .
-
-
-

29. RMLLVTC0006f

-

Title: Index Key of Field in Join

-

Description: Test references to indexes of fields from a join

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-tobias,2005
-bob,1999
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:innerJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{#}/item/{json_item.#}/{json_item}" ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/person/0> <http://example.org/hasBirthYear> "1995"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/0/sword> .
-<http://example.org/person/0> <http://example.org/hasItem> <http://example.org/person/0/item/1/shield> .
-<http://example.org/person/2> <http://example.org/hasBirthYear> "1999"^^<http://www.w3.org/2001/XMLSchema#gYear> .
-<http://example.org/person/2> <http://example.org/hasItem> <http://example.org/person/2/item/0/flower> .
-
-
-
-

30. RMLLVTC0007a

-

Title: Change Reference Formulations: CSV including JSON array

-

Description: Test a change of reference formulations: csv source including json array

-

Error expected? No

-

Input

-
name,items
-alice,"[{""type"":""sword"",""weight"":1500},{""type"":""shield"",""weight"":2500}]"
-bob,"[{""type"":""flower"",""weight"":15}]"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$[*]" ;
-      rml:fieldName "item" ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ;
-      ] ;
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

31. RMLLVTC0007b

-

Title: Change Reference Formulations: CSV including JSON object

-

Description: Test a change of reference formulations: csv source including json object

-

Error expected? No

-

Input

-
name,item
-alice,"{""type"":""sword"",""weight"":1500}"
-alice,"{""type"":""shield"",""weight"":2500}"
-bob,"{""type"":""flower"",""weight"":15}"
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedCSVSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:mixedCSVView a rml:LogicalView ;
-  rml:viewOn :mixedCSVSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "item" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:JSONPath ;
-      rml:iterator "$" ;
-      rml:fieldName "itemJson" ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "type" ;
-        rml:reference "$.type" ; ] ;
-      rml:field [
-        a rml:ExpressionField;
-        rml:fieldName "weight" ;
-        rml:reference "$.weight" ;
-      ] ;
-    ] ;
-  ] .
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedCSVView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "item.itemJson.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "item.itemJson.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "shield" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_2_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_2_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

32. RMLLVTC0007c

-

Title: Change Reference Formulations: JSON including CSV

-

Description: Test a change of reference formulations: json source including csv data

-

Error expected? No

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": "type,weight\nsword,1500\nshield,2500"
-    },
-    {
-      "name": "bob",
-      "items": "type,weight\nflower,15"
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:mixedJSONSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:mixedJSONView a rml:LogicalView ;
-  rml:viewOn :mixedJSONSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-    ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "items" ;
-    rml:reference "$.items" ;
-    rml:field [
-      a rml:IterableField ;
-      rml:referenceFormulation rml:CSV ;
-      rml:fieldName "item";
-      rml:field [
-        a rml:ExpressionField ;
-        rml:fieldName "type" ;
-        rml:reference "type" ;
-      ] ;
-      rml:field [
-        a rml:expressionField ;
-        rml:fieldName "weight" ;
-        rml:reference "weight" ;
-      ] ;
-    ] ;
-  ].
-
-:triplesMapItem a rml:TriplesMap ;
-  rml:logicalSource :mixedJSONView ;
-  rml:subjectMap [
-    rml:template "http://example.org/item_{#}_{items.item.#}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasType ;
-    rml:objectMap [
-      rml:reference "items.item.type" ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasWeight ;
-    rml:objectMap [
-      rml:reference "items.item.weight" ;
-      rml:datatype xsd:integer ;
-    ] ;
-  ] .
-
-

Output

-
<http://example.org/item_0_0> <http://example.org/hasType> "sword" .
-<http://example.org/item_0_0> <http://example.org/hasWeight> "1500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_0_1> <http://example.org/hasType> "shield" .
-<http://example.org/item_0_1> <http://example.org/hasWeight> "2500"^^<http://www.w3.org/2001/XMLSchema#integer> .
-<http://example.org/item_1_0> <http://example.org/hasType> "flower" .
-<http://example.org/item_1_0> <http://example.org/hasWeight> "15"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

33. RMLLVTC0008a

-

Title: Cycle: Abstract Logical Source

-

Description: Test a cycle in the abstract logical source of a logical view

-

Error expected? Yes

-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:view1 a rml:LogicalView ;
-  rml:viewOn :view2 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name1" ;
-    rml:reference "name2" ;
-  ] .
-
-:view2 a rml:LogicalView ;
-  rml:viewOn :view1 ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name2" ;
-    rml:reference "name1" ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :view2 ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name2}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "name2" ;
-    ] ;
-  ] .
-
-
-

34. RMLLVTC0008b

-

Title: Cycle: Joins

-

Description: Test a cycle in two joins of two logical views

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        "sword",
-        "shield"
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        "flower"
-      ]
-    }
-  ]
-}
-
-

Input 1

-
name,birthyear
-alice,1995
-bob,1999
-tobias,2005
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "item" ;
-    rml:reference "$.items[*]" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :csvView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "csv_birthyear" ;
-      rml:reference "birthyear" ;
-    ] ;
-  ] .
-
-:csvSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.csv" ;
-  ] ;
-  rml:referenceFormulation rml:CSV .
-
-:csvView a rml:LogicalView ;
-  rml:viewOn :csvSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "name" ;
-  ] ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "birthyear" ;
-    rml:reference "birthyear" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "json_item" ;
-      rml:reference "item" ;
-    ] ;
-  ] .
-
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :csvView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{name}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasBirthYear ;
-    rml:objectMap [
-      rml:reference "birthyear" ;
-      rml:datatype xsd:gYear ;
-    ] ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasItem ;
-    rml:objectMap [
-      rml:template "http://example.org/person/{name}/item/{json_item}" ;
-    ] ;
-  ] .
-
-
-

35. RMLLVTC0008c

-

Title: Cycle: Self-Join

-

Description: Test a cycle in a join of a logical view: self-join

-

Error expected? Yes

-

Input

-
{
-  "people": [
-    {
-      "name": "alice",
-      "items": [
-        {
-          "type": "sword",
-          "weight": 1500
-        },
-        {
-          "type": "shield",
-          "weight": 2500
-        }
-      ]
-    },
-    {
-      "name": "bob",
-      "items": [
-        {
-          "type": "flower",
-          "weight": 15
-        }
-      ]
-    }
-  ]
-}
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix : <http://example.org/> .
-
-:jsonSource a rml:LogicalSource ;
-  rml:source [
-    a rml:RelativePathSource , rml:Source ;
-    rml:root rml:MappingDirectory ;
-    rml:path "people.json" ;
-  ] ;
-  rml:referenceFormulation rml:JSONPath ;
-  rml:iterator "$.people[*]" .
-
-:jsonView a rml:LogicalView ;
-  rml:viewOn :jsonSource ;
-  rml:field [
-    a rml:ExpressionField ;
-    rml:fieldName "name" ;
-    rml:reference "$.name" ;
-  ] ;
-  rml:leftJoin [
-    rml:parentLogicalView :jsonView ;
-    rml:joinCondition [
-      rml:parent "name" ;
-      rml:child "name" ;
-    ] ;
-    rml:field [
-      a rml:ExpressionField ;
-      rml:fieldName "newName" ;
-      rml:reference "name" ;
-    ] ;
-  ] .
-
-:triplesMapPerson a rml:TriplesMap ;
-  rml:logicalSource :jsonView ;
-  rml:subjectMap [
-    rml:template "http://example.org/person/{newName}" ;
-  ] ;
-  rml:predicateObjectMap [
-    rml:predicate :hasName ;
-    rml:objectMap [
-      rml:reference "newName" ;
-    ] ;
-  ] .
-
-
- - - - - - \ No newline at end of file diff --git a/src/test/resources/rml-lv/list.sh b/src/test/resources/rml-lv/list.sh deleted file mode 100755 index 12c3203..0000000 --- a/src/test/resources/rml-lv/list.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -for i in RML*; do - echo "
" -done diff --git a/src/test/resources/rml-lv/make-metadata.py b/src/test/resources/rml-lv/make-metadata.py deleted file mode 100755 index 2be2cb8..0000000 --- a/src/test/resources/rml-lv/make-metadata.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import glob -import csv - -def get_title_description(testcase: str): - with open ('descriptions.csv') as csvfile: - reader = csv.reader(csvfile) - for row in reader: - if row[0] == testcase: - return row[1], row[2] - -def main(spec: str): - with open ('metadata.csv', 'w', newline='') as csvfile: - writer = csv.writer(csvfile) - writer.writerow(['ID', 'title', 'description', 'specification', - 'mapping', 'input_format1', 'input_format2', - 'input_format3', 'output_format1', 'output_format2', - 'output_format3', 'input1', 'input2', 'input3', - 'output1', 'output2', 'output3', 'error']) - for testcase in glob.glob('RML*'): - print(testcase) - title, description = get_title_description(testcase) - error = 'false' - input1 = '' - input2 = '' - input3 = '' - input_format1 = '' - input_format2 = '' - input_format3 = '' - output1 = '' - output2 = '' - output3 = '' - output_format1 = '' - output_format2 = '' - output_format3 = '' - - # Input file - if os.path.exists(os.path.join(testcase, 'people.json')): - input1 = 'people.json' - input_format1 = 'application/json' - - if os.path.exists(os.path.join(testcase, 'people.csv')): - if input1 == '': - input1 = 'people.csv' - input_format1 = 'text/csv' - else: - input2 = 'people.csv' - input_format2 = 'text/csv' - - if os.path.exists(os.path.join(testcase, 'people2.csv')): - input3 = 'people2.csv' - input_format3 = 'text/csv' - - # Mapping file - if os.path.exists(os.path.join(testcase, 'mapping.ttl')): - mapping_file = 'mapping.ttl' - else: - raise ValueError('Mapping file missing!') - - # Output files - if os.path.exists(os.path.join(testcase, 'output.nq')): - output1 = 'output.nq' - output_format1 = 'application/n-quads' - else: - error = 'true' - - writer.writerow([testcase, title, description, spec, mapping_file, - input_format1, input_format2, input_format3, - output_format1, output_format2, output_format3, - input1, input2, input3, output1, output2, - output3, error]) - lines = [] - # Title and description - lines.append(f'## {testcase}\n\n') - lines.append(f'**Title**: {title}\n\n') - lines.append(f'**Description**: {description}\n\n') - if error == 'true': - error_html = 'Yes' - else: - error_html = 'No' - lines.append(f'**Error expected?** {error_html}\n\n') - - # Input - inputCount = '' - - for index, i in enumerate([input1, input2, input3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - input_html = f'**Input{inputCount}**\n `{i}`\n\n' - - lines.append(input_html) - inputCount = f' {index + 1}' - - # Mapping - with open(os.path.join(testcase, mapping_file)) as f: - mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' - lines.append(mapping_html) - - # Output - outputCount = '' - if output2 or output3: - outputCount = ' 1' - - for index, i in enumerate([output1, output2, output3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - output_html = f'**Output{outputCount}**\n `{i}`\n\n' - - lines.append(output_html) - outputCount = f' {index + 2}' - - - with open(os.path.join(testcase, 'README.md'), 'w') as f: - f.writelines(lines) - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('Usage: ./make-metadata.py ') - sys.exit(1) - main(sys.argv[1]) diff --git a/src/test/resources/rml-lv/manifest.rml.ttl b/src/test/resources/rml-lv/manifest.rml.ttl deleted file mode 100644 index 7e92bc2..0000000 --- a/src/test/resources/rml-lv/manifest.rml.ttl +++ /dev/null @@ -1,267 +0,0 @@ -@prefix xsd: . -@prefix dcterms: . -@prefix rml: . -@prefix rmltest: . -@prefix test: . -@base . - -# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/lv/test/ - -_:source - rml:source [ - a rml:RelativePathSource ; - rml:path "metadata.csv" ; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; -. - -<#TriplesMapTestcase> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:reference "ID"; - rml:class test:TestCase; - ]; - - rml:predicateObjectMap [ - rml:predicate dcterms:identifier; - rml:objectMap [ - rml:reference "ID"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:hasError; - rml:objectMap [ - rml:reference "error"; - rml:datatype xsd:boolean; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:mappingDocument; - rml:objectMap [ - rml:reference "mapping"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; -. - -<#TriplesMapInput1> - a rml:TriplesMap; - - rml:logicalSource _:source ; - - rml:subjectMap [ - rml:template "{ID}/input/{input1}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format1"; - ]; - ]; -. - -<#TriplesMapInput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input2}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format2"; - ]; - ]; -. - -<#TriplesMapInput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input3}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format3"; - ]; - ]; -. - -<#TriplesMapOutput1> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output1}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format1"; - ]; - ]; -. - -<#TriplesMapOutput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output2}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format2"; - ]; - ]; -. - -<#TriplesMapOutput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output3}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format3"; - ]; - ]; -. - diff --git a/src/test/resources/rml-lv/manifest.ttl b/src/test/resources/rml-lv/manifest.ttl deleted file mode 100644 index 3d36a93..0000000 --- a/src/test/resources/rml-lv/manifest.ttl +++ /dev/null @@ -1,396 +0,0 @@ - "people.csv" . - "text/csv" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "true"^^ . - "RMLLVTC0008c" . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0001d" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0004b" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0000a" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "false"^^ . - "RMLLVTC0006c" . - . - . - "mapping.ttl" . - . - . - . - "people.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "false"^^ . - "RMLLVTC0002b" . - . - "mapping.ttl" . - . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "false"^^ . - "RMLLVTC0004c" . - . - "mapping.ttl" . - . - . - "people.csv" . - "text/csv" . - . - "false"^^ . - "RMLLVTC0007a" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0000b" . - . - "mapping.ttl" . - . - . - "people.json" . - "application/json" . - . - "people2.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "false"^^ . - "RMLLVTC0006d" . - . - . - "mapping.ttl" . - . - . - . - "output.nq" . - "application/n-quads" . - . - "false"^^ . - "RMLLVTC0002c" . - . - "mapping.ttl" . - . - . - "true"^^ . - "RMLLVTC0005a" . - "mapping.ttl" . - . - . - "people.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "false"^^ . - "RMLLVTC0004d" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0007b" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "false"^^ . - "RMLLVTC0000c" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0003a" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "false"^^ . - "RMLLVTC0006e" . - . - . - "mapping.ttl" . - . - . - . - "output.nq" . - "application/n-quads" . - . - "people.csv" . - "text/csv" . - . - "true"^^ . - "RMLLVTC0005b" . - "mapping.ttl" . - . - . - "people.json" . - "application/json" . - . - "false"^^ . - "RMLLVTC0001a" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0007c" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "people.csv" . - "text/csv" . - . - "false"^^ . - "RMLLVTC0003b" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "people2.csv" . - "text/csv" . - . - "people.json" . - "application/json" . - . - "false"^^ . - "RMLLVTC0006f" . - . - "mapping.ttl" . - . - . - . - "people.csv" . - "text/csv" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "true"^^ . - "RMLLVTC0005c" . - "mapping.ttl" . - . - . - "true"^^ . - "RMLLVTC0008a" . - "mapping.ttl" . - . - "false"^^ . - "RMLLVTC0001b" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "people.csv" . - "text/csv" . - . - "people.json" . - "application/json" . - . - "false"^^ . - "RMLLVTC0003c" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0006a" . - . - "mapping.ttl" . - . - . - . - "output.nq" . - "application/n-quads" . - . - "people2.csv" . - "text/csv" . - . - "people.csv" . - "text/csv" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "true"^^ . - "RMLLVTC0008b" . - "mapping.ttl" . - . - . - . - "people.csv" . - "text/csv" . - . - "false"^^ . - "RMLLVTC0001c" . - . - "mapping.ttl" . - . - . - "false"^^ . - "RMLLVTC0004a" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "people.csv" . - "text/csv" . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . - "people.json" . - "application/json" . - . - "people.json" . - "application/json" . - . - "output.nq" . - "application/n-quads" . - . - "false"^^ . - "RMLLVTC0006b" . - . - "mapping.ttl" . - . - . - . - "false"^^ . - "RMLLVTC0002a" . - . - "mapping.ttl" . - . - . - "output.nq" . - "application/n-quads" . - . - "output.nq" . - "application/n-quads" . - . diff --git a/src/test/resources/rml-lv/metadata.csv b/src/test/resources/rml-lv/metadata.csv deleted file mode 100644 index bff25c5..0000000 --- a/src/test/resources/rml-lv/metadata.csv +++ /dev/null @@ -1,33 +0,0 @@ -ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error -RMLLVTC0000a,Logical view on JSON source,Test a view on a hierarchical source,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0000b,Logical view on CSV source,Test a view on a tabular source,http://w3id.org/rml/lv/,mapping.ttl,text/csv,,,application/n-quads,,,people.csv,,,output.nq,,,false -RMLLVTC0000c,Logical View on Logical View,Test a view on a logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0001a,Expression Field: Reference,Test a reference in an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0001b,Expression Field: Template,Test a template in an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0001c,Expression Field: Constant,Test a constant expression in an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0001d,Expression Field Siblings,Test multiple expression fields with the same parent,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0002a,Iterable Field,Test a nested field construction: iterable field with expression field as child,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0002b,Iterable Field with Multiple Children,Test a nested field construction: iterable field with mulitple expression fields as children,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0002c,Nested Iterable Fields,Test a nested field construction: iterable field with an iterable field as child,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0003a,Index Key: #,Test a reference to the index key #,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0003b,Index Key: Iterable Field,Test a reference to the index key of an iterable field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0003c,Index Key: Expression field,Test a reference to the index key of an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0004a,Natural Datatype: Index #,Test the natural datatype mapping for the index #,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0004b,Natural Datatype: Index Expression Field,Test the natural datatype mapping for the index of an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0004c,Natural Datatype: Index Iterable Field,Test the natural datatype mapping for the index of an iterable field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0004d,Natural Datatype: Record Expression Field,Test the natural datatype mapping for a record of an expression field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0005a,Referencing a Non-Existing Key,Test a reference to a non-existing key,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true -RMLLVTC0005b,Referencing the Record Key ,Test a reference to the record key ,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true -RMLLVTC0005c,Referencing the Record Key of an Iterable Field,Test a reference to the record key of an iterable field,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true -RMLLVTC0006a,Left Join,Test a left join,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,application/n-quads,,,people.json,people.csv,,output.nq,,,false -RMLLVTC0006b,Inner Join,Test an inner join,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,application/n-quads,,,people.json,people.csv,,output.nq,,,false -RMLLVTC0006c,Two Left Joins,Test two left joins in one logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,text/csv,application/n-quads,,,people.json,people.csv,people2.csv,output.nq,,,false -RMLLVTC0006d,Inner Join and Left Join,Test an inner join and a left join in one logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,text/csv,application/n-quads,,,people.json,people.csv,people2.csv,output.nq,,,false -RMLLVTC0006e,Two Inner Joins,Test two left joins in one logical view,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,text/csv,application/n-quads,,,people.json,people.csv,people2.csv,output.nq,,,false -RMLLVTC0006f,Index Key of Field in Join,Test references to indexes of fields from a join,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,application/n-quads,,,people.json,people.csv,,output.nq,,,false -RMLLVTC0007a,Change Reference Formulations: CSV including JSON array,Test a change of reference formulations: csv source including json array,http://w3id.org/rml/lv/,mapping.ttl,text/csv,,,application/n-quads,,,people.csv,,,output.nq,,,false -RMLLVTC0007b,Change Reference Formulations: CSV including JSON object,Test a change of reference formulations: csv source including json object,http://w3id.org/rml/lv/,mapping.ttl,text/csv,,,application/n-quads,,,people.csv,,,output.nq,,,false -RMLLVTC0007c,Change Reference Formulations: JSON including CSV,Test a change of reference formulations: json source including csv data,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,application/n-quads,,,people.json,,,output.nq,,,false -RMLLVTC0008a,Cycle: Abstract Logical Source,Test a cycle in the abstract logical source of a logical view,http://w3id.org/rml/lv/,mapping.ttl,,,,,,,,,,,,,true -RMLLVTC0008b,Cycle: Joins,Test a cycle in two joins of two logical views,http://w3id.org/rml/lv/,mapping.ttl,application/json,text/csv,,,,,people.json,people.csv,,,,,true -RMLLVTC0008c,Cycle: Self-Join,Test a cycle in a join of a logical view: self-join,http://w3id.org/rml/lv/,mapping.ttl,application/json,,,,,,people.json,,,,,,true diff --git a/src/test/resources/rml-lv/section/abstract.md b/src/test/resources/rml-lv/section/abstract.md deleted file mode 100644 index 97a2cd6..0000000 --- a/src/test/resources/rml-lv/section/abstract.md +++ /dev/null @@ -1 +0,0 @@ -This document defines the RML-LV test cases to the determine the RML-LV specification conformance of tools. diff --git a/src/test/resources/rml-lv/section/data-model.md b/src/test/resources/rml-lv/section/data-model.md deleted file mode 100644 index f4c3ad6..0000000 --- a/src/test/resources/rml-lv/section/data-model.md +++ /dev/null @@ -1,12 +0,0 @@ -# Data model - -The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). -Each `test:Testcase` as the following properties: - -- `dcterms:identifier`: unique ID of the test case. -- `rmltest:hasError`: if an error of the RML Processor is expected or not. -- `rmltest:input`: One or more input data of the test case. -- `rmltest:output`: One or more output data of the test case. -- `rmltest:inputFormat`: the input data format. -- `rmltest:outputFormat`: the output data format. -- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-lv/section/introduction.md b/src/test/resources/rml-lv/section/introduction.md deleted file mode 100644 index f19d17b..0000000 --- a/src/test/resources/rml-lv/section/introduction.md +++ /dev/null @@ -1,4 +0,0 @@ -# Introduction - -This document defines the RML-LV test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-LV specification. diff --git a/src/test/resources/rml-lv/section/test-cases.md b/src/test/resources/rml-lv/section/test-cases.md deleted file mode 100644 index 4efe6d7..0000000 --- a/src/test/resources/rml-lv/section/test-cases.md +++ /dev/null @@ -1,10 +0,0 @@ -# Test cases - -This section describes the RML-LV test cases. These descriptions are also available as RDF. -The files are available on [GitHub](https://github.com/kg-construct/rml-lv/tree/main/test-cases) in the folder `test-cases`. -Each test case is contained in a single folder, containing three types of files: - - - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. - - One file with the RML rules, called `mapping.ttl`, in the Turtle format. - - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. - diff --git a/src/test/resources/rml-star/RMLSTARTC001a/README.md b/src/test/resources/rml-star/RMLSTARTC001a/README.md deleted file mode 100644 index 29c5d46..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001a/README.md +++ /dev/null @@ -1,67 +0,0 @@ -## RMLSTARTC001a - -**Title**: quoted triple in subject, one source, blank node in quoted subject - -**Description**: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file - -**Error expected?** No - -**Input** -``` -c1,c2,c3 -b0,o,ABC - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:reference "c1" ; - rml:termType rml:BlankNode - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c3" - ] - ] . - -``` - -**Output** -``` -_:b0 . -<< _:b0 >> "ABC" . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC001a/data.csv b/src/test/resources/rml-star/RMLSTARTC001a/data.csv deleted file mode 100644 index 53b4c42..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -b0,o,ABC diff --git a/src/test/resources/rml-star/RMLSTARTC001a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC001a/mapping.ttl deleted file mode 100644 index 63ec233..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001a/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:reference "c1" ; - rml:termType rml:BlankNode - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c3" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC001a/output.nt b/src/test/resources/rml-star/RMLSTARTC001a/output.nt deleted file mode 100644 index 2d94448..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001a/output.nt +++ /dev/null @@ -1,2 +0,0 @@ -_:b0 . -<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/RMLSTARTC001b/README.md b/src/test/resources/rml-star/RMLSTARTC001b/README.md deleted file mode 100644 index 2741ea3..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001b/README.md +++ /dev/null @@ -1,79 +0,0 @@ -## RMLSTARTC001b - -**Title**: quoted triple in subject, two sources, blank node in quoted subject - -**Description**: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3 -b0,o,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2 -ABC,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:reference "c1-1" ; - rml:termType rml:BlankNode - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1" - ] - ] . - -``` - -**Output** -``` -_:b0 . -<< _:b0 >> "ABC" . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC001b/data1.csv b/src/test/resources/rml-star/RMLSTARTC001b/data1.csv deleted file mode 100644 index f6cfd6e..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -b0,o,1 diff --git a/src/test/resources/rml-star/RMLSTARTC001b/data2.csv b/src/test/resources/rml-star/RMLSTARTC001b/data2.csv deleted file mode 100644 index 7de02b7..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2 -ABC,1 diff --git a/src/test/resources/rml-star/RMLSTARTC001b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC001b/mapping.ttl deleted file mode 100644 index e9826ef..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001b/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:reference "c1-1" ; - rml:termType rml:BlankNode - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC001b/output.nt b/src/test/resources/rml-star/RMLSTARTC001b/output.nt deleted file mode 100644 index 2d94448..0000000 --- a/src/test/resources/rml-star/RMLSTARTC001b/output.nt +++ /dev/null @@ -1,2 +0,0 @@ -_:b0 . -<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/RMLSTARTC002a/README.md b/src/test/resources/rml-star/RMLSTARTC002a/README.md deleted file mode 100644 index 34a26c8..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002a/README.md +++ /dev/null @@ -1,69 +0,0 @@ -## RMLSTARTC002a - -**Title**: quoted triple in subject, one source, blank node in quoted object - -**Description**: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file - -**Error expected?** No - -**Input** -``` -c1,c2,c3 -s,b1,456 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix xsd: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:reference "c2" ; - rml:termType rml:BlankNode - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c3"; - rml:datatype xsd:integer - ] - ] . - -``` - -**Output** -``` - _:b1 . -<< _:b1 >> "456"^^ . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC002a/data.csv b/src/test/resources/rml-star/RMLSTARTC002a/data.csv deleted file mode 100644 index 9ddd32a..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -s,b1,456 diff --git a/src/test/resources/rml-star/RMLSTARTC002a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC002a/mapping.ttl deleted file mode 100644 index c301bf7..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002a/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix xsd: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:reference "c2" ; - rml:termType rml:BlankNode - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c3"; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC002a/output.nt b/src/test/resources/rml-star/RMLSTARTC002a/output.nt deleted file mode 100644 index 2dc337a..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002a/output.nt +++ /dev/null @@ -1,2 +0,0 @@ - _:b1 . -<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC002b/README.md b/src/test/resources/rml-star/RMLSTARTC002b/README.md deleted file mode 100644 index 6493c89..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002b/README.md +++ /dev/null @@ -1,81 +0,0 @@ -## RMLSTARTC002b - -**Title**: quoted triple in subject, two sources, blank node in quoted object - -**Description**: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3 -s,b1,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2 -456,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix xsd: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:reference "c1-2" ; - rml:termType rml:BlankNode - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1"; - rml:datatype xsd:integer - ] - ] . - -``` - -**Output** -``` - _:b1 . -<< _:b1 >> "456"^^ . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC002b/data1.csv b/src/test/resources/rml-star/RMLSTARTC002b/data1.csv deleted file mode 100644 index bd18828..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s,b1,1 diff --git a/src/test/resources/rml-star/RMLSTARTC002b/data2.csv b/src/test/resources/rml-star/RMLSTARTC002b/data2.csv deleted file mode 100644 index 0335530..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2 -456,1 diff --git a/src/test/resources/rml-star/RMLSTARTC002b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC002b/mapping.ttl deleted file mode 100644 index 372d0f9..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002b/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix xsd: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:reference "c1-2" ; - rml:termType rml:BlankNode - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1"; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC002b/output.nt b/src/test/resources/rml-star/RMLSTARTC002b/output.nt deleted file mode 100644 index 2dc337a..0000000 --- a/src/test/resources/rml-star/RMLSTARTC002b/output.nt +++ /dev/null @@ -1,2 +0,0 @@ - _:b1 . -<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC003a/README.md b/src/test/resources/rml-star/RMLSTARTC003a/README.md deleted file mode 100644 index f45d6be..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003a/README.md +++ /dev/null @@ -1,86 +0,0 @@ -## RMLSTARTC003a - -**Title**: two-level quoted triple in subject, one source - -**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file - -**Error expected?** No - -**Input** -``` -c1,c2,c3,c4 -s,o,z,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c4" ; - rml:datatype xsd:integer - ] - ] . - -``` - -**Output** -``` - . -<< >> . -<< << >> >> "1"^^ . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC003a/data.csv b/src/test/resources/rml-star/RMLSTARTC003a/data.csv deleted file mode 100644 index 3d2bf5e..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -s,o,z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC003a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC003a/mapping.ttl deleted file mode 100644 index 4d46169..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003a/mapping.ttl +++ /dev/null @@ -1,58 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c4" ; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC003a/output.nt b/src/test/resources/rml-star/RMLSTARTC003a/output.nt deleted file mode 100644 index d6a50cb..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003a/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . -<< >> . -<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC003b/README.md b/src/test/resources/rml-star/RMLSTARTC003b/README.md deleted file mode 100644 index 4b162d6..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003b/README.md +++ /dev/null @@ -1,98 +0,0 @@ -## RMLSTARTC003b - -**Title**: two-level quoted triple in subject, two sources - -**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3,c1-4 -s,o,z,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2 -1,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c1-3}" - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-4" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1" ; - rml:datatype xsd:integer - ] - ] . - -``` - -**Output** -``` - . -<< >> . -<< << >> >> "1"^^ . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC003b/data1.csv b/src/test/resources/rml-star/RMLSTARTC003b/data1.csv deleted file mode 100644 index 3999e70..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3,c1-4 -s,o,z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC003b/data2.csv b/src/test/resources/rml-star/RMLSTARTC003b/data2.csv deleted file mode 100644 index 16d66b2..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2 -1,1 diff --git a/src/test/resources/rml-star/RMLSTARTC003b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC003b/mapping.ttl deleted file mode 100644 index edab9cc..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003b/mapping.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c1-3}" - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-4" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1" ; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC003b/output.nt b/src/test/resources/rml-star/RMLSTARTC003b/output.nt deleted file mode 100644 index d6a50cb..0000000 --- a/src/test/resources/rml-star/RMLSTARTC003b/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . -<< >> . -<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/RMLSTARTC004a/README.md b/src/test/resources/rml-star/RMLSTARTC004a/README.md deleted file mode 100644 index 267673c..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004a/README.md +++ /dev/null @@ -1,85 +0,0 @@ -## RMLSTARTC004a - -**Title**: two-level quoted triple in subject and object, one source - -**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file - -**Error expected?** No - -**Input** -``` -c1,c2,c3,c4 -s,o,a,z - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -``` - -**Output** -``` - . - << >> . -<< << >> >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC004a/data.csv b/src/test/resources/rml-star/RMLSTARTC004a/data.csv deleted file mode 100644 index 2cfbe0f..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -s,o,a,z diff --git a/src/test/resources/rml-star/RMLSTARTC004a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC004a/mapping.ttl deleted file mode 100644 index 06b3511..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004a/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC004a/output.nt b/src/test/resources/rml-star/RMLSTARTC004a/output.nt deleted file mode 100644 index 7a8d313..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004a/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . - << >> . -<< << >> >> . diff --git a/src/test/resources/rml-star/RMLSTARTC004b/README.md b/src/test/resources/rml-star/RMLSTARTC004b/README.md deleted file mode 100644 index 0e2b6c5..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004b/README.md +++ /dev/null @@ -1,97 +0,0 @@ -## RMLSTARTC004b - -**Title**: two-level quoted triple in subject and object, two sources - -**Description**: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3,c1-4 -s,o,a,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2 -z,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-4" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c2-1}" - ] - ] . - -``` - -**Output** -``` - . - << >> . -<< << >> >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC004b/data1.csv b/src/test/resources/rml-star/RMLSTARTC004b/data1.csv deleted file mode 100644 index 9734627..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3,c1-4 -s,o,a,1 diff --git a/src/test/resources/rml-star/RMLSTARTC004b/data2.csv b/src/test/resources/rml-star/RMLSTARTC004b/data2.csv deleted file mode 100644 index 0e26a38..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2 -z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC004b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC004b/mapping.ttl deleted file mode 100644 index 6ea4502..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004b/mapping.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-4" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c2-1}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC004b/output.nt b/src/test/resources/rml-star/RMLSTARTC004b/output.nt deleted file mode 100644 index 7a8d313..0000000 --- a/src/test/resources/rml-star/RMLSTARTC004b/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . - << >> . -<< << >> >> . diff --git a/src/test/resources/rml-star/RMLSTARTC005a/README.md b/src/test/resources/rml-star/RMLSTARTC005a/README.md deleted file mode 100644 index 3613648..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005a/README.md +++ /dev/null @@ -1,66 +0,0 @@ -## RMLSTARTC005a - -**Title**: non-asserted quoted triple in subject, one source - -**Description**: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file - -**Error expected?** No - -**Input** -``` -c1,c2,c3 -s,o,z - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . - -``` - -**Output** -``` -<< >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC005a/data.csv b/src/test/resources/rml-star/RMLSTARTC005a/data.csv deleted file mode 100644 index a4c3707..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -s,o,z diff --git a/src/test/resources/rml-star/RMLSTARTC005a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC005a/mapping.ttl deleted file mode 100644 index 9cfe140..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005a/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC005a/output.nt b/src/test/resources/rml-star/RMLSTARTC005a/output.nt deleted file mode 100644 index 7f2be99..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005a/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> . diff --git a/src/test/resources/rml-star/RMLSTARTC005b/README.md b/src/test/resources/rml-star/RMLSTARTC005b/README.md deleted file mode 100644 index 4cd0c9e..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005b/README.md +++ /dev/null @@ -1,78 +0,0 @@ -## RMLSTARTC005b - -**Title**: non-asserted quoted triple in subject, two sources - -**Description**: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3 -s,o,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2 -z,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:template "http://example/{c2-1}" - ] - ] . - -``` - -**Output** -``` -<< >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC005b/data1.csv b/src/test/resources/rml-star/RMLSTARTC005b/data1.csv deleted file mode 100644 index 9fe2369..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s,o,1 diff --git a/src/test/resources/rml-star/RMLSTARTC005b/data2.csv b/src/test/resources/rml-star/RMLSTARTC005b/data2.csv deleted file mode 100644 index 0e26a38..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2 -z,1 diff --git a/src/test/resources/rml-star/RMLSTARTC005b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC005b/mapping.ttl deleted file mode 100644 index 1b885da..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005b/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:template "http://example/{c2-1}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC005b/output.nt b/src/test/resources/rml-star/RMLSTARTC005b/output.nt deleted file mode 100644 index 7f2be99..0000000 --- a/src/test/resources/rml-star/RMLSTARTC005b/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> . diff --git a/src/test/resources/rml-star/RMLSTARTC006a/README.md b/src/test/resources/rml-star/RMLSTARTC006a/README.md deleted file mode 100644 index e8680bc..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006a/README.md +++ /dev/null @@ -1,66 +0,0 @@ -## RMLSTARTC006a - -**Title**: non-asserted quoted triple in object, one source - -**Description**: Tests the creation of a non-asserted quoted triple in the position of object with data from one file - -**Error expected?** No - -**Input** -``` -c1,c2,c3 -s,o,x - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . - -``` - -**Output** -``` - << >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC006a/data.csv b/src/test/resources/rml-star/RMLSTARTC006a/data.csv deleted file mode 100644 index 3ca6ac7..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -s,o,x diff --git a/src/test/resources/rml-star/RMLSTARTC006a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC006a/mapping.ttl deleted file mode 100644 index 5de699b..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006a/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC006a/output.nt b/src/test/resources/rml-star/RMLSTARTC006a/output.nt deleted file mode 100644 index 5aa2cb2..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006a/output.nt +++ /dev/null @@ -1 +0,0 @@ - << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC006b/README.md b/src/test/resources/rml-star/RMLSTARTC006b/README.md deleted file mode 100644 index 46aaa77..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006b/README.md +++ /dev/null @@ -1,78 +0,0 @@ -## RMLSTARTC006b - -**Title**: non-asserted quoted triple in object, two sources - -**Description**: Tests the creation of a non-asserted quoted triple in the position of object with data from two files - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3 -s,o,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2 -x,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ] - ] . - -``` - -**Output** -``` - << >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC006b/data1.csv b/src/test/resources/rml-star/RMLSTARTC006b/data1.csv deleted file mode 100644 index 9fe2369..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s,o,1 diff --git a/src/test/resources/rml-star/RMLSTARTC006b/data2.csv b/src/test/resources/rml-star/RMLSTARTC006b/data2.csv deleted file mode 100644 index a08b98a..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2 -x,1 diff --git a/src/test/resources/rml-star/RMLSTARTC006b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC006b/mapping.ttl deleted file mode 100644 index c1baf80..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006b/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC006b/output.nt b/src/test/resources/rml-star/RMLSTARTC006b/output.nt deleted file mode 100644 index 5aa2cb2..0000000 --- a/src/test/resources/rml-star/RMLSTARTC006b/output.nt +++ /dev/null @@ -1 +0,0 @@ - << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC007a/README.md b/src/test/resources/rml-star/RMLSTARTC007a/README.md deleted file mode 100644 index 6857003..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007a/README.md +++ /dev/null @@ -1,83 +0,0 @@ -## RMLSTARTC007a - -**Title**: non-asserted quoted triples in subject and object, one source - -**Description**: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file - -**Error expected?** No - -**Input** -``` -c1,c2,c3,c4 -s1,o1,s2,o2 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q; ; - rml:objectMap [ - rml:quotedTriplesMap :thirdTM - ] - ] . - -:thirdTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -``` - -**Output** -``` -<< >> << >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC007a/data.csv b/src/test/resources/rml-star/RMLSTARTC007a/data.csv deleted file mode 100644 index b054340..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -s1,o1,s2,o2 diff --git a/src/test/resources/rml-star/RMLSTARTC007a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC007a/mapping.ttl deleted file mode 100644 index 16a4cec..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007a/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q; ; - rml:objectMap [ - rml:quotedTriplesMap :thirdTM - ] - ] . - -:thirdTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC007a/output.nt b/src/test/resources/rml-star/RMLSTARTC007a/output.nt deleted file mode 100644 index 16b9420..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007a/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC007b/README.md b/src/test/resources/rml-star/RMLSTARTC007b/README.md deleted file mode 100644 index bfec08a..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007b/README.md +++ /dev/null @@ -1,95 +0,0 @@ -## RMLSTARTC007b - -**Title**: non-asserted quoted triples in subject and object, two sources - -**Description**: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3 -s1,o1,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2,c2-3 -s2,o2,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-3" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q; ; - rml:objectMap [ - rml:quotedTriplesMap :thirdTM - ] - ] . - -:thirdTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c2-2}" - ] - ] . - -``` - -**Output** -``` -<< >> << >> . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC007b/data1.csv b/src/test/resources/rml-star/RMLSTARTC007b/data1.csv deleted file mode 100644 index 57395e8..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s1,o1,1 diff --git a/src/test/resources/rml-star/RMLSTARTC007b/data2.csv b/src/test/resources/rml-star/RMLSTARTC007b/data2.csv deleted file mode 100644 index f65494b..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2,c2-3 -s2,o2,1 diff --git a/src/test/resources/rml-star/RMLSTARTC007b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC007b/mapping.ttl deleted file mode 100644 index 89ea007..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007b/mapping.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-3" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q; ; - rml:objectMap [ - rml:quotedTriplesMap :thirdTM - ] - ] . - -:thirdTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c2-2}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC007b/output.nt b/src/test/resources/rml-star/RMLSTARTC007b/output.nt deleted file mode 100644 index 16b9420..0000000 --- a/src/test/resources/rml-star/RMLSTARTC007b/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> << >> . diff --git a/src/test/resources/rml-star/RMLSTARTC008a/README.md b/src/test/resources/rml-star/RMLSTARTC008a/README.md deleted file mode 100644 index 3b47745..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008a/README.md +++ /dev/null @@ -1,151 +0,0 @@ -## RMLSTARTC008a - -**Title**: two-level non-asserted quoted triple in subject and object two-fold, one source - -**Description**: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source - -**Error expected?** No - -**Input** -``` -c1,c2,c3,c4,c5,c6,c7,c8 -s1,o1,s2,o2,s3,o3,s4,o4 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:elementaryTM1 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:firstJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM1 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q1; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM2 - ] - ] . - -:elementaryTM2 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -:centralJoinTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstJoinTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q2; - rml:objectMap [ - rml:quotedTriplesMap :secondJoinTM - ] - ] . - -:elementaryTM3 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c5}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p3 ; - rml:objectMap [ - rml:template "http://example/{c6}" - ] - ] . - -:secondJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM3 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q3; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM4 - ] - ] . - -:elementaryTM4 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c7}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p4 ; - rml:objectMap [ - rml:template "http://example/{c8}" - ] - ] . - -``` - -**Output** -``` -<<<<>><<>>>><<<<>><<>>>>. - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC008a/data.csv b/src/test/resources/rml-star/RMLSTARTC008a/data.csv deleted file mode 100644 index 48f5186..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4,c5,c6,c7,c8 -s1,o1,s2,o2,s3,o3,s4,o4 diff --git a/src/test/resources/rml-star/RMLSTARTC008a/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC008a/mapping.ttl deleted file mode 100644 index 9144682..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008a/mapping.ttl +++ /dev/null @@ -1,125 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:elementaryTM1 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:firstJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM1 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q1; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM2 - ] - ] . - -:elementaryTM2 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -:centralJoinTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstJoinTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q2; - rml:objectMap [ - rml:quotedTriplesMap :secondJoinTM - ] - ] . - -:elementaryTM3 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c5}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p3 ; - rml:objectMap [ - rml:template "http://example/{c6}" - ] - ] . - -:secondJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM3 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q3; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM4 - ] - ] . - -:elementaryTM4 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c7}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p4 ; - rml:objectMap [ - rml:template "http://example/{c8}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC008a/output.nt b/src/test/resources/rml-star/RMLSTARTC008a/output.nt deleted file mode 100644 index fe36da8..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008a/output.nt +++ /dev/null @@ -1 +0,0 @@ -<<<<>><<>>>><<<<>><<>>>>. diff --git a/src/test/resources/rml-star/RMLSTARTC008b/README.md b/src/test/resources/rml-star/RMLSTARTC008b/README.md deleted file mode 100644 index fa79a53..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008b/README.md +++ /dev/null @@ -1,163 +0,0 @@ -## RMLSTARTC008b - -**Title**: two-level non-asserted quoted triple in subject and object two-fold, two sources - -**Description**: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources - -**Error expected?** No - -**Input** -``` -c1-1,c1-2,c1-3,c1-4,c1-5 -s1,o1,s2,o2,1 - -``` - -**Input 1** -``` -**Input 1** -c2-1,c2-2,c2-3,c2-4,c2-5 -s3,o3,s4,o4,1 - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:elementaryTM1 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:firstJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM1 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q1; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM2 - ] - ] . - -:elementaryTM2 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c1-4}" - ] - ] . - -:centralJoinTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstJoinTM ; - rml:joinCondition [ - rml:child "c2-5" ; - rml:parent "c1-5" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q2; - rml:objectMap [ - rml:quotedTriplesMap :secondJoinTM - ] - ] . - -:elementaryTM3 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p3 ; - rml:objectMap [ - rml:template "http://example/{c2-2}" - ] - ] . - -:secondJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM3 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q3; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM4 - ] - ] . - -:elementaryTM4 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p4 ; - rml:objectMap [ - rml:template "http://example/{c2-4}" - ] - ] . - -``` - -**Output** -``` -<<<<>><<>>>><<<<>><<>>>>. - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC008b/data1.csv b/src/test/resources/rml-star/RMLSTARTC008b/data1.csv deleted file mode 100644 index 1f57ab5..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3,c1-4,c1-5 -s1,o1,s2,o2,1 diff --git a/src/test/resources/rml-star/RMLSTARTC008b/data2.csv b/src/test/resources/rml-star/RMLSTARTC008b/data2.csv deleted file mode 100644 index ffa3f9c..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008b/data2.csv +++ /dev/null @@ -1,3 +0,0 @@ -**Input 1** -c2-1,c2-2,c2-3,c2-4,c2-5 -s3,o3,s4,o4,1 diff --git a/src/test/resources/rml-star/RMLSTARTC008b/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC008b/mapping.ttl deleted file mode 100644 index ee75362..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008b/mapping.ttl +++ /dev/null @@ -1,129 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:elementaryTM1 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:firstJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM1 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q1; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM2 - ] - ] . - -:elementaryTM2 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c1-4}" - ] - ] . - -:centralJoinTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstJoinTM ; - rml:joinCondition [ - rml:child "c2-5" ; - rml:parent "c1-5" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q2; - rml:objectMap [ - rml:quotedTriplesMap :secondJoinTM - ] - ] . - -:elementaryTM3 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p3 ; - rml:objectMap [ - rml:template "http://example/{c2-2}" - ] - ] . - -:secondJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM3 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q3; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM4 - ] - ] . - -:elementaryTM4 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p4 ; - rml:objectMap [ - rml:template "http://example/{c2-4}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC008b/output.nt b/src/test/resources/rml-star/RMLSTARTC008b/output.nt deleted file mode 100644 index fe36da8..0000000 --- a/src/test/resources/rml-star/RMLSTARTC008b/output.nt +++ /dev/null @@ -1 +0,0 @@ -<<<<>><<>>>><<<<>><<>>>>. diff --git a/src/test/resources/rml-star/RMLSTARTC009/README.md b/src/test/resources/rml-star/RMLSTARTC009/README.md deleted file mode 100644 index b6c8fb6..0000000 --- a/src/test/resources/rml-star/RMLSTARTC009/README.md +++ /dev/null @@ -1,59 +0,0 @@ -## RMLSTARTC009 - -**Title**: Quoted triples as predicate map - -**Description**: Test the use quoted triples for generating the predicates, which is not possible - -**Error expected?** Yes - -**Input** -``` -c1,c2,c3,c4 -a,s,o,z - -``` - -**Mapping** -``` -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:quotedTriplesMap :secondTM ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -:secondTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC009/data.csv b/src/test/resources/rml-star/RMLSTARTC009/data.csv deleted file mode 100644 index 9e93cb6..0000000 --- a/src/test/resources/rml-star/RMLSTARTC009/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -a,s,o,z diff --git a/src/test/resources/rml-star/RMLSTARTC009/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC009/mapping.ttl deleted file mode 100644 index 311477d..0000000 --- a/src/test/resources/rml-star/RMLSTARTC009/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:quotedTriplesMap :secondTM ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -:secondTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . diff --git a/src/test/resources/rml-star/RMLSTARTC010/README.md b/src/test/resources/rml-star/RMLSTARTC010/README.md deleted file mode 100644 index 5c7fe8e..0000000 --- a/src/test/resources/rml-star/RMLSTARTC010/README.md +++ /dev/null @@ -1,57 +0,0 @@ -## RMLSTARTC010 - -**Title**: Quoted triples as object without object map - -**Description**: Test the use quoted triples for generating the object maps but without defining the object map, which is not possible - -**Error expected?** Yes - -**Input** -``` -c1,c2,c3,c4 -a,s,o,z - -``` - -**Mapping** -``` -@prefix rml: . -@prefix rdf: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; - rml:quotedTriplesMap :secondTM ; - ] . - -:secondTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . - -``` - diff --git a/src/test/resources/rml-star/RMLSTARTC010/data.csv b/src/test/resources/rml-star/RMLSTARTC010/data.csv deleted file mode 100644 index 9e93cb6..0000000 --- a/src/test/resources/rml-star/RMLSTARTC010/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -a,s,o,z diff --git a/src/test/resources/rml-star/RMLSTARTC010/mapping.ttl b/src/test/resources/rml-star/RMLSTARTC010/mapping.ttl deleted file mode 100644 index 4896029..0000000 --- a/src/test/resources/rml-star/RMLSTARTC010/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; - rml:quotedTriplesMap :secondTM ; - ] . - -:secondTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . diff --git a/src/test/resources/rml-star/config.js b/src/test/resources/rml-star/config.js deleted file mode 100644 index a967e7c..0000000 --- a/src/test/resources/rml-star/config.js +++ /dev/null @@ -1,72 +0,0 @@ -async function loadTurtle() { - //this is the function you call in 'preProcess', to load the highlighter - const worker = await new Promise(resolve => { - require(["core/worker"], ({ worker }) => resolve(worker)); - }); - const action = "highlight-load-lang"; - const langURL = - "https://cdn.jsdelivr.net/gh/redmer/highlightjs-turtle/src/languages/turtle.js"; - const propName = "hljsDefineTurtle"; // This funtion is defined in the highlighter being loaded - const lang = "turtle"; // this is the class you use to identify the language - worker.postMessage({ action, langURL, propName, lang }); - return new Promise(resolve => { - worker.addEventListener("message", function listener({ data }) { - const { action: responseAction, lang: responseLang } = data; - if (responseAction === action && responseLang === lang) { - worker.removeEventListener("message", listener); - resolve(); - } - }); - }); -} - -var respecConfig = { - // check https://respec.org/docs/ for the meaning of these keys - preProcess: [loadTurtle], - authors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - edDraftURI: "https://w3id.org/rml/star/test-cases/", - editors: [ - { - name: "Dylan Van Assche", - url: "https://dylanvanassche.be", - company: "IDLab – Ghent University – imec", - orcid: "0000-0002-7195-9935", - companyURL: "https://knows.idlab.ugent.be/" - } - ], - formerEditors: [ - ], - github: "https://github.com/kg-construct/rml-io", - license: "w3c-software-doc", - localBiblio: { - "RML-Core": { - title: "RML-Core", - href: "https://w3id.org/rml/core/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "07 August 2024", - }, - "RML-IO": { - title: "RML-IO", - href: "https://w3id.org/rml/io/spec", - status: "Draft Community Group Report", - publisher: "W3C", - date: "12 March 2024", - }, - }, - otherLinks: [], - shortName: "RML-Star-Testcases", - specStatus: "CG-DRAFT", - // W3C config - copyrightStart: "2024", - doJsonLd: true, - group: "kg-construct", -}; diff --git a/src/test/resources/rml-star/descriptions.csv b/src/test/resources/rml-star/descriptions.csv deleted file mode 100644 index 6906326..0000000 --- a/src/test/resources/rml-star/descriptions.csv +++ /dev/null @@ -1,19 +0,0 @@ -RML id,title,purpose,part of spec,data format,ref. formulation,error expected?,input file 1,input file 2,input file 3,comment -RMLSTARTC001a,"quoted triple in subject, one source, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, -RMLSTARTC001b,"quoted triple in subject, two sources, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC002a,"quoted triple in subject, one source, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, -RMLSTARTC002b,"quoted triple in subject, two sources, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC003a,"two-level quoted triple in subject, one source",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file,,CSV,CSV,no,data.csv,,, -RMLSTARTC003b,"two-level quoted triple in subject, two sources",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC004a,"two-level quoted triple in subject and object, one source","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file",,CSV,CSV,no,data.csv,,, -RMLSTARTC004b,"two-level quoted triple in subject and object, two sources","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources",,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC005a,"non-asserted quoted triple in subject, one source",Tests the creation of a non-asserted quoted triple in the position of subject with data from one file,,CSV,CSV,no,data.csv,,, -RMLSTARTC005b,"non-asserted quoted triple in subject, two sources",Tests the creation of a non-asserted quoted triple in the position of subject with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC006a,"non-asserted quoted triple in object, one source",Tests the creation of a non-asserted quoted triple in the position of object with data from one file,,CSV,CSV,no,data.csv,,, -RMLSTARTC006b,"non-asserted quoted triple in object, two sources",Tests the creation of a non-asserted quoted triple in the position of object with data from two files,,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC007a,"non-asserted quoted triples in subject and object, one source","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file",,CSV,CSV,no,data.csv,,, -RMLSTARTC007b,"non-asserted quoted triples in subject and object, two sources","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources",,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC008a,"two-level non-asserted quoted triple in subject and object two-fold, one source","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source",,CSV,CSV,no,data.csv,,, -RMLSTARTC008b,"two-level non-asserted quoted triple in subject and object two-fold, two sources","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources",,CSV,CSV,no,data1.csv,data2.csv,, -RMLSTARTC009,"Quoted triples as predicate map","Test the use quoted triples for generating the predicates, which is not possible",,CSV,CSV,yes,data.csv,,, -RMLSTARTC010,"Quoted triples as object without object map","Test the use quoted triples for generating the object maps but without defining the object map, which is not possible",,CSV,CSV,yes,data.csv,,, \ No newline at end of file diff --git a/src/test/resources/rml-star/dev.html b/src/test/resources/rml-star/dev.html deleted file mode 100644 index 1a97616..0000000 --- a/src/test/resources/rml-star/dev.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - RML-Star: Test Cases - - - - - - - - - - -
- -
- -
- -
- -
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - diff --git a/src/test/resources/rml-star/docs/20250130/index.html b/src/test/resources/rml-star/docs/20250130/index.html deleted file mode 100644 index d764af7..0000000 --- a/src/test/resources/rml-star/docs/20250130/index.html +++ /dev/null @@ -1,1895 +0,0 @@ - - - - - - -RML-Star: Test Cases - - - - - - - - - - - - - - -
- -

RML-Star: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Star-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Star test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTARTC001a

-

Title: quoted triple in subject, one source, blank node in quoted subject

-

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-b0,o,ABC
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:reference "c1" ;
-        rml:termType rml:BlankNode
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c3"
-        ]
-    ] .
-
-

Output

-
_:b0 <http://example/p> <http://example/o> .
-<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
-
-
-

5. RMLSTARTC001b

-

Title: quoted triple in subject, two sources, blank node in quoted subject

-

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-b0,o,1
-
-

Input 1

-
c2-1,c2-2
-ABC,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:reference "c1-1" ;
-        rml:termType rml:BlankNode
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM ;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-3" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1"
-        ]
-    ] .
-
-

Output

-
_:b0 <http://example/p> <http://example/o> .
-<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
-
-
-

6. RMLSTARTC002a

-

Title: quoted triple in subject, one source, blank node in quoted object

-

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,b1,456
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:reference "c2" ;
-            rml:termType rml:BlankNode
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c3";
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> _:b1 .
-<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

7. RMLSTARTC002b

-

Title: quoted triple in subject, two sources, blank node in quoted object

-

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,b1,1
-
-

Input 1

-
c2-1,c2-2
-456,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:reference "c1-2" ;
-            rml:termType rml:BlankNode
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM ;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-3" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1";
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> _:b1 .
-<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLSTARTC003a

-

Title: two-level quoted triple in subject, one source

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s,o,z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c3}"
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c4" ;
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
-<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

9. RMLSTARTC003b

-

Title: two-level quoted triple in subject, two sources

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4
-s,o,z,1
-
-

Input 1

-
c2-1,c2-2
-1,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c1-3}"
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-4" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1" ;
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
-<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

10. RMLSTARTC004a

-

Title: two-level quoted triple in subject and object, one source

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s,o,a,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
-<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
-
-
-

11. RMLSTARTC004b

-

Title: two-level quoted triple in subject and object, two sources

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4
-s,o,a,1
-
-

Input 1

-
c2-1,c2-2
-z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-4" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c2-1}"
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
-<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
-
-
-

12. RMLSTARTC005a

-

Title: non-asserted quoted triple in subject, one source

-

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,o,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:template "http://example/{c3}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
-
-
-

13. RMLSTARTC005b

-

Title: non-asserted quoted triple in subject, two sources

-

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,o,1
-
-

Input 1

-
c2-1,c2-2
-z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-2" ;
-              rml:parent "c1-3" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:template "http://example/{c2-1}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
-
-
-

14. RMLSTARTC006a

-

Title: non-asserted quoted triple in object, one source

-

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,o,x
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-

Output

-
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
-
-
-

15. RMLSTARTC006b

-

Title: non-asserted quoted triple in object, two sources

-

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,o,1
-
-

Input 1

-
c2-1,c2-2
-x,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-2" ;
-              rml:parent "c1-3" ;
-            ];
-        ]
-    ] .
-
-

Output

-
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
-
-
-

16. RMLSTARTC007a

-

Title: non-asserted quoted triples in subject and object, one source

-

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s1,o1,s2,o2
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :thirdTM
-        ]
-    ] .
-
-:thirdTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
-
-
-

17. RMLSTARTC007b

-

Title: non-asserted quoted triples in subject and object, two sources

-

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s1,o1,1
-
-

Input 1

-
c2-1,c2-2,c2-3
-s2,o2,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-3" ;
-              rml:parent "c1-3" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :thirdTM
-        ]
-    ] .
-
-:thirdTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-2}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
-
-
-

18. RMLSTARTC008a

-

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

-

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

-

Error expected? No

-

Input

-
c1,c2,c3,c4,c5,c6,c7,c8
-s1,o1,s2,o2,s3,o3,s4,o4
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:elementaryTM1 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:firstJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM1
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q1; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM2
-        ]
-    ] .
-
-:elementaryTM2 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-:centralJoinTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstJoinTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q2;
-        rml:objectMap [
-            rml:quotedTriplesMap :secondJoinTM
-        ]
-    ] .
-
-:elementaryTM3 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c5}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p3 ;
-        rml:objectMap [
-            rml:template "http://example/{c6}"
-        ]
-    ] .
-
-:secondJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM3
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q3; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM4
-        ]
-    ] .
-
-:elementaryTM4 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c7}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p4 ;
-        rml:objectMap [
-            rml:template "http://example/{c8}"
-        ]
-    ] .
-
-

Output

-
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
-
-
-

19. RMLSTARTC008b

-

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

-

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4,c1-5
-s1,o1,s2,o2,1
-
-

Input 1

-
c2-1,c2-2,c2-3,c2-4,c2-5
-s3,o3,s4,o4,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:elementaryTM1 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:firstJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM1
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q1; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM2
-        ]
-    ] .
-
-:elementaryTM2 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-4}"
-        ]
-    ] .
-
-:centralJoinTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstJoinTM ;
-            rml:joinCondition [
-              rml:child "c2-5" ;
-              rml:parent "c1-5" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q2;
-        rml:objectMap [
-            rml:quotedTriplesMap :secondJoinTM
-        ]
-    ] .
-
-:elementaryTM3 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p3 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-2}"
-        ]
-    ] .
-
-:secondJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM3
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q3; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM4
-        ]
-    ] .
-
-:elementaryTM4 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p4 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-4}"
-        ]
-    ] .
-
-

Output

-
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
-
-
-

20. RMLSTARTC009

-

Title:

-

Description:

-

Error expected? Yes

-

Input

-
c1,c2,c3,c4
-a,s,o,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}" 
-    ];
-    rml:predicateObjectMap [
-        rml:quotedTriplesMap :secondTM ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-:secondTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c3}" 
-        ]
-    ] .
-
-
-

21. RMLSTARTC010

-

Title:

-

Description:

-

Error expected? Yes

-

Input

-
c1,c2,c3,c4
-a,s,o,z
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p;
-        rml:quotedTriplesMap :secondTM ;
-    ] .
-
-:secondTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c3}" 
-        ]
-    ] .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-star/docs/20251029/index.html b/src/test/resources/rml-star/docs/20251029/index.html deleted file mode 100644 index 189b11a..0000000 --- a/src/test/resources/rml-star/docs/20251029/index.html +++ /dev/null @@ -1,2017 +0,0 @@ - - - - - - -RML-Star: Test Cases - - - - - - - - - - - - - - - -
- -

RML-Star: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Star-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Star test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTARTC001a

-

Title: quoted triple in subject, one source, blank node in quoted subject

-

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-b0,o,ABC
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:reference "c1" ;
-        rml:termType rml:BlankNode
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c3"
-        ]
-    ] .
-
-

Output

-
_:b0 <http://example/p> <http://example/o> .
-<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
-
-
-

5. RMLSTARTC001b

-

Title: quoted triple in subject, two sources, blank node in quoted subject

-

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-b0,o,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-ABC,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:reference "c1-1" ;
-        rml:termType rml:BlankNode
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM ;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-3" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1"
-        ]
-    ] .
-
-

Output

-
_:b0 <http://example/p> <http://example/o> .
-<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
-
-
-

6. RMLSTARTC002a

-

Title: quoted triple in subject, one source, blank node in quoted object

-

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,b1,456
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:reference "c2" ;
-            rml:termType rml:BlankNode
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c3";
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> _:b1 .
-<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

7. RMLSTARTC002b

-

Title: quoted triple in subject, two sources, blank node in quoted object

-

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,b1,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-456,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:reference "c1-2" ;
-            rml:termType rml:BlankNode
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM ;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-3" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1";
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> _:b1 .
-<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLSTARTC003a

-

Title: two-level quoted triple in subject, one source

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s,o,z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c3}"
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c4" ;
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
-<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

9. RMLSTARTC003b

-

Title: two-level quoted triple in subject, two sources

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4
-s,o,z,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-1,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c1-3}"
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-4" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1" ;
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
-<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

10. RMLSTARTC004a

-

Title: two-level quoted triple in subject and object, one source

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s,o,a,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
-<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
-
-
-

11. RMLSTARTC004b

-

Title: two-level quoted triple in subject and object, two sources

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4
-s,o,a,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-4" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c2-1}"
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
-<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
-
-
-

12. RMLSTARTC005a

-

Title: non-asserted quoted triple in subject, one source

-

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,o,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:template "http://example/{c3}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
-
-
-

13. RMLSTARTC005b

-

Title: non-asserted quoted triple in subject, two sources

-

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,o,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-2" ;
-              rml:parent "c1-3" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:template "http://example/{c2-1}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
-
-
-

14. RMLSTARTC006a

-

Title: non-asserted quoted triple in object, one source

-

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,o,x
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-

Output

-
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
-
-
-

15. RMLSTARTC006b

-

Title: non-asserted quoted triple in object, two sources

-

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,o,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-x,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-2" ;
-              rml:parent "c1-3" ;
-            ];
-        ]
-    ] .
-
-

Output

-
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
-
-
-

16. RMLSTARTC007a

-

Title: non-asserted quoted triples in subject and object, one source

-

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s1,o1,s2,o2
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :thirdTM
-        ]
-    ] .
-
-:thirdTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
-
-
-

17. RMLSTARTC007b

-

Title: non-asserted quoted triples in subject and object, two sources

-

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s1,o1,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2,c2-3
-s2,o2,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-3" ;
-              rml:parent "c1-3" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :thirdTM
-        ]
-    ] .
-
-:thirdTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-2}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
-
-
-

18. RMLSTARTC008a

-

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

-

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

-

Error expected? No

-

Input

-
c1,c2,c3,c4,c5,c6,c7,c8
-s1,o1,s2,o2,s3,o3,s4,o4
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:elementaryTM1 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:firstJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM1
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q1; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM2
-        ]
-    ] .
-
-:elementaryTM2 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-:centralJoinTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstJoinTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q2;
-        rml:objectMap [
-            rml:quotedTriplesMap :secondJoinTM
-        ]
-    ] .
-
-:elementaryTM3 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c5}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p3 ;
-        rml:objectMap [
-            rml:template "http://example/{c6}"
-        ]
-    ] .
-
-:secondJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM3
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q3; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM4
-        ]
-    ] .
-
-:elementaryTM4 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c7}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p4 ;
-        rml:objectMap [
-            rml:template "http://example/{c8}"
-        ]
-    ] .
-
-

Output

-
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
-
-
-

19. RMLSTARTC008b

-

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

-

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4,c1-5
-s1,o1,s2,o2,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2,c2-3,c2-4,c2-5
-s3,o3,s4,o4,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:elementaryTM1 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:firstJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM1
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q1; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM2
-        ]
-    ] .
-
-:elementaryTM2 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-4}"
-        ]
-    ] .
-
-:centralJoinTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstJoinTM ;
-            rml:joinCondition [
-              rml:child "c2-5" ;
-              rml:parent "c1-5" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q2;
-        rml:objectMap [
-            rml:quotedTriplesMap :secondJoinTM
-        ]
-    ] .
-
-:elementaryTM3 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p3 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-2}"
-        ]
-    ] .
-
-:secondJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM3
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q3; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM4
-        ]
-    ] .
-
-:elementaryTM4 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p4 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-4}"
-        ]
-    ] .
-
-

Output

-
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
-
-
-

20. RMLSTARTC009

-

Title: Quoted triples as predicate map

-

Description: Test the use quoted triples for generating the predicates, which is not possible

-

Error expected? Yes

-

Input

-
c1,c2,c3,c4
-a,s,o,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}" 
-    ];
-    rml:predicateObjectMap [
-        rml:quotedTriplesMap :secondTM ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-:secondTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c3}" 
-        ]
-    ] .
-
-
-

21. RMLSTARTC010

-

Title: Quoted triples as object without object map

-

Description: Test the use quoted triples for generating the object maps but without defining the object map, which is not possible

-

Error expected? Yes

-

Input

-
c1,c2,c3,c4
-a,s,o,z
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p;
-        rml:quotedTriplesMap :secondTM ;
-    ] .
-
-:secondTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c3}" 
-        ]
-    ] .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-star/docs/index.html b/src/test/resources/rml-star/docs/index.html deleted file mode 100644 index 189b11a..0000000 --- a/src/test/resources/rml-star/docs/index.html +++ /dev/null @@ -1,2017 +0,0 @@ - - - - - - -RML-Star: Test Cases - - - - - - - - - - - - - - - -
- -

RML-Star: Test Cases

-

- Draft Community Group Report - -

-
- -
Latest published version:
- https://www.w3.org/RML-Star-Testcases/ -
-
Latest editor's draft:
https://w3id.org/rml/star/test-cases/
- - - - -
Editor:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
- -
Author:
- Dylan Van Assche - - - - (IDLab – Ghent University – imec) -
-
Feedback:
- GitHub kg-construct/rml-io - (pull requests, - new issue, - open issues) -
- -
- - -
-
- - - -

Abstract

This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools.

-
- -

Status of This Document

- This specification was published by the - Knowledge Graph Construction Community Group. It is not a W3C Standard nor is it - on the W3C Standards Track. - - Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. - - Learn more about - W3C Community and Business Groups. -

- GitHub Issues are preferred for - discussion of this specification. - - -

- -

1. Introduction

-

This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification.

-
- -

2. Data model

-

The test cases are semantically described for re-usability and shareability following the W3C Test case description. -Each test:Testcase as the following properties:

-
    -
  • dcterms:identifier: unique ID of the test case.
  • -
  • rmltest:hasError: if an error of the RML Processor is expected or not.
  • -
  • rmltest:input: One or more input data of the test case.
  • -
  • rmltest:output: One or more output data of the test case.
  • -
  • rmltest:inputFormat: the input data format.
  • -
  • rmltest:outputFormat: the output data format.
  • -
  • rmltest:mappingDocument: the RML mapping rules in Turtle.
  • -
-
- -

3. Test cases

-

This section describes the RML-Star test cases. These descriptions are also available as RDF. -The files are available on GitHub in the folder test-cases. -Each test case is contained in a single folder, containing three types of files:

-
    -
  • Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server.
  • -
  • One file with the RML rules, called mapping.ttl, in the Turtle format.
  • -
  • Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error.
  • -
-
- - -

4. RMLSTARTC001a

-

Title: quoted triple in subject, one source, blank node in quoted subject

-

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-b0,o,ABC
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:reference "c1" ;
-        rml:termType rml:BlankNode
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c3"
-        ]
-    ] .
-
-

Output

-
_:b0 <http://example/p> <http://example/o> .
-<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
-
-
-

5. RMLSTARTC001b

-

Title: quoted triple in subject, two sources, blank node in quoted subject

-

Description: Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-b0,o,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-ABC,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:reference "c1-1" ;
-        rml:termType rml:BlankNode
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM ;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-3" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1"
-        ]
-    ] .
-
-

Output

-
_:b0 <http://example/p> <http://example/o> .
-<< _:b0 <http://example/p> <http://example/o> >> <http://example/q> "ABC" .
-
-
-

6. RMLSTARTC002a

-

Title: quoted triple in subject, one source, blank node in quoted object

-

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,b1,456
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:reference "c2" ;
-            rml:termType rml:BlankNode
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c3";
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> _:b1 .
-<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

7. RMLSTARTC002b

-

Title: quoted triple in subject, two sources, blank node in quoted object

-

Description: Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,b1,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-456,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:reference "c1-2" ;
-            rml:termType rml:BlankNode
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM ;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-3" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1";
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> _:b1 .
-<< <http://example/s> <http://example/p> _:b1 >> <http://example/q> "456"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

8. RMLSTARTC003a

-

Title: two-level quoted triple in subject, one source

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s,o,z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c3}"
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c4" ;
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
-<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

9. RMLSTARTC003b

-

Title: two-level quoted triple in subject, two sources

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4
-s,o,z,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-1,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c1-3}"
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-4" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:reference "c2-1" ;
-            rml:datatype xsd:integer
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> .
-<< << <http://example/s> <http://example/p> <http://example/o> >> <http://example/r> <http://example/z> >> <http://example/q> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
-
-
-

10. RMLSTARTC004a

-

Title: two-level quoted triple in subject and object, one source

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s,o,a,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
-<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
-
-
-

11. RMLSTARTC004b

-

Title: two-level quoted triple in subject and object, two sources

-

Description: Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4
-s,o,a,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-:thirdTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:quotedTriplesMap :secondTM;
-        rml:joinCondition [
-          rml:child "c2-2" ;
-          rml:parent "c1-4" ;
-        ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:r ;
-        rml:objectMap [
-            rml:template "http://example/{c2-1}"
-        ]
-    ] .
-
-

Output

-
<http://example/s> <http://example/p> <http://example/o> .
-<http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> .
-<< <http://example/a> <http://example/q> << <http://example/s> <http://example/p> <http://example/o> >> >> <http://example/r> <http://example/z> .
-
-
-

12. RMLSTARTC005a

-

Title: non-asserted quoted triple in subject, one source

-

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,o,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:template "http://example/{c3}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
-
-
-

13. RMLSTARTC005b

-

Title: non-asserted quoted triple in subject, two sources

-

Description: Tests the creation of a non-asserted quoted triple in the position of subject with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,o,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-z,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-2" ;
-              rml:parent "c1-3" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q ;
-        rml:objectMap [
-            rml:template "http://example/{c2-1}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s> <http://example/p> <http://example/o> >> <http://example/q> <http://example/z> .
-
-
-

14. RMLSTARTC006a

-

Title: non-asserted quoted triple in object, one source

-

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3
-s,o,x
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;  # This refers to the x statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM
-        ]
-    ] .
-
-

Output

-
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
-
-
-

15. RMLSTARTC006b

-

Title: non-asserted quoted triple in object, two sources

-

Description: Tests the creation of a non-asserted quoted triple in the position of object with data from two files

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s,o,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2
-x,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-2" ;
-              rml:parent "c1-3" ;
-            ];
-        ]
-    ] .
-
-

Output

-
<http://example/x> <http://example/p> << <http://example/s> <http://example/p> <http://example/o> >> .
-
-
-

16. RMLSTARTC007a

-

Title: non-asserted quoted triples in subject and object, one source

-

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file

-

Error expected? No

-

Input

-
c1,c2,c3,c4
-s1,o1,s2,o2
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :thirdTM
-        ]
-    ] .
-
-:thirdTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
-
-
-

17. RMLSTARTC007b

-

Title: non-asserted quoted triples in subject and object, two sources

-

Description: Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3
-s1,o1,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2,c2-3
-s2,o2,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:secondTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstTM ;
-            rml:joinCondition [
-              rml:child "c2-3" ;
-              rml:parent "c1-3" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :thirdTM
-        ]
-    ] .
-
-:thirdTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-2}"
-        ]
-    ] .
-
-

Output

-
<< <http://example/s1> <http://example/p1> <http://example/o1> >> <http://example/q> << <http://example/s2> <http://example/p2> <http://example/o2> >> .
-
-
-

18. RMLSTARTC008a

-

Title: two-level non-asserted quoted triple in subject and object two-fold, one source

-

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source

-

Error expected? No

-

Input

-
c1,c2,c3,c4,c5,c6,c7,c8
-s1,o1,s2,o2,s3,o3,s4,o4
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:elementaryTM1 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c2}"
-        ]
-    ] .
-
-:firstJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM1
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q1; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM2
-        ]
-    ] .
-
-:elementaryTM2 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-:centralJoinTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstJoinTM
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q2;
-        rml:objectMap [
-            rml:quotedTriplesMap :secondJoinTM
-        ]
-    ] .
-
-:elementaryTM3 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c5}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p3 ;
-        rml:objectMap [
-            rml:template "http://example/{c6}"
-        ]
-    ] .
-
-:secondJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM3
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q3; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM4
-        ]
-    ] .
-
-:elementaryTM4 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c7}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p4 ;
-        rml:objectMap [
-            rml:template "http://example/{c8}"
-        ]
-    ] .
-
-

Output

-
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
-
-
-

19. RMLSTARTC008b

-

Title: two-level non-asserted quoted triple in subject and object two-fold, two sources

-

Description: Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources

-

Error expected? No

-

Input

-
c1-1,c1-2,c1-3,c1-4,c1-5
-s1,o1,s2,o2,1
-
-

Input 1

-
**Input 1**
-c2-1,c2-2,c2-3,c2-4,c2-5
-s3,o3,s4,o4,1
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:elementaryTM1 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p1 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-2}"
-        ]
-    ] .
-
-:firstJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM1
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q1; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM2
-        ]
-    ] .
-
-:elementaryTM2 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data1.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p2 ;
-        rml:objectMap [
-            rml:template "http://example/{c1-4}"
-        ]
-    ] .
-
-:centralJoinTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :firstJoinTM ;
-            rml:joinCondition [
-              rml:child "c2-5" ;
-              rml:parent "c1-5" ;
-            ];
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q2;
-        rml:objectMap [
-            rml:quotedTriplesMap :secondJoinTM
-        ]
-    ] .
-
-:elementaryTM3 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-1}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p3 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-2}"
-        ]
-    ] .
-
-:secondJoinTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-            rml:quotedTriplesMap :elementaryTM3
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:q3; ;
-        rml:objectMap [
-            rml:quotedTriplesMap :elementaryTM4
-        ]
-    ] .
-
-:elementaryTM4 a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data2.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2-3}"
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p4 ;
-        rml:objectMap [
-            rml:template "http://example/{c2-4}"
-        ]
-    ] .
-
-

Output

-
<<<<<http://example/s1><http://example/p1><http://example/o1>>><http://example/q1><<<http://example/s2><http://example/p2><http://example/o2>>>>><http://example/q2><<<<<http://example/s3><http://example/p3><http://example/o3>>><http://example/q3><<<http://example/s4><http://example/p4><http://example/o4>>>>>.
-
-
-

20. RMLSTARTC009

-

Title: Quoted triples as predicate map

-

Description: Test the use quoted triples for generating the predicates, which is not possible

-

Error expected? Yes

-

Input

-
c1,c2,c3,c4
-a,s,o,z
-
-

Mapping

-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rml: <http://w3id.org/rml/> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}" 
-    ];
-    rml:predicateObjectMap [
-        rml:quotedTriplesMap :secondTM ;
-        rml:objectMap [
-            rml:template "http://example/{c4}"
-        ]
-    ] .
-
-:secondTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c3}" 
-        ]
-    ] .
-
-
-

21. RMLSTARTC010

-

Title: Quoted triples as object without object map

-

Description: Test the use quoted triples for generating the object maps but without defining the object map, which is not possible

-

Error expected? Yes

-

Input

-
c1,c2,c3,c4
-a,s,o,z
-
-

Mapping

-
@prefix rml: <http://w3id.org/rml/> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix ex: <http://example/> .
-@prefix : <http://example.org/> .
-@base <http://example.org/> .
-
-:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c1}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p;
-        rml:quotedTriplesMap :secondTM ;
-    ] .
-
-:secondTM a rml:NonAssertedTriplesMap ;
-    rml:logicalSource [
-        rml:source [ a rml:Source, rml:RelativePathSource;
-            rml:path "data.csv";
-        ];
-        rml:referenceFormulation rml:CSV
-    ];
-    rml:subjectMap [
-        rml:template "http://example/{c2}" 
-    ];
-    rml:predicateObjectMap [
-        rml:predicate ex:p ;
-        rml:objectMap [
-            rml:template "http://example/{c3}" 
-        ]
-    ] .
-
-
- - - - - \ No newline at end of file diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC009/data.csv b/src/test/resources/rml-star/invalid/RMLSTARTC009/data.csv deleted file mode 100644 index d9a0567..0000000 --- a/src/test/resources/rml-star/invalid/RMLSTARTC009/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -a,s,o,z \ No newline at end of file diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC009/mapping.ttl b/src/test/resources/rml-star/invalid/RMLSTARTC009/mapping.ttl deleted file mode 100644 index 311477d..0000000 --- a/src/test/resources/rml-star/invalid/RMLSTARTC009/mapping.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:quotedTriplesMap :secondTM ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -:secondTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC010/data.csv b/src/test/resources/rml-star/invalid/RMLSTARTC010/data.csv deleted file mode 100644 index d9a0567..0000000 --- a/src/test/resources/rml-star/invalid/RMLSTARTC010/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -a,s,o,z \ No newline at end of file diff --git a/src/test/resources/rml-star/invalid/RMLSTARTC010/mapping.ttl b/src/test/resources/rml-star/invalid/RMLSTARTC010/mapping.ttl deleted file mode 100644 index 4896029..0000000 --- a/src/test/resources/rml-star/invalid/RMLSTARTC010/mapping.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix rml: . -@prefix rdf: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap, rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; - rml:quotedTriplesMap :secondTM ; - ] . - -:secondTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . diff --git a/src/test/resources/rml-star/list.sh b/src/test/resources/rml-star/list.sh deleted file mode 100755 index 12c3203..0000000 --- a/src/test/resources/rml-star/list.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -for i in RML*; do - echo "
" -done diff --git a/src/test/resources/rml-star/make-metadata.py b/src/test/resources/rml-star/make-metadata.py deleted file mode 100755 index f3501f4..0000000 --- a/src/test/resources/rml-star/make-metadata.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import glob -import csv - -def get_title_description(testcase: str): - with open ('descriptions.csv') as csvfile: - reader = csv.reader(csvfile) - for row in reader: - if row[0] == testcase: - return row[1], row[2] - -def main(spec: str): - with open ('metadata.csv', 'w') as csvfile: - writer = csv.writer(csvfile) - writer.writerow(['ID', 'title', 'description', 'specification', - 'mapping', 'input_format1', 'input_format2', - 'input_format3', 'output_format1', 'output_format2', - 'output_format3', 'input1', 'input2', 'input3', - 'output1', 'output2', 'output3', 'error']) - for testcase in glob.glob('RML*'): - print(testcase) - title, description = get_title_description(testcase) - error = 'false' - input1 = '' - input2 = '' - input3 = '' - input_format1 = '' - input_format2 = '' - input_format3 = '' - output1 = '' - output2 = '' - output3 = '' - output_format1 = '' - output_format2 = '' - output_format3 = '' - - # Input file - if os.path.exists(os.path.join(testcase, 'data.csv')): - input1 = 'data.csv' - input_format1 = 'text/csv' - elif os.path.exists(os.path.join(testcase, 'data1.csv')): - input1 = 'data1.csv' - input_format1 = 'text/csv' - - if os.path.exists(os.path.join(testcase, 'data2.csv')): - input2 = 'data2.csv' - input_format2 = 'text/csv' - - # Mapping file - if os.path.exists(os.path.join(testcase, 'mapping.ttl')): - mapping_file = 'mapping.ttl' - else: - raise ValueError('Mapping file missing!') - - # Output files - if os.path.exists(os.path.join(testcase, 'output.nt')): - output1 = 'output.nt' - output_format1 = 'application/n-triples' - else: - error = 'true' - - writer.writerow([testcase, title, description, spec, mapping_file, - input_format1, input_format2, input_format3, - output_format1, output_format2, output_format3, - input1, input2, input3, output1, output2, - output3, error]) - lines = [] - # Title and description - lines.append(f'## {testcase}\n\n') - lines.append(f'**Title**: {title}\n\n') - lines.append(f'**Description**: {description}\n\n') - if error == 'true': - error_html = 'Yes' - else: - error_html = 'No' - lines.append(f'**Error expected?** {error_html}\n\n') - - # Input - inputCount = '' - - for index, i in enumerate([input1, input2, input3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - input_html = f'**Input{inputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - input_html = f'**Input{inputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - input_html = f'**Input{inputCount}**\n `{i}`\n\n' - - lines.append(input_html) - inputCount = f' {index + 1}' - - # Mapping - with open(os.path.join(testcase, mapping_file)) as f: - mapping_html = f'**Mapping**\n```\n{f.read()}\n```\n\n' - lines.append(mapping_html) - - # Output - outputCount = '' - if output2 or output3: - outputCount = ' 1' - - for index, i in enumerate([output1, output2, output3]): - if not i: - break - - if 'http://w3id.org/rml/resources' in i: - output_html = f'**Output{outputCount}**\n [{i}]({i})\n\n' - else: - try: - with open(os.path.join(testcase, i)) as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - try: - with open(os.path.join(testcase, i), encoding='utf-16') as f: - output_html = f'**Output{outputCount}**\n```\n{f.read()}\n```\n\n' - except UnicodeDecodeError: - output_html = f'**Output{outputCount}**\n `{i}`\n\n' - - lines.append(output_html) - outputCount = f' {index + 2}' - - - with open(os.path.join(testcase, 'README.md'), 'w') as f: - f.writelines(lines) - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('Usage: ./make-metadata.py ') - sys.exit(1) - main(sys.argv[1]) diff --git a/src/test/resources/rml-star/manifest.rml.ttl b/src/test/resources/rml-star/manifest.rml.ttl deleted file mode 100644 index e57c05c..0000000 --- a/src/test/resources/rml-star/manifest.rml.ttl +++ /dev/null @@ -1,267 +0,0 @@ -@prefix xsd: . -@prefix dcterms: . -@prefix rml: . -@prefix rmltest: . -@prefix test: . -@base . - -# java -jar .\burp.jar -m manifest.rml.ttl -o manifest.ttl -b http://w3id.org/rml/star/test/ - -_:source - rml:source [ - a rml:RelativePathSource ; - rml:path "metadata.csv" ; - rml:null ""; - ]; - rml:referenceFormulation rml:CSV; -. - -<#TriplesMapTestcase> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:reference "ID"; - rml:class test:TestCase; - ]; - - rml:predicateObjectMap [ - rml:predicate dcterms:identifier; - rml:objectMap [ - rml:reference "ID"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:hasError; - rml:objectMap [ - rml:reference "error"; - rml:datatype xsd:boolean; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:mappingDocument; - rml:objectMap [ - rml:reference "mapping"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapInput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput1>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput2>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ a rml:RefObjectMap; - rml:parentTriplesMap <#TriplesMapOutput3>; - rml:joinCondition [ - rml:child "ID"; - rml:parent "ID"; - ]; - ]; - ]; -. - -<#TriplesMapInput1> - a rml:TriplesMap; - - rml:logicalSource _:source ; - - rml:subjectMap [ - rml:template "{ID}/input/{input1}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format1"; - ]; - ]; -. - -<#TriplesMapInput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input2}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format2"; - ]; - ]; -. - -<#TriplesMapInput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/input/{input3}"; - rml:class rmltest:Input; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:input; - rml:objectMap [ - rml:reference "input3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:inputFormat; - rml:objectMap [ - rml:reference "input_format3"; - ]; - ]; -. - -<#TriplesMapOutput1> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output1}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output1"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format1"; - ]; - ]; -. - -<#TriplesMapOutput2> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output2}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output2"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format2"; - ]; - ]; -. - -<#TriplesMapOutput3> - a rml:TriplesMap; - - rml:logicalSource _:source; - - rml:subjectMap [ - rml:template "{ID}/output/{output3}"; - rml:class rmltest:Output; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:output; - rml:objectMap [ - rml:reference "output3"; - ]; - ]; - - rml:predicateObjectMap [ - rml:predicate rmltest:outputFormat; - rml:objectMap [ - rml:reference "output_format3"; - ]; - ]; -. - diff --git a/src/test/resources/rml-star/manifest.ttl b/src/test/resources/rml-star/manifest.ttl deleted file mode 100644 index 95f2f27..0000000 --- a/src/test/resources/rml-star/manifest.ttl +++ /dev/null @@ -1,240 +0,0 @@ - "data2.csv" . - "text/csv" . - . - "RMLSTARTC006a" . - "mapping.ttl" . - . - "false"^^ . - . - . - "output.nt" . - "application/n-triples" . - . - "output.nt" . - "application/n-triples" . - . - "data1.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - "data.csv" . - "text/csv" . - . - "RMLSTARTC010" . - "mapping.ttl" . - . - "true"^^ . - . - . - "RMLSTARTC008b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "RMLSTARTC004a" . - "mapping.ttl" . - . - "false"^^ . - . - . - "data2.csv" . - "text/csv" . - . - "data.csv" . - "text/csv" . - . - . - "RMLSTARTC006b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "output.nt" . - "application/n-triples" . - . - "RMLSTARTC002a" . - "mapping.ttl" . - . - "false"^^ . - . - . - "data.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - "RMLSTARTC009" . - "mapping.ttl" . - . - "true"^^ . - . - "data1.csv" . - "text/csv" . - . - "data2.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - . - "RMLSTARTC004b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "data1.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - "data2.csv" . - "text/csv" . - . - "data.csv" . - "text/csv" . - . - . - "RMLSTARTC002b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "output.nt" . - "application/n-triples" . - . - "data1.csv" . - "text/csv" . - . - "data.csv" . - "text/csv" . - . - "RMLSTARTC007a" . - "mapping.ttl" . - . - "false"^^ . - . - . - "output.nt" . - "application/n-triples" . - . - "data2.csv" . - "text/csv" . - . - "data.csv" . - "text/csv" . - . - "data.csv" . - "text/csv" . - . - "RMLSTARTC005a" . - "mapping.ttl" . - . - "false"^^ . - . - . - "data1.csv" . - "text/csv" . - . - "data2.csv" . - "text/csv" . - . - . - "RMLSTARTC007b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "RMLSTARTC003a" . - "mapping.ttl" . - . - "false"^^ . - . - . - "output.nt" . - "application/n-triples" . - . - "data1.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - "output.nt" . - "application/n-triples" . - . - "data.csv" . - "text/csv" . - . - . - "RMLSTARTC005b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "RMLSTARTC001a" . - "mapping.ttl" . - . - "false"^^ . - . - . - "data2.csv" . - "text/csv" . - . - "data.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - . - "RMLSTARTC003b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "output.nt" . - "application/n-triples" . - . - "data1.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - "data2.csv" . - "text/csv" . - . - "data.csv" . - "text/csv" . - . - "output.nt" . - "application/n-triples" . - . - "RMLSTARTC008a" . - "mapping.ttl" . - . - "false"^^ . - . - . - . - "RMLSTARTC001b" . - "mapping.ttl" . - . - "false"^^ . - . - . - "data1.csv" . - "text/csv" . - . diff --git a/src/test/resources/rml-star/metadata.csv b/src/test/resources/rml-star/metadata.csv deleted file mode 100644 index e9c0960..0000000 --- a/src/test/resources/rml-star/metadata.csv +++ /dev/null @@ -1,19 +0,0 @@ -ID,title,description,specification,mapping,input_format1,input_format2,input_format3,output_format1,output_format2,output_format3,input1,input2,input3,output1,output2,output3,error -RMLSTARTC003a,"two-level quoted triple in subject, one source",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC006b,"non-asserted quoted triple in object, two sources",Tests the creation of a non-asserted quoted triple in the position of object with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false -RMLSTARTC005b,"non-asserted quoted triple in subject, two sources",Tests the creation of a non-asserted quoted triple in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false -RMLSTARTC009,Quoted triples as predicate map,"Test the use quoted triples for generating the predicates, which is not possible",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,,,,data.csv,,,,,,true -RMLSTARTC004a,"two-level quoted triple in subject and object, one source","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from one file",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC001b,"quoted triple in subject, two sources, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false -RMLSTARTC007a,"non-asserted quoted triples in subject and object, one source","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from one file",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC008b,"two-level non-asserted quoted triple in subject and object two-fold, two sources","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false -RMLSTARTC002b,"quoted triple in subject, two sources, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false -RMLSTARTC006a,"non-asserted quoted triple in object, one source",Tests the creation of a non-asserted quoted triple in the position of object with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC003b,"two-level quoted triple in subject, two sources",Tests the creation of two-level recursiveness of asserted quoted triples as subjects with data from two files,http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false -RMLSTARTC005a,"non-asserted quoted triple in subject, one source",Tests the creation of a non-asserted quoted triple in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC010,Quoted triples as object without object map,"Test the use quoted triples for generating the object maps but without defining the object map, which is not possible",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,,,,data.csv,,,,,,true -RMLSTARTC001a,"quoted triple in subject, one source, blank node in quoted subject",Tests the creation of a asserted quoted triple (with a blank node as subject) in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC004b,"two-level quoted triple in subject and object, two sources","Tests the creation of two-level recursiveness of asserted quoted triples as first as object, second as subject with data from two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false -RMLSTARTC002a,"quoted triple in subject, one source, blank node in quoted object",Tests the creation of a asserted quoted triple (with a blank node as object) in the position of subject with data from one file,http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC008a,"two-level non-asserted quoted triple in subject and object two-fold, one source","Tests the creation of a triple with non-asserted quoted triples as subject and object, both triples have in turn non-asserted quoted triples in subject and object with data form one source",http://w3id.org/rml/star/,mapping.ttl,text/csv,,,application/n-triples,,,data.csv,,,output.nt,,,false -RMLSTARTC007b,"non-asserted quoted triples in subject and object, two sources","Tests the creation of a two non-asserted quoted triples, one in the position of subject and other in object with data from two sources",http://w3id.org/rml/star/,mapping.ttl,text/csv,text/csv,,application/n-triples,,,data1.csv,data2.csv,,output.nt,,,false diff --git a/src/test/resources/rml-star/section/abstract.md b/src/test/resources/rml-star/section/abstract.md deleted file mode 100644 index 177fb7a..0000000 --- a/src/test/resources/rml-star/section/abstract.md +++ /dev/null @@ -1 +0,0 @@ -This document defines the RML-Star test cases to the determine the RML-Star specification conformance of tools. diff --git a/src/test/resources/rml-star/section/data-model.md b/src/test/resources/rml-star/section/data-model.md deleted file mode 100644 index f4c3ad6..0000000 --- a/src/test/resources/rml-star/section/data-model.md +++ /dev/null @@ -1,12 +0,0 @@ -# Data model - -The test cases are semantically described for re-usability and shareability following the [W3C Test case description](https://www.w3.org/2006/03/test-description). -Each `test:Testcase` as the following properties: - -- `dcterms:identifier`: unique ID of the test case. -- `rmltest:hasError`: if an error of the RML Processor is expected or not. -- `rmltest:input`: One or more input data of the test case. -- `rmltest:output`: One or more output data of the test case. -- `rmltest:inputFormat`: the input data format. -- `rmltest:outputFormat`: the output data format. -- `rmltest:mappingDocument`: the RML mapping rules in Turtle. diff --git a/src/test/resources/rml-star/section/introduction.md b/src/test/resources/rml-star/section/introduction.md deleted file mode 100644 index 3a3f1e9..0000000 --- a/src/test/resources/rml-star/section/introduction.md +++ /dev/null @@ -1,4 +0,0 @@ -# Introduction - -This document defines the RML-Star test cases, consisting of a collection of test case documents (input and expected output). -The purpose of the test cases is to determine the conformance of tools that execute RML rules to the RML-Star specification. diff --git a/src/test/resources/rml-star/section/test-cases.md b/src/test/resources/rml-star/section/test-cases.md deleted file mode 100644 index 228143d..0000000 --- a/src/test/resources/rml-star/section/test-cases.md +++ /dev/null @@ -1,10 +0,0 @@ -# Test cases - -This section describes the RML-Star test cases. These descriptions are also available as RDF. -The files are available on [GitHub](https://github.com/kg-construct/rml-star/tree/main/test-cases) in the folder `test-cases`. -Each test case is contained in a single folder, containing three types of files: - - - Zero or more files containing the data sources, in the case of JSON, XML, CSV, or containing the SQL statements to create the necessary tables, in the case of MySQL, PostgreSQL, and SQL Server. - - One file with the RML rules, called `mapping.ttl`, in the Turtle format. - - Zero or more files with the expected RDF. No file is provided if an error is expected that must halt the generation of the RDF because of an error. - diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC001a/data.csv deleted file mode 100644 index 5de825f..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC001a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -b0,o,ABC \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC001a/mapping.ttl deleted file mode 100644 index 63ec233..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC001a/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:reference "c1" ; - rml:termType rml:BlankNode - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c3" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC001a/output.nt deleted file mode 100644 index 2d94448..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC001a/output.nt +++ /dev/null @@ -1,2 +0,0 @@ -_:b0 . -<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC001b/data1.csv deleted file mode 100644 index f6cfd6e..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC001b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -b0,o,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC001b/data2.csv deleted file mode 100644 index 1567740..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC001b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2 -ABC,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC001b/mapping.ttl deleted file mode 100644 index e9826ef..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC001b/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:reference "c1-1" ; - rml:termType rml:BlankNode - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC001b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC001b/output.nt deleted file mode 100644 index 2d94448..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC001b/output.nt +++ /dev/null @@ -1,2 +0,0 @@ -_:b0 . -<< _:b0 >> "ABC" . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC002a/data.csv deleted file mode 100644 index c44682d..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC002a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -s,b1,456 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC002a/mapping.ttl deleted file mode 100644 index c301bf7..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC002a/mapping.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix xsd: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:reference "c2" ; - rml:termType rml:BlankNode - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c3"; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC002a/output.nt deleted file mode 100644 index 2dc337a..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC002a/output.nt +++ /dev/null @@ -1,2 +0,0 @@ - _:b1 . -<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC002b/data1.csv deleted file mode 100644 index bd18828..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC002b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s,b1,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC002b/data2.csv deleted file mode 100644 index 6c461cb..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC002b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2 -456,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC002b/mapping.ttl deleted file mode 100644 index 372d0f9..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC002b/mapping.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix xsd: . -@prefix ex: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:reference "c1-2" ; - rml:termType rml:BlankNode - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1"; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC002b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC002b/output.nt deleted file mode 100644 index 2dc337a..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC002b/output.nt +++ /dev/null @@ -1,2 +0,0 @@ - _:b1 . -<< _:b1 >> "456"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC003a/data.csv deleted file mode 100644 index 98b6463..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC003a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -s,o,z,1 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC003a/mapping.ttl deleted file mode 100644 index 4d46169..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC003a/mapping.ttl +++ /dev/null @@ -1,58 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c4" ; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC003a/output.nt deleted file mode 100644 index d6a50cb..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC003a/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . -<< >> . -<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC003b/data1.csv deleted file mode 100644 index 3999e70..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC003b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3,c1-4 -s,o,z,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC003b/data2.csv deleted file mode 100644 index 76b3614..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC003b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2 -1,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC003b/mapping.ttl deleted file mode 100644 index edab9cc..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC003b/mapping.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c1-3}" - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-4" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:reference "c2-1" ; - rml:datatype xsd:integer - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC003b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC003b/output.nt deleted file mode 100644 index d6a50cb..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC003b/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . -<< >> . -<< << >> >> "1"^^ . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC004a/data.csv deleted file mode 100644 index 6b3d234..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC004a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -s,o,a,z \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC004a/mapping.ttl deleted file mode 100644 index 06b3511..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC004a/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC004a/output.nt deleted file mode 100644 index 7a8d313..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC004a/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . - << >> . -<< << >> >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC004b/data1.csv deleted file mode 100644 index 9734627..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC004b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3,c1-4 -s,o,a,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC004b/data2.csv deleted file mode 100644 index d07b44a..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC004b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2 -z,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC004b/mapping.ttl deleted file mode 100644 index 6ea4502..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC004b/mapping.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . - -:thirdTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :secondTM; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-4" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:r ; - rml:objectMap [ - rml:template "http://example/{c2-1}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC004b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC004b/output.nt deleted file mode 100644 index 7a8d313..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC004b/output.nt +++ /dev/null @@ -1,3 +0,0 @@ - . - << >> . -<< << >> >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC005a/data.csv deleted file mode 100644 index fc181e5..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC005a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -s,o,z \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC005a/mapping.ttl deleted file mode 100644 index 9cfe140..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC005a/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:template "http://example/{c3}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC005a/output.nt deleted file mode 100644 index 7f2be99..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC005a/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC005b/data1.csv deleted file mode 100644 index 9fe2369..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC005b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s,o,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC005b/data2.csv deleted file mode 100644 index d07b44a..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC005b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2 -z,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC005b/mapping.ttl deleted file mode 100644 index 1b885da..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC005b/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q ; - rml:objectMap [ - rml:template "http://example/{c2-1}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC005b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC005b/output.nt deleted file mode 100644 index 7f2be99..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC005b/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC006a/data.csv deleted file mode 100644 index 8ffc201..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC006a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3 -s,o,x \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC006a/mapping.ttl deleted file mode 100644 index 5de699b..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC006a/mapping.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC006a/output.nt deleted file mode 100644 index 5aa2cb2..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC006a/output.nt +++ /dev/null @@ -1 +0,0 @@ - << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC006b/data1.csv deleted file mode 100644 index 9fe2369..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC006b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s,o,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC006b/data2.csv deleted file mode 100644 index 80e8310..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC006b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2 -x,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC006b/mapping.ttl deleted file mode 100644 index c1baf80..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC006b/mapping.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; # This refers to the y statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; # This refers to the x statement in the rdf-star - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p; ; - rml:objectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-2" ; - rml:parent "c1-3" ; - ]; - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC006b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC006b/output.nt deleted file mode 100644 index 5aa2cb2..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC006b/output.nt +++ /dev/null @@ -1 +0,0 @@ - << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC007a/data.csv deleted file mode 100644 index d20882c..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC007a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4 -s1,o1,s2,o2 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC007a/mapping.ttl deleted file mode 100644 index 16a4cec..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC007a/mapping.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q; ; - rml:objectMap [ - rml:quotedTriplesMap :thirdTM - ] - ] . - -:thirdTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC007a/output.nt deleted file mode 100644 index 16b9420..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC007a/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC007b/data1.csv deleted file mode 100644 index 57395e8..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC007b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3 -s1,o1,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC007b/data2.csv deleted file mode 100644 index 8e56adc..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC007b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2,c2-3 -s2,o2,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC007b/mapping.ttl deleted file mode 100644 index 89ea007..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC007b/mapping.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:firstTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:secondTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstTM ; - rml:joinCondition [ - rml:child "c2-3" ; - rml:parent "c1-3" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q; ; - rml:objectMap [ - rml:quotedTriplesMap :thirdTM - ] - ] . - -:thirdTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c2-2}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC007b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC007b/output.nt deleted file mode 100644 index 16b9420..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC007b/output.nt +++ /dev/null @@ -1 +0,0 @@ -<< >> << >> . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008a/data.csv b/src/test/resources/rml-star/valid/RMLSTARTC008a/data.csv deleted file mode 100644 index e495323..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008a/data.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1,c2,c3,c4,c5,c6,c7,c8 -s1,o1,s2,o2,s3,o3,s4,o4 \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008a/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC008a/mapping.ttl deleted file mode 100644 index 9144682..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008a/mapping.ttl +++ /dev/null @@ -1,125 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:elementaryTM1 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c2}" - ] - ] . - -:firstJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM1 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q1; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM2 - ] - ] . - -:elementaryTM2 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c4}" - ] - ] . - -:centralJoinTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstJoinTM - ]; - rml:predicateObjectMap [ - rml:predicate ex:q2; - rml:objectMap [ - rml:quotedTriplesMap :secondJoinTM - ] - ] . - -:elementaryTM3 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c5}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p3 ; - rml:objectMap [ - rml:template "http://example/{c6}" - ] - ] . - -:secondJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM3 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q3; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM4 - ] - ] . - -:elementaryTM4 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c7}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p4 ; - rml:objectMap [ - rml:template "http://example/{c8}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008a/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC008a/output.nt deleted file mode 100644 index 041b857..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008a/output.nt +++ /dev/null @@ -1 +0,0 @@ -<<<<>><<>>>><<<<>><<>>>>. \ No newline at end of file diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/data1.csv b/src/test/resources/rml-star/valid/RMLSTARTC008b/data1.csv deleted file mode 100644 index 1f57ab5..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008b/data1.csv +++ /dev/null @@ -1,2 +0,0 @@ -c1-1,c1-2,c1-3,c1-4,c1-5 -s1,o1,s2,o2,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/data2.csv b/src/test/resources/rml-star/valid/RMLSTARTC008b/data2.csv deleted file mode 100644 index edee9b8..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008b/data2.csv +++ /dev/null @@ -1,2 +0,0 @@ -c2-1,c2-2,c2-3,c2-4,c2-5 -s3,o3,s4,o4,1 diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/mapping.ttl b/src/test/resources/rml-star/valid/RMLSTARTC008b/mapping.ttl deleted file mode 100644 index ee75362..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008b/mapping.ttl +++ /dev/null @@ -1,129 +0,0 @@ -@prefix rdf: . -@prefix rml: . -@prefix ex: . -@prefix xsd: . -@prefix : . -@base . - -:elementaryTM1 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p1 ; - rml:objectMap [ - rml:template "http://example/{c1-2}" - ] - ] . - -:firstJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM1 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q1; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM2 - ] - ] . - -:elementaryTM2 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data1.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c1-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p2 ; - rml:objectMap [ - rml:template "http://example/{c1-4}" - ] - ] . - -:centralJoinTM a rml:AssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :firstJoinTM ; - rml:joinCondition [ - rml:child "c2-5" ; - rml:parent "c1-5" ; - ]; - ]; - rml:predicateObjectMap [ - rml:predicate ex:q2; - rml:objectMap [ - rml:quotedTriplesMap :secondJoinTM - ] - ] . - -:elementaryTM3 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-1}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p3 ; - rml:objectMap [ - rml:template "http://example/{c2-2}" - ] - ] . - -:secondJoinTM a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:quotedTriplesMap :elementaryTM3 - ]; - rml:predicateObjectMap [ - rml:predicate ex:q3; ; - rml:objectMap [ - rml:quotedTriplesMap :elementaryTM4 - ] - ] . - -:elementaryTM4 a rml:NonAssertedTriplesMap ; - rml:logicalSource [ - rml:source [ a rml:Source, rml:RelativePathSource; - rml:path "data2.csv"; - ]; - rml:referenceFormulation rml:CSV - ]; - rml:subjectMap [ - rml:template "http://example/{c2-3}" - ]; - rml:predicateObjectMap [ - rml:predicate ex:p4 ; - rml:objectMap [ - rml:template "http://example/{c2-4}" - ] - ] . diff --git a/src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt b/src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt deleted file mode 100644 index fe36da8..0000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt +++ /dev/null @@ -1 +0,0 @@ -<<<<>><<>>>><<<<>><<>>>>. From 0ec67a4cc0f337a448eda929eed50e9944c31f97 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 16 Jun 2026 16:19:26 +0200 Subject: [PATCH 03/45] backport BURP-rer feat(parser): add custom location-tracking Turtle parser & AST converter feat(sources): refactor logical sources to extensible SPI providers (resolves #19) feat(reporting): integrate RER error handling and command line output feat(model): introduce PlanNode for a hierarchical execution plan, with template segments, reference scopes and specific class for each reference formulation. --- .gitignore | 4 + .gitmodules | 3 + .idea/misc.xml | 3 +- .idea/vcs.xml | 1 + pom.xml | 34 +- .../antlr4/burp/parse/turtleprov/Turtle.g4 | 417 +++++++ src/main/java/burp/Main.java | 573 +++++---- src/main/java/burp/NQuadsWriter.java | 162 +++ src/main/java/burp/ls/CSVIteration.java | 36 + src/main/java/burp/ls/CSVReference.java | 40 + src/main/java/burp/ls/CSVSource.java | 168 ++- src/main/java/burp/ls/CSVSourceProvider.java | 128 ++ .../java/burp/ls/FileBaseSourceProvider.java | 128 ++ .../java/burp/ls/FileBasedLogicalSource.java | 40 +- src/main/java/burp/ls/JSONSource.java | 100 -- src/main/java/burp/ls/JSONSourceProvider.java | 99 ++ src/main/java/burp/ls/JSONSourceRFC.java | 176 +++ .../java/burp/ls/LogicalSourceFactory.java | 473 ++----- .../java/burp/ls/LogicalSourceProvider.java | 54 + src/main/java/burp/ls/NetconfQuerySource.java | 62 +- src/main/java/burp/ls/RDBSource.java | 265 ++-- src/main/java/burp/ls/RDBSourceProvider.java | 47 + .../java/burp/ls/RDBTableSourceProvider.java | 22 + src/main/java/burp/ls/SPARQLFileSource.java | 215 ++-- .../java/burp/ls/SPARQLServiceSource.java | 117 +- .../java/burp/ls/SPARQLSourceProvider.java | 88 ++ src/main/java/burp/ls/SourceFile.java | 106 ++ src/main/java/burp/ls/XMLIteration.java | 30 + src/main/java/burp/ls/XMLReference.java | 44 + src/main/java/burp/ls/XMLSource.java | 239 ++-- src/main/java/burp/ls/XMLSourceProvider.java | 126 ++ .../burp/model/AbstractLogicalSource.java | 29 +- src/main/java/burp/model/BaseIRIScope.java | 5 + src/main/java/burp/model/BaseObjectMap.java | 4 + .../burp/model/ConcreteExpressionMap.java | 24 +- src/main/java/burp/model/DatatypeMap.java | 1 - .../burp/model/ExportedReferenceScope.java | 12 + src/main/java/burp/model/Expression.java | 7 +- src/main/java/burp/model/ExpressionField.java | 5 +- src/main/java/burp/model/ExpressionMap.java | 571 +++++---- src/main/java/burp/model/Field.java | 2 + src/main/java/burp/model/FilePathTarget.java | 21 + .../java/burp/model/FormulationIterable.java | 8 + .../java/burp/model/FunctionExecution.java | 185 ++- src/main/java/burp/model/FunctionMap.java | 35 +- src/main/java/burp/model/GraphMap.java | 40 +- src/main/java/burp/model/Input.java | 5 +- src/main/java/burp/model/InputValueMap.java | 45 +- src/main/java/burp/model/Iterable.java | 14 - src/main/java/burp/model/IterableField.java | 20 +- src/main/java/burp/model/Iteration.java | 15 +- src/main/java/burp/model/JoinCondition.java | 55 +- src/main/java/burp/model/LanguageMap.java | 70 +- src/main/java/burp/model/LanguageTag.java | 6 + .../java/burp/model/LocalReferenceScope.java | 11 + src/main/java/burp/model/LogicalSource.java | 24 +- src/main/java/burp/model/LogicalTarget.java | 37 + .../java/burp/model/LogicalTargetScope.java | 25 + src/main/java/burp/model/LogicalView.java | 214 ---- src/main/java/burp/model/MappingDocument.java | 190 +++ src/main/java/burp/model/ObjectMap.java | 47 +- src/main/java/burp/model/ParameterMap.java | 35 +- .../burp/model/ParentJoinReferenceScope.java | 11 + src/main/java/burp/model/PlanNode.java | 53 + src/main/java/burp/model/PredicateMap.java | 35 +- .../java/burp/model/PredicateObjectMap.java | 89 +- src/main/java/burp/model/RDFNodeConstant.java | 45 +- src/main/java/burp/model/RMLFunction.java | 8 +- src/main/java/burp/model/RMLTarget.java | 4 + src/main/java/burp/model/RawReference.java | 51 + .../java/burp/model/RdfPredicateObject.java | 16 + src/main/java/burp/model/RdfStatement.java | 64 + .../java/burp/model/RdfStatementLike.java | 7 + .../burp/model/RdfStatementSubjectGraph.java | 51 + src/main/java/burp/model/Reference.java | 73 +- src/main/java/burp/model/ReferenceHolder.java | 5 + .../java/burp/model/ReferencingObjectMap.java | 166 ++- src/main/java/burp/model/Return.java | 11 +- src/main/java/burp/model/ReturnMap.java | 35 +- src/main/java/burp/model/SubjectMap.java | 59 +- src/main/java/burp/model/Template.java | 257 +++- .../burp/model/TemplateReferenceSafety.java | 5 + src/main/java/burp/model/TermExtensions.java | 13 + src/main/java/burp/model/TermGenerator.java | 9 + src/main/java/burp/model/TermMap.java | 111 +- src/main/java/burp/model/TriplesMap.java | 151 ++- src/main/java/burp/model/ViewJoin.java | 120 -- .../burp/model/fnmlutil/BuiltInFunctions.java | 110 ++ .../java/burp/model/fnmlutil/Functions.java | 72 +- .../model/fnmlutil/FunctionsRegistry.java | 66 + .../java/burp/model/gathermap/GatherMap.java | 136 ++ .../model/gathermaputil/GatherMapMixin.java | 10 +- src/main/java/burp/model/lv/JoinType.java | 5 + .../java/burp/model/lv/LogicalIteration.java | 73 ++ src/main/java/burp/model/lv/LogicalView.java | 153 +++ src/main/java/burp/model/lv/ViewJoin.java | 165 +++ .../java/burp/model/rdf/BlankNodeOrIRI.java | 4 + .../java/burp/model/rdf/BlankNodeTerm.java | 17 + .../model/rdf/CollectionOrContainerTerm.java | 45 + src/main/java/burp/model/rdf/Datardf.java | 93 ++ src/main/java/burp/model/rdf/IRITerm.java | 17 + src/main/java/burp/model/rdf/LiteralTerm.java | 55 + src/main/java/burp/model/rdf/RdfAltTerm.java | 21 + src/main/java/burp/model/rdf/RdfBagTerm.java | 21 + src/main/java/burp/model/rdf/RdfListTerm.java | 21 + src/main/java/burp/model/rdf/RdfSeqTerm.java | 21 + src/main/java/burp/model/rdf/Term.java | 9 + src/main/java/burp/parse/BurpParserError.java | 41 + src/main/java/burp/parse/Parse.java | 1101 ++++++++++------- src/main/java/burp/parse/PlanWiring.java | 63 + .../java/burp/parse/turtleprov/NodeInfo.java | 70 ++ .../java/burp/parse/turtleprov/Point.java | 71 ++ .../java/burp/parse/turtleprov/ProvStore.java | 40 + .../burp/parse/turtleprov/ProvTriple.java | 49 + .../parse/turtleprov/ProvTurtleVisitor.java | 441 +++++++ .../burp/parse/turtleprov/RDF12Converter.java | 168 +++ .../burp/parse/turtleprov/TurtleNodeKind.java | 33 + .../java/burp/reporting/BurpException.java | 14 + src/main/java/burp/reporting/Errors.java | 64 + src/main/java/burp/reporting/LiteralPart.java | 25 + src/main/java/burp/reporting/Origin.java | 22 + src/main/java/burp/reporting/PointRange.java | 35 + .../java/burp/reporting/RDFGraphPointer.java | 7 + src/main/java/burp/reporting/RDFPointer.java | 4 + src/main/java/burp/reporting/RmlError.java | 56 + .../java/burp/reporting/RmlErrorBuilder.java | 55 + .../burp/reporting/RmlExecutionReport.java | 42 + .../java/burp/reporting/StatementPart.java | 5 + .../java/burp/reporting/StatementParts.java | 50 + src/main/java/burp/reporting/Statistics.java | 40 + .../java/burp/reporting/TextFilePointer.java | 5 + .../java/burp/util/BURPConfiguration.java | 72 +- src/main/java/burp/util/Util.java | 361 +++--- src/main/java/burp/vocabularies/BURP.java | 43 + src/main/java/burp/vocabularies/RML.java | 9 +- src/test/java/burp/TestBURP.java | 8 + src/test/java/burp/TestData.java | 60 +- src/test/java/burp/TestRMLCC.java | 108 +- src/test/java/burp/TestRMLCore.java | 109 +- src/test/java/burp/TestRMLCoreGM.java.old | 88 -- src/test/java/burp/TestRMLCoreMySQL.java.old | 209 ---- .../java/burp/TestRMLCorePostgreSQL.java.old | 202 --- src/test/java/burp/TestRMLFNML.java | 8 + src/test/java/burp/TestRMLFNML.java.old | 81 -- .../burp/TestRMLFNMLGrellFunctions.java.old | 100 -- src/test/java/burp/TestRMLIO.java | 8 + src/test/java/burp/TestRMLIORegistry.java | 145 +++ src/test/java/burp/TestRMLLV.java | 108 +- src/test/java/burp/TestRMLModule.java | 391 ++++++ src/test/java/burp/tools/FetchTestCases.java | 226 ++++ .../java/turtleprov/AbstractManifestTest.java | 199 +++ .../java/turtleprov/Rdf11ManifestTest.java | 16 + .../java/turtleprov/Rdf12ManifestTest.java | 16 + .../java/turtleprov/TurtleParserTest.java | 281 +++++ .../java/turtleprov/manifest/RdfManifest.java | 47 + .../java/turtleprov/manifest/RdfTest.java | 33 + .../burp/BURPFNMLTC-CSV-Concat/mapping.ttl | 25 + .../burp/BURPFNMLTC-CSV-Concat/output.nq | 1 + .../burp/BURPFNMLTC-CSV-Concat/student.csv | 2 + .../BURPFNMLTC-CSV-ConcatSequence/mapping.ttl | 35 + .../BURPFNMLTC-CSV-ConcatSequence/output.nq | 1 + .../BURPFNMLTC-CSV-ConcatSequence/student.csv | 2 + .../burp/BURPFNMLTC-CSV-SHA1/mapping.ttl | 23 + .../burp/BURPFNMLTC-CSV-SHA1/output.nq | 1 + .../burp/BURPFNMLTC-CSV-SHA1/student.csv | 2 + .../burp/BURPFNMLTC-CSV-SHA256/mapping.ttl | 23 + .../burp/BURPFNMLTC-CSV-SHA256/output.nq | 1 + .../burp/BURPFNMLTC-CSV-SHA256/student.csv | 2 + .../burp/BURPFNMLTC-CSV-toSafeIRI/mapping.ttl | 24 + .../burp/BURPFNMLTC-CSV-toSafeIRI/output.nq | 1 + .../burp/BURPFNMLTC-CSV-toSafeIRI/student.csv | 2 + .../burp/BURPFNMLTC-CSV-toSafeURI/mapping.ttl | 24 + .../burp/BURPFNMLTC-CSV-toSafeURI/output.nq | 1 + .../burp/BURPFNMLTC-CSV-toSafeURI/student.csv | 2 + .../resources/burp/BURPIOTC-BSON/mapping.ttl | 26 + .../resources/burp/BURPIOTC-BSON/output.nq | 4 + .../resources/burp/BURPIOTC-BSON/student.bson | Bin 0 -> 140 bytes .../burp/BURPIOTC-CSV-BOM/country_info.csv | 4 + .../burp/BURPIOTC-CSV-BOM/mapping.ttl | 19 + .../resources/burp/BURPIOTC-CSV-BOM/output.nq | 3 + .../burp/BURPIOTC-SQLITE/mapping.ttl | 23 + .../resources/burp/BURPIOTC-SQLITE/output.nq | 2 + .../resources/burp/BURPIOTC-SQLITE/student.db | Bin 0 -> 8192 bytes src/test/resources/burp/ELSDVLEE-20/data.csv | 4 + src/test/resources/burp/ELSDVLEE-20/data.json | 26 + .../resources/burp/ELSDVLEE-20/mapping.ttl | 94 ++ src/test/resources/burp/errors.csv | 23 + src/test/resources/burp/metadata.csv | 12 + 188 files changed, 9935 insertions(+), 4231 deletions(-) create mode 100644 .gitmodules create mode 100644 src/main/antlr4/burp/parse/turtleprov/Turtle.g4 create mode 100644 src/main/java/burp/NQuadsWriter.java create mode 100644 src/main/java/burp/ls/CSVIteration.java create mode 100644 src/main/java/burp/ls/CSVReference.java create mode 100644 src/main/java/burp/ls/CSVSourceProvider.java create mode 100644 src/main/java/burp/ls/FileBaseSourceProvider.java delete mode 100644 src/main/java/burp/ls/JSONSource.java create mode 100644 src/main/java/burp/ls/JSONSourceProvider.java create mode 100644 src/main/java/burp/ls/JSONSourceRFC.java create mode 100644 src/main/java/burp/ls/LogicalSourceProvider.java create mode 100644 src/main/java/burp/ls/RDBSourceProvider.java create mode 100644 src/main/java/burp/ls/RDBTableSourceProvider.java create mode 100644 src/main/java/burp/ls/SPARQLSourceProvider.java create mode 100644 src/main/java/burp/ls/SourceFile.java create mode 100644 src/main/java/burp/ls/XMLIteration.java create mode 100644 src/main/java/burp/ls/XMLReference.java create mode 100644 src/main/java/burp/ls/XMLSourceProvider.java create mode 100644 src/main/java/burp/model/BaseIRIScope.java create mode 100644 src/main/java/burp/model/BaseObjectMap.java create mode 100644 src/main/java/burp/model/ExportedReferenceScope.java create mode 100644 src/main/java/burp/model/FilePathTarget.java create mode 100644 src/main/java/burp/model/FormulationIterable.java delete mode 100644 src/main/java/burp/model/Iterable.java create mode 100644 src/main/java/burp/model/LanguageTag.java create mode 100644 src/main/java/burp/model/LocalReferenceScope.java create mode 100644 src/main/java/burp/model/LogicalTarget.java create mode 100644 src/main/java/burp/model/LogicalTargetScope.java delete mode 100644 src/main/java/burp/model/LogicalView.java create mode 100644 src/main/java/burp/model/MappingDocument.java create mode 100644 src/main/java/burp/model/ParentJoinReferenceScope.java create mode 100644 src/main/java/burp/model/PlanNode.java create mode 100644 src/main/java/burp/model/RMLTarget.java create mode 100644 src/main/java/burp/model/RawReference.java create mode 100644 src/main/java/burp/model/RdfPredicateObject.java create mode 100644 src/main/java/burp/model/RdfStatement.java create mode 100644 src/main/java/burp/model/RdfStatementLike.java create mode 100644 src/main/java/burp/model/RdfStatementSubjectGraph.java create mode 100644 src/main/java/burp/model/ReferenceHolder.java create mode 100644 src/main/java/burp/model/TemplateReferenceSafety.java create mode 100644 src/main/java/burp/model/TermExtensions.java create mode 100644 src/main/java/burp/model/TermGenerator.java delete mode 100644 src/main/java/burp/model/ViewJoin.java create mode 100644 src/main/java/burp/model/fnmlutil/BuiltInFunctions.java create mode 100644 src/main/java/burp/model/fnmlutil/FunctionsRegistry.java create mode 100644 src/main/java/burp/model/gathermap/GatherMap.java create mode 100644 src/main/java/burp/model/lv/JoinType.java create mode 100644 src/main/java/burp/model/lv/LogicalIteration.java create mode 100644 src/main/java/burp/model/lv/LogicalView.java create mode 100644 src/main/java/burp/model/lv/ViewJoin.java create mode 100644 src/main/java/burp/model/rdf/BlankNodeOrIRI.java create mode 100644 src/main/java/burp/model/rdf/BlankNodeTerm.java create mode 100644 src/main/java/burp/model/rdf/CollectionOrContainerTerm.java create mode 100644 src/main/java/burp/model/rdf/Datardf.java create mode 100644 src/main/java/burp/model/rdf/IRITerm.java create mode 100644 src/main/java/burp/model/rdf/LiteralTerm.java create mode 100644 src/main/java/burp/model/rdf/RdfAltTerm.java create mode 100644 src/main/java/burp/model/rdf/RdfBagTerm.java create mode 100644 src/main/java/burp/model/rdf/RdfListTerm.java create mode 100644 src/main/java/burp/model/rdf/RdfSeqTerm.java create mode 100644 src/main/java/burp/model/rdf/Term.java create mode 100644 src/main/java/burp/parse/BurpParserError.java create mode 100644 src/main/java/burp/parse/PlanWiring.java create mode 100644 src/main/java/burp/parse/turtleprov/NodeInfo.java create mode 100644 src/main/java/burp/parse/turtleprov/Point.java create mode 100644 src/main/java/burp/parse/turtleprov/ProvStore.java create mode 100644 src/main/java/burp/parse/turtleprov/ProvTriple.java create mode 100644 src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java create mode 100644 src/main/java/burp/parse/turtleprov/RDF12Converter.java create mode 100644 src/main/java/burp/parse/turtleprov/TurtleNodeKind.java create mode 100644 src/main/java/burp/reporting/BurpException.java create mode 100644 src/main/java/burp/reporting/Errors.java create mode 100644 src/main/java/burp/reporting/LiteralPart.java create mode 100644 src/main/java/burp/reporting/Origin.java create mode 100644 src/main/java/burp/reporting/PointRange.java create mode 100644 src/main/java/burp/reporting/RDFGraphPointer.java create mode 100644 src/main/java/burp/reporting/RDFPointer.java create mode 100644 src/main/java/burp/reporting/RmlError.java create mode 100644 src/main/java/burp/reporting/RmlErrorBuilder.java create mode 100644 src/main/java/burp/reporting/RmlExecutionReport.java create mode 100644 src/main/java/burp/reporting/StatementPart.java create mode 100644 src/main/java/burp/reporting/StatementParts.java create mode 100644 src/main/java/burp/reporting/Statistics.java create mode 100644 src/main/java/burp/reporting/TextFilePointer.java create mode 100644 src/main/java/burp/vocabularies/BURP.java create mode 100644 src/test/java/burp/TestBURP.java delete mode 100644 src/test/java/burp/TestRMLCoreGM.java.old delete mode 100644 src/test/java/burp/TestRMLCoreMySQL.java.old delete mode 100644 src/test/java/burp/TestRMLCorePostgreSQL.java.old create mode 100644 src/test/java/burp/TestRMLFNML.java delete mode 100644 src/test/java/burp/TestRMLFNML.java.old delete mode 100644 src/test/java/burp/TestRMLFNMLGrellFunctions.java.old create mode 100644 src/test/java/burp/TestRMLIO.java create mode 100644 src/test/java/burp/TestRMLIORegistry.java create mode 100644 src/test/java/burp/TestRMLModule.java create mode 100644 src/test/java/burp/tools/FetchTestCases.java create mode 100644 src/test/java/turtleprov/AbstractManifestTest.java create mode 100644 src/test/java/turtleprov/Rdf11ManifestTest.java create mode 100644 src/test/java/turtleprov/Rdf12ManifestTest.java create mode 100644 src/test/java/turtleprov/TurtleParserTest.java create mode 100644 src/test/java/turtleprov/manifest/RdfManifest.java create mode 100644 src/test/java/turtleprov/manifest/RdfTest.java create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-Concat/mapping.ttl create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-Concat/output.nq create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-Concat/student.csv create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/mapping.ttl create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/output.nq create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/student.csv create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-SHA1/mapping.ttl create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-SHA1/output.nq create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-SHA1/student.csv create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-SHA256/mapping.ttl create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-SHA256/output.nq create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-SHA256/student.csv create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/mapping.ttl create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/output.nq create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/student.csv create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/mapping.ttl create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/output.nq create mode 100644 src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/student.csv create mode 100644 src/test/resources/burp/BURPIOTC-BSON/mapping.ttl create mode 100644 src/test/resources/burp/BURPIOTC-BSON/output.nq create mode 100644 src/test/resources/burp/BURPIOTC-BSON/student.bson create mode 100644 src/test/resources/burp/BURPIOTC-CSV-BOM/country_info.csv create mode 100644 src/test/resources/burp/BURPIOTC-CSV-BOM/mapping.ttl create mode 100644 src/test/resources/burp/BURPIOTC-CSV-BOM/output.nq create mode 100644 src/test/resources/burp/BURPIOTC-SQLITE/mapping.ttl create mode 100644 src/test/resources/burp/BURPIOTC-SQLITE/output.nq create mode 100644 src/test/resources/burp/BURPIOTC-SQLITE/student.db create mode 100644 src/test/resources/burp/ELSDVLEE-20/data.csv create mode 100644 src/test/resources/burp/ELSDVLEE-20/data.json create mode 100644 src/test/resources/burp/ELSDVLEE-20/mapping.ttl create mode 100644 src/test/resources/burp/errors.csv create mode 100644 src/test/resources/burp/metadata.csv diff --git a/.gitignore b/.gitignore index b4f959b..8fd0983 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,7 @@ BURP.iml .idea/jarRepositories.xml .idea/modules.xml .idea/workspace.xml + +src/main/resources/shapes/rml-* +src/main/resources/vocabularies/rml +src/test/resources/rml-* \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ff8e8c8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/test/resources/rdf-tests"] + path = src/test/resources/rdf-tests + url = https://github.com/w3c/rdf-tests.git diff --git a/.idea/misc.xml b/.idea/misc.xml index 9f12a69..7fb4876 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ + @@ -7,5 +8,5 @@ - + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1dd..97a37e7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6f0417c..d748cbb 100644 --- a/pom.xml +++ b/pom.xml @@ -181,9 +181,19 @@ 2.5.0
- mysql - mysql-connector-java - 8.0.33 + at.asitplus + jsonpath4k-jvm + 3.1.1 + + + org.jetbrains.kotlinx + kotlinx-serialization-json-jvm + 1.6.3 + + + com.mysql + mysql-connector-j + 9.3.0 org.postgresql @@ -234,20 +244,26 @@ org.testcontainers - junit-jupiter - 1.19.5 + testcontainers-junit-jupiter + 2.0.3 test org.testcontainers - postgresql - 1.19.5 + testcontainers-postgresql + 2.0.3 + test + + + org.testcontainers + testcontainers-mysql + 2.0.3 test org.testcontainers - mysql - 1.19.5 + testcontainers-mssqlserver + 2.0.3 test diff --git a/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 b/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 new file mode 100644 index 0000000..624fe9a --- /dev/null +++ b/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 @@ -0,0 +1,417 @@ +/* + [The "BSD licence"] + Copyright (c) 2024, Jakub Duchateau (@ Université de Liège, https://www.uliege.be/) + Copyright (c) 2014, Alejandro Medrano (@ Universidad Politecnica de Madrid, http://www.upm.es/) + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +*/ + +// Derived from https://www.w3.org/TR/rdf12-turtle/#sec-grammar-grammar + + +// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false +// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging + +grammar Turtle; + +// [1] turtleDoc ::= statement* +turtleDoc + : statement* EOF + ; + +// [2] statement ::= directive | (triples '.') +statement + : directive + | triples '.' + ; + +// [3] directive ::= prefixID | base | sparqlPrefix | sparqlBase +directive + : prefixID + | base + | sparqlPrefix + | sparqlBase + ; + +// [4] prefixID ::= '@prefix' PNAME_NS IRIREF '.' +prefixID + : '@prefix' PNAME_NS IRIREF '.' + ; + +// [5] base ::= '@base' IRIREF '.' +base + : '@base' IRIREF '.' + ; + +// [6] sparqlPrefix ::= 'PREFIX' PNAME_NS IRIREF +sparqlPrefix + : 'PREFIX' PNAME_NS IRIREF + ; + +// [7] sparqlBase ::= 'BASE' IRIREF +sparqlBase + : 'BASE' IRIREF + ; + +// [8] triples ::= (subject predicateObjectList) | (blankNodePropertyList predicateObjectList?) | (reifiedTriple predicateObjectList?) +triples + : subject predicateObjectList + | blankNodePropertyList predicateObjectList? + | reifiedTriple predicateObjectList? + ; + +// [9] predicateObjectList ::= verb objectList (';' (verb objectList)?)* +predicateObjectList + : verb objectList (';' (verb objectList)?)* + ; + +// [10] objectList ::= object annotation (',' object annotation)* +objectList + : object_ annotation (',' object_ annotation)* + ; + +// [11] verb ::= predicate | 'a' +verb + : iri // from [13] predicate ::= iri + | 'a' + ; + +// [12] subject ::= iri | BlankNode | collection +subject + : iri + | BlankNode + | collection + ; + +// [14] object ::= iri | BlankNode | collection | blankNodePropertyList | literal | tripleTerm | reifiedTriple +object_ + : iri + | BlankNode + | collection + | blankNodePropertyList + | literal + | tripleTerm + | reifiedTriple + ; + +// [15] literal ::= RDFLiteral | NumericLiteral | BooleanLiteral +literal + : rdfLiteral + | NumericLiteral + | BooleanLiteral + ; + +// [16] blankNodePropertyList ::= '[' predicateObjectList ']' +blankNodePropertyList + : '[' predicateObjectList ']' + ; + +// [17] collection ::= '(' object* ')' +collection + : '(' object_* ')' + ; + +// [18] NumericLiteral ::= INTEGER | DECIMAL | DOUBLE +NumericLiteral + : INTEGER + | DECIMAL + | DOUBLE + ; + +// [19] RDFLiteral ::= String (LANGTAG | '^^' iri)? +rdfLiteral + : string (LANG_DIR | '^^' iri)? + ; + +// [20] BooleanLiteral ::= 'true' | 'false' +BooleanLiteral + : 'true' + | 'false' + ; + +// [21] String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE +string + : STRING_LITERAL_QUOTE + | STRING_LITERAL_SINGLE_QUOTE + | STRING_LITERAL_LONG_SINGLE_QUOTE + | STRING_LITERAL_LONG_QUOTE + ; + +// [22] iri ::= IRIREF | PrefixedName +iri + : IRIREF + | PrefixedName + ; + +// [24] BlankNode ::= BLANK_NODE_LABEL | ANON +BlankNode + : BLANK_NODE_LABEL + | ANON + ; + +// Turtle-Star + +// [25] reifier ::= '~' (iri | BlankNode)? +reifier + : '~' (iri | BlankNode)? + ; + +// [26] reifiedTriple ::= '<<' rtSubject verb rtObject reifier? '>>' +reifiedTriple + : '<<' rtSubject verb rtObject reifier? '>>' + ; + +// [27] rtSubject ::= iri | BlankNode | reifiedTriple +rtSubject + : iri + | BlankNode + | reifiedTriple + ; + +// [28] rtObject ::= iri | BlankNode | literal | tripleTerm | reifiedTriple +rtObject + : iri + | BlankNode + | literal + | tripleTerm + | reifiedTriple + ; + +// [29] tripleTerm ::= '<<(' ttSubject verb ttObject ')>>' +tripleTerm + : '<<(' ttSubject verb ttObject ')>>' + ; + +// [30] ttSubject ::= iri | BlankNode +ttSubject + : iri + | BlankNode + ; + +// [31] ttObject ::= iri | BlankNode | literal | tripleTerm +ttObject + : iri + | BlankNode + | literal + | tripleTerm + ; + +// [32] annotation ::= (reifier | annotationBlock)* +annotation + : (reifier | annotationBlock)* + ; + +// [33] annotationBlock ::= '{|' predicateObjectList '|}' +annotationBlock + : '{|' predicateObjectList '|}' + ; + +// +// Productions for terminals +// + +// [35] IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>' +IRIREF + : '<' (~[\u0000-\u0020<>"{}|^`\\] | UCHAR)* '>' + ; + +// [36] PNAME_NS ::= PN_PREFIX? ':' +PNAME_NS + : PN_PREFIX? ':' + ; + +// [23] PrefixedName ::= PNAME_LN | PNAME_NS +PrefixedName + : PNAME_LN + | PNAME_NS + ; + +// [37] PNAME_LN ::= PNAME_NS PN_LOCAL +PNAME_LN + : PNAME_NS PN_LOCAL + ; + +// [50] WS ::= #x20 | #x9 | #xD | #xA +WS + : ([\t\u000C] | ' ')+ -> skip + ; +NL + : ('\r'?'\n') -> channel(HIDDEN) + ; + +// [55] PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)? +PN_PREFIX + : PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)? + ; + +// [38] BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)? +BLANK_NODE_LABEL + : '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)? + ; + +// [39] LANG_DIR ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* ('--' [a-zA-Z]+)? +LANG_DIR + : '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* ('--' [a-zA-Z]+)? + ; + +// [40] INTEGER ::= [+-]? [0-9]+ +INTEGER + : [+-]? [0-9]+ + ; + +// [41] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+ +DECIMAL + : [+-]? [0-9]* '.' [0-9]+ + ; + +// [42] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT) +DOUBLE + : [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT) + ; + +// [43] EXPONENT ::= [eE] [+-]? [0-9]+ +EXPONENT + : [eE] [+-]? [0-9]+ + ; + +// [46] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" (("'" | "''")? ([^'\] | ECHAR | UCHAR))* "'''" +STRING_LITERAL_LONG_SINGLE_QUOTE + : '\'\'\'' (('\'' | '\'\'')? ((~ ['\\]) | ECHAR | UCHAR))* '\'\'\'' + ; + +// [47] STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? ([^"\] | ECHAR | UCHAR))* '"""' +STRING_LITERAL_LONG_QUOTE + : '"""' (('\'' | '\'\'')? ((~ ['\\]) | ECHAR | UCHAR))* '"""' + ; + +// [44] STRING_LITERAL_QUOTE ::= '"' ([^#x22#x5C#x0A#x0D] | ECHAR | UCHAR)* '"' +STRING_LITERAL_QUOTE + : '"' ((~ [\u0022\u005C\u000A\u000D]) | ECHAR | UCHAR)* '"' + ; + +// [45] STRING_LITERAL_SINGLE_QUOTE ::= "'" ([^#x27#x5C#x0A#x0D] | ECHAR | UCHAR)* "'" +STRING_LITERAL_SINGLE_QUOTE + : '\'' ((~ [\u0027\u005C\u000A\u000D]) | ECHAR | UCHAR)* '\'' + ; + +// [48] UCHAR ::= '\u' HEX HEX HEX HEX | '\U' HEX HEX HEX HEX HEX HEX HEX HEX +UCHAR + : '\\u' HEX HEX HEX HEX + | '\\U' HEX HEX HEX HEX HEX HEX HEX HEX + ; + +// [49] ECHAR ::= '\' [tbnrf\"'] +ECHAR + : '\\' [tbnrf"'\\] + ; + +// [51] ANON ::= '[' WS* ']' +ANON_WS + : ' ' + | '\t' + | '\r' + | '\n' + ; + +ANON + : '[' ANON_WS* ']' + ; + +// [52] PN_CHARS_BASE ::= ... +PN_CHARS_BASE + : 'A' .. 'Z' + | 'a' .. 'z' + | '\u00C0' .. '\u00D6' + | '\u00D8' .. '\u00F6' + | '\u00F8' .. '\u02FF' + | '\u0370' .. '\u037D' + | '\u037F' .. '\u1FFF' + | '\u200C' .. '\u200D' + | '\u2070' .. '\u218F' + | '\u2C00' .. '\u2FEF' + | '\u3001' .. '\uD7FF' + | '\uF900' .. '\uFDCF' + | '\uFDF0' .. '\uFFFD' + ; + +// [53] PN_CHARS_U ::= PN_CHARS_BASE | '_' +PN_CHARS_U + : PN_CHARS_BASE + | '_' + ; + +// [54] PN_CHARS ::= PN_CHARS_U | '-' | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] +PN_CHARS + : PN_CHARS_U + | '-' + | [0-9] + | '\u00B7' + | [\u0300-\u036F] + | [\u203F-\u2040] + ; + +// [56] PN_LOCAL ::= (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? +PN_LOCAL + : (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? + ; + +// [57] PLX ::= PERCENT | PN_LOCAL_ESC +PLX + : PERCENT + | PN_LOCAL_ESC + ; + +// [58] PERCENT ::= '%' HEX HEX +PERCENT + : '%' HEX HEX + ; + +// [59] HEX ::= [0-9] | [A-F] | [a-f] +HEX + : [0-9] + | [A-F] + | [a-f] + ; + +// [60] PN_LOCAL_ESC ::= '\' ('_' | '~' | '.' | '-' | "!" | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%') +PN_LOCAL_ESC + : '\\' ( + '_' + | '~' + | '.' + | '-' + | '!' + | '$' + | '&' + | '\'' + | '(' + | ')' + | '*' + | '+' + | ',' + | ';' + | '=' + | '/' + | '?' + | '#' + | '@' + | '%' + ) + ; + +LC + : '#' ~[\r\n]* -> channel(HIDDEN) + ; \ No newline at end of file diff --git a/src/main/java/burp/Main.java b/src/main/java/burp/Main.java index d7ac659..dc52c0d 100644 --- a/src/main/java/burp/Main.java +++ b/src/main/java/burp/Main.java @@ -1,303 +1,290 @@ package burp; -import java.io.FileOutputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - +import burp.model.*; +import burp.model.rdf.*; +import burp.parse.Parse; +import burp.parse.PlanWiring; +import burp.reporting.*; +import burp.util.BURPConfiguration; +import burp.util.Util; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import org.apache.jena.datatypes.BaseDatatype; import org.apache.jena.query.Dataset; import org.apache.jena.query.DatasetFactory; -import org.apache.jena.rdf.model.Container; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFList; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.ResourceFactory; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; +import org.apache.jena.rdf.model.*; import org.apache.jena.riot.Lang; import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.util.ResourceUtils; -import org.apache.jena.vocabulary.RDF; - -import burp.model.GraphMap; -import burp.model.Iteration; -import burp.model.ObjectMap; -import burp.model.PredicateMap; -import burp.model.PredicateObjectMap; -import burp.model.ReferencingObjectMap; -import burp.model.SubjectMap; -import burp.model.TriplesMap; -import burp.model.gathermaputil.SubGraph; -import burp.parse.Parse; -import burp.util.BURPConfiguration; -import burp.vocabularies.RML; +import org.apache.jena.riot.RDFLanguages; +import org.jspecify.annotations.NonNull; +import picocli.CommandLine; -public class Main { +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; - private static List def = List.of(RML.defaultGraph); - - public static void main(String[] args) { - int exit = doMain(args); - System.out.println("System exiting with code: " + exit); - System.exit(exit); - } - - public static int doMain(String[] args) { - try { - // Process the configuration file - BURPConfiguration conf = new BURPConfiguration(args); - - // Parse the mapping file - List triplesmaps = Parse.parseMappingFile(conf.mappingFile); - - Dataset ds = generate(triplesmaps, conf.baseIRI); - - if (conf.outputFile != null) - RDFDataMgr.write(new FileOutputStream(conf.outputFile), ds, Lang.NQ); - else - RDFDataMgr.write(System.out, ds, Lang.NQ); - - // It all went well, thus return 0 - return 0; - } catch (Exception e) { - e.printStackTrace(); - System.err.println(e.getMessage()); - return 1; - } - } - - private static Dataset generate(List triplesmaps, String givenBaseIRI) { - Dataset ds = DatasetFactory.create(); - - // Execute the triples maps - for (TriplesMap tm : triplesmaps) { - String baseIRI = tm.baseIRI == null ? givenBaseIRI : tm.baseIRI; - - // Let sm be the subject map of the triples map - SubjectMap sm = tm.subjectMap; - - // Let sgm be the set of graph maps of subject maps - List sgm = sm.graphMaps; - - // For each iteration i in iterations, apply the following steps: - Iterator iter = tm.logicalSource.iterator(); - while (iter.hasNext()) { - Iteration i = iter.next(); - - // Let sgs be the set of the generated RDF terms - // that result from applying each term map in sgm to i - List sgs = sgm.isEmpty() ? def : new ArrayList(); - for (GraphMap gm : sgm) { - sgs.addAll(gm.generateTerms(i, baseIRI)); - } - - // Let subjects be the generated RDF terms that result from applying sm to i - List subjects = new ArrayList(); - - if (!sm.isGatherMap()) { - subjects.addAll(sm.generateTerms(i, baseIRI)); - } else { - for (SubGraph subgraph : sm.generateGatherMapGraphs(i, baseIRI)) { - subjects.add(subgraph.node); - addToGraphs(ds, sgs, subgraph); - } - } - - // For each subject in subjects and each class in classes, - // add triples to the output dataset as follows: - // subject: subject - // predicate: rdf:type - // object: class - // target graphs: If sgm is empty: rr:defaultgraph; otherwise: subject_graphs - - storeTriplesOfSubjectMaps(ds, sm.classes, subjects, sgs); - - // For each predicate-object map of the triples map, apply the following steps: - // Let predicates be the set of generated RDF terms that result - // from applying each of the predicate-object map's predicate maps to i - // Let objects be the set of generated RDF terms that result from applying each - // of the predicate-object map's object maps (but not referencing object maps) - // to i - // Let pogm be the set of graph maps of the predicate-object map - // Let pogs be the set of generated RDF terms that result from applying each - // graph map in pogm to i - // For each possible combination in subjects X predicates X objects, - // add triples to the output dataset as follows: - // s: subject - // p: predicate - // o: object - // Target graphs: If sgm and pogm are empty: rr:defaultGraph; otherwise: - // union of subject_graphs and predicate-object_graphs - - for (PredicateObjectMap pom : tm.predicateObjectMaps) { - List pogs = new ArrayList(); - for (GraphMap gm : pom.graphMaps) { - pogs.addAll(gm.generateTerms(i, baseIRI)); - } - - List graphs = def; - // If sgm and pogm are empty: rr:defaultGraph (see line above) - if (!sgm.isEmpty() || !pogs.isEmpty()) { - // otherwise: union of subject_graphs and predicate-object_graphs - // we do an additional test as sgs contains rml:defaultGraph if sgm is empty - // we do not want to include that - pogs.addAll(!sgm.isEmpty() ? sgs : new ArrayList<>()); - graphs = pogs; - } - - List predicates = new ArrayList(); - for (PredicateMap pm : pom.predicateMaps) { - predicates.addAll(pm.generateTerms(i, baseIRI)); - } - - List objects = new ArrayList(); - - for (ObjectMap om : pom.objectMaps) { - if (!om.isGatherMap()) { - objects.addAll(om.generateTerms(i, baseIRI)); - } else { - for (SubGraph subgraph : om.generateGatherMapGraphs(i, baseIRI)) { - objects.add(subgraph.node); - addToGraphs(ds, graphs, subgraph); - } - } - } - - for (ReferencingObjectMap rom : pom.refObjectMaps) { - objects.addAll(rom.generateTerms(i, baseIRI)); - } - - storetriples(ds, subjects, predicates, objects, graphs); - } - - } - - } - - removeJunk(ds); - - return ds; - } - - private static void removeJunk(Dataset ds) { - removeJunk(ds.getDefaultModel()); - Iterator iter = ds.listModelNames(); - while (iter.hasNext()) - removeJunk(ds.getNamedModel(iter.next())); - } - - private static void removeJunk(Model model) { - StmtIterator s = model.listStatements(null, RDF.type, RML.list); - while (s.hasNext()) { - Statement statement = s.next(); - s.remove(); - - Resource l = statement.getSubject(); - if (!l.hasProperty(RDF.first)) { - ResourceUtils.renameResource(l, RDF.nil.toString()); - } - } - } - - private static void storetriples(Dataset ds, List subjects, List predicates, - List objects, List graphs) { - - for (RDFNode s : subjects) { - Resource sr = s.asResource(); - for (RDFNode p : predicates) { - Property pp = ResourceFactory.createProperty(p.asResource().getURI()); - for (RDFNode o : objects) - for (RDFNode g : graphs) - getModel(ds, g).add(sr, pp, o); - } - } - } - - private static void storeTriplesOfSubjectMaps(Dataset ds, List classes, List subjects, - List graphs) { - - for (RDFNode s : subjects) { - Resource sr = s.asResource(); - - for (RDFNode c : classes) - for (RDFNode g : graphs) - getModel(ds, g).add(sr, RDF.type, c); - } - } - - private static void addToGraphs(Dataset ds, List graphs, SubGraph subgraph) { - for (RDFNode graph : graphs) { - Model g = getModel(ds, graph); - Resource r = subgraph.node.asResource(); - - if(subgraph.isList()) { - g.add(r, RDF.type, RML.list); - - try { - RDFList l = g.getList(r); - RDFList sub = subgraph.model.getList(r); - - List elements = sub.iterator().toList(); - for(RDFNode e : elements) { - l.add(e); - } - - while(true) { - if(sub.isEmpty()) - break; - sub = sub.removeHead(); - } - - g.add(subgraph.model); - } catch (Exception e) { - // List did not exist, so we can just add it - g.add(subgraph.model); - } - - } else { - Container c = null; - Container sub = null; - if(subgraph.isAlt()) { - g.add(r, RDF.type, RDF.Alt); - c = g.getAlt(r); - sub = subgraph.model.getAlt(r); - } else if(subgraph.isBag()) { - g.add(r, RDF.type, RDF.Bag); - c = g.getAlt(r); - sub = subgraph.model.getBag (r); - } else if(subgraph.isSeq()) { - g.add(r, RDF.type, RDF.Seq); - c = g.getAlt(r); - sub = subgraph.model.getSeq(r); - } - - // Now amend everything so that - // we append the containers - List elements = sub.iterator().toList(); - for(RDFNode e : elements) - c.add(e); - - StmtIterator iter = sub.listProperties(); - while(iter.hasNext()) { - Statement s = iter.next(); - if(s.getSubject().equals(r)) - if(s.getPredicate().getURI().startsWith("http://www.w3.org/1999/02/22-rdf-syntax-ns#_")) - iter.remove(); - } - - // We all all the remaining triples - g.add(subgraph.model); - - } - } - } - - private static Model getModel(Dataset ds, RDFNode g) { - if (g.equals(RML.defaultGraph)) - return ds.getDefaultModel(); - return ds.getNamedModel(g.asResource()); - } +public class Main { + public static void main(String[] args) { + Path cwd = Paths.get("").toAbsolutePath(); + int exit = doMain(args, cwd); + System.out.println("System exiting with code: " + exit); + System.exit(exit); + } + + public static int doMain(String[] args, Path currentWorkingDirectory) { + BURPConfiguration conf = new BURPConfiguration(); + CommandLine cmd = new CommandLine(conf); + try { + cmd.parseArgs(args); + if (cmd.isUsageHelpRequested()) { + cmd.usage(System.out); + return 0; + } else if (cmd.isVersionHelpRequested()) { + cmd.printVersionHelp(System.out); + return 0; + } + } catch (CommandLine.ParameterException ex) { + System.err.println(ex.getMessage()); + ex.getCommandLine().usage(System.err); + return 1; + } + + return doMain( + conf.mappingFile, + conf.outputFile, + conf.getOutputFormat(), + conf.reportFile, + conf.baseIRI, + currentWorkingDirectory + ); + } + + public static RmlExecutionReport report; + public static String baseIRI; + public static Path mappingFile; + + public static int doMain( + String mappingFilePath, + String outputFilePath, + Lang outputFormat, + String reportFilePath, + String baseIRIValue, + Path currentWorkingDirectory + ) { + report = new RmlExecutionReport(); + baseIRI = baseIRIValue; + mappingFile = Path.of(mappingFilePath); + + try { + Parse parser = new Parse(); + List triplesMaps; + try { + triplesMaps = parser.parseMappingFile(mappingFile, currentWorkingDirectory); + } catch (BurpException burpException) { + throw burpException; + } catch (Exception e) { + throw new BurpException(new RmlError( + "Unknown Error while Parsing " + mappingFilePath, + new Origin(), + RER.RDFMappingSyntaxError, + e + )); + } + if (triplesMaps.isEmpty()) { + report.getErrors().add(Errors.NoTriplesMap()); + } + + // Wire AST tree + MappingDocument document = new MappingDocument(triplesMaps); + PlanWiring.wire(document); + report.setExecutionPlan(document); + + Map statementsPerMap = new HashMap<>(); + for (TriplesMap map : triplesMaps) { + statementsPerMap.put(map, map.countGeneratedStatements); + } + report.getStatistics().setGeneratedStatementPerTriplesMap(statementsPerMap); + + List statements = document.generate(); + + statementsPerMap = new HashMap<>(); + for (TriplesMap map : triplesMaps) { + statementsPerMap.put(map, map.countGeneratedStatements); + } + report.getStatistics().setGeneratedStatementPerTriplesMap(statementsPerMap); + + List defaultStatements = new ArrayList<>(); + Map> statementsByTarget = new HashMap<>(); + + for (RdfStatement stmtLike : statements) { + if (stmtLike == null) continue; + if (stmtLike.targets() == null || stmtLike.targets().isEmpty()) { + defaultStatements.add(stmtLike); + } else { + for (LogicalTarget target : stmtLike.targets()) { + statementsByTarget.computeIfAbsent(target, k -> new ArrayList<>()).add(stmtLike); + } + } + } + + // Write default statements if there are any, or if we have an explicit output file (to create an empty file if needed) + if (!defaultStatements.isEmpty() || outputFilePath != null) { + Lang lang = outputFormat != null ? outputFormat : + (outputFilePath != null ? RDFLanguages.pathnameToLang(outputFilePath) : null); + if (lang == null) lang = Lang.NQ; + + if (outputFilePath != null) { + try (FileOutputStream output = new FileOutputStream(outputFilePath)) { + writeStatements(output, defaultStatements, lang, StandardCharsets.UTF_8); + } + } else { + writeStatements(System.out, defaultStatements, lang, StandardCharsets.UTF_8); + } + } + + // Write target statements + for (var entry : statementsByTarget.entrySet()) { + LogicalTarget target = entry.getKey(); + List stmts = entry.getValue(); + RMLTarget t = target.getTarget(); + if (t instanceof FilePathTarget fpt) { + File resolvedPath; + if (RML.MappingDirectory.equals(fpt.getRoot())) { + resolvedPath = mappingFile.getParent().resolve(fpt.getPath()).toFile(); + } else { + resolvedPath = currentWorkingDirectory.resolve(fpt.getPath()).toFile(); + } + + Lang targetLang = null; + if (target.getSerialization() != null) + targetLang = getTargetLang(target.getSerialization(), resolvedPath); + if (targetLang == null) targetLang = RDFLanguages.pathnameToLang(resolvedPath.getName()); + if (targetLang == null) targetLang = Lang.NQ; + + Charset targetEncoding = StandardCharsets.UTF_8; + if (target.getEncoding() != null) + targetEncoding = getStandardCharsets(target.getEncoding()); + + if (resolvedPath.getParentFile() != null) + resolvedPath.getParentFile().mkdirs(); + + final Lang finalLang = targetLang; + final Charset finalEncoding = targetEncoding; + Util.writeCompressedFile(resolvedPath, target.getCompression(), output -> { + writeStatements(output, stmts, finalLang, finalEncoding); + }); + } + } + } catch (BurpException e) { + report.getErrors().add(e.getError()); + } catch (Exception e) { + report.getErrors().add(Errors.UnexpectedError(e)); + } finally { + System.out.println(report.toString()); + if (reportFilePath != null && !reportFilePath.isBlank()) { + RdfReportGenerator.generateRdfReport(report, reportFilePath); + } + } + + return report.getErrors().isEmpty() ? 0 : 1; + } + + private static Lang getTargetLang(Resource targetSerialization, File resolvedPath) { + return switch (targetSerialization.getURI()) { + case "http://www.w3.org/ns/formats/N-Quads" -> Lang.NQ; + case "http://www.w3.org/ns/formats/N-Triples" -> Lang.NT; + case "http://www.w3.org/ns/formats/Turtle" -> Lang.TURTLE; + case "http://www.w3.org/ns/formats/JSON-LD" -> Lang.JSONLD; + case "http://www.w3.org/ns/formats/RDF_XML" -> Lang.RDFXML; + case "http://www.w3.org/ns/formats/RDF_JSON" -> Lang.RDFJSON; + case "http://www.w3.org/ns/formats/TriG" -> Lang.TRIG; + default -> RDFLanguages.pathnameToLang(resolvedPath.getName()); + }; + } + + private static @NonNull Charset getStandardCharsets(Resource encoding) { + if (encoding.equals(RML.UTF8)) return StandardCharsets.UTF_8; + else if (encoding.equals(RML.UTF16)) return StandardCharsets.UTF_16; + return StandardCharsets.UTF_8; + } + + private static void writeStatements(OutputStream output, List statements, Lang lang, Charset encoding) { + if (lang == Lang.NQ || lang == Lang.NT) { + NQuadsWriter.write(output, statements, encoding); + report.getStatistics().setGeneratedStatements((long) statements.size()); + return; + } + + Dataset ds = generateDataset(statements); + if (RDFLanguages.isQuads(lang)) { + RDFDataMgr.write(output, ds, lang); + } else { + RDFDataMgr.write(output, ds.getDefaultModel(), lang); + } + } + + private static Dataset generateDataset(List statements) { + Dataset ds = DatasetFactory.create(); + + Map bnodeMap = new HashMap<>(); + + for (RdfStatement stmt : statements) { + IRITerm graph = stmt.getGraph(); + Model model; + if (graph == null || RML.defaultGraph.getURI().equals(graph.uri())) { + model = ds.getDefaultModel(); + } else { + model = ds.getNamedModel(graph.uri()); + } + + BlankNodeOrIRI sub = stmt.getSubject(); + Resource s; + if (sub instanceof IRITerm) { + s = ResourceFactory.createResource(((IRITerm) sub).uri()); + } else if (sub instanceof BlankNodeTerm) { + String id = ((BlankNodeTerm) sub).id(); + s = bnodeMap.computeIfAbsent(id, k -> ResourceFactory.createResource()); + } else { + throw new RuntimeException("Subject must be URI or BlankNode"); + } + + Property p = ResourceFactory.createProperty(stmt.getPredicate().uri()); + + Term obj = stmt.getObject(); + RDFNode o; + switch (obj) { + case IRITerm iriTerm -> o = ResourceFactory.createResource(iriTerm.uri()); + case BlankNodeTerm blankNodeTerm -> { + String id = blankNodeTerm.id(); + o = bnodeMap.computeIfAbsent(id, k -> ResourceFactory.createResource()); + } + case LiteralTerm lit -> { + if (lit.language() != null) { + o = ResourceFactory.createLangLiteral(lit.value(), lit.language()); + } else if (lit.datatype() != null) { + o = ResourceFactory.createTypedLiteral(lit.value(), new BaseDatatype(lit.datatype().uri())); + } else { + o = ResourceFactory.createTypedLiteral(lit.value()); + } + } + case null, default -> throw new RuntimeException("Unsupported object term " + obj); + } + model.add(s, p, o); + } + + long count = ds.getDefaultModel().size(); + Iterator names = ds.listNames(); + while (names.hasNext()) { + count += ds.getNamedModel(names.next()).size(); + } + report.getStatistics().setGeneratedStatements(count); + + return ds; + } } diff --git a/src/main/java/burp/NQuadsWriter.java b/src/main/java/burp/NQuadsWriter.java new file mode 100644 index 0000000..1ffbfd2 --- /dev/null +++ b/src/main/java/burp/NQuadsWriter.java @@ -0,0 +1,162 @@ +package burp; + +import burp.model.RdfStatement; +import burp.model.rdf.*; +import burp.vocabularies.RML; + +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.List; + +public class NQuadsWriter { + + public static void write(OutputStream output, List statements, Charset charset) { + if (charset == null) { + charset = StandardCharsets.UTF_8; + } + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, charset)); + try { + for (RdfStatement statement : statements) { + writer.append(serializeStatement(statement)).append('\n'); + } + writer.flush(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + static String serializeStatement(RdfStatement statement) { + String subject = serializeSubject(statement.getSubject()); + String predicate = serializeIRI(statement.getPredicate()); + String obj = serializeObject(statement.getObject()); + String graph = serializeGraph(statement.getGraph()); + if (graph == null) { + return subject + " " + predicate + " " + obj + " ."; + } else { + return subject + " " + predicate + " " + obj + " " + graph + " ."; + } + } + + private static String serializeSubject(BlankNodeOrIRI subject) { + if (subject instanceof IRITerm) { + return serializeIRI((IRITerm) subject); + } else if (subject instanceof BlankNodeTerm) { + return serializeBlankNode((BlankNodeTerm) subject); + } else { + throw new IllegalArgumentException("Unsupported subject term " + subject); + } + } + + private static String serializeObject(Term obj) { + return switch (obj) { + case IRITerm iriTerm -> serializeIRI(iriTerm); + case BlankNodeTerm blankNodeTerm -> serializeBlankNode(blankNodeTerm); + case LiteralTerm literalTerm -> serializeLiteral(literalTerm); + case null, default -> throw new IllegalArgumentException("Unsupported object term " + obj); + }; + } + + private static String serializeGraph(IRITerm graph) { + if (graph == null || RML.defaultGraph.getURI().equals(graph.uri())) return null; + return serializeIRI(graph); + } + + private static String serializeIRI(IRITerm iri) { + return "<" + iri.uri() + ">"; + } + + private static String serializeBlankNode(BlankNodeTerm blankNode) { + String label = blankNode.id().startsWith("_:") ? blankNode.id() : "_:" + blankNode.id(); + return normalizeBlankNodeLabel(label); + } + + private static boolean isValidBlankNodeLabel(String label) { + if (!label.startsWith("_:") || label.length() < 3) return false; + + String id = label.substring(2); + + char firstChar = id.charAt(0); + if (!isValidFirstBlankNodeChar(firstChar)) return false; + + if (id.length() == 1) return true; + + for (int i = 1; i < id.length(); i++) { + if (!isValidEncodableBlankNodeChar(id.charAt(i))) return false; + } + + return true; + } + + private static boolean isValidFirstBlankNodeChar(char c) { + return Character.isLetterOrDigit(c) || c == '_'; + } + + private static boolean isValidEncodableBlankNodeChar(char c) { + return Character.isLetterOrDigit(c) || c == '_' || c == '-'; + } + + private static String normalizeBlankNodeLabel(String label) { + if (isValidBlankNodeLabel(label)) { + return label; + } else { + String id = label.substring(2); + StringBuilder encoded = new StringBuilder("_:"); + + for (int i = 0; i < id.length(); i++) { + char ch = id.charAt(i); + if (isValidEncodableBlankNodeChar(ch)) { + encoded.append(ch); + } else { + encoded.append('_'); + String hex = Integer.toHexString((int) ch); + if (hex.length() < 2) encoded.append('0'); + encoded.append(hex); + } + } + return encoded.toString(); + } + } + + private static String serializeLiteral(LiteralTerm literal) { + String lexicalForm = escapeLiteral(literal.value()); + String suffix = ""; + if (literal.language() != null) { + suffix = "@" + literal.language(); + } else if (literal.datatype() != null && !literal.datatype().uri().equals("http://www.w3.org/2001/XMLSchema#string")) { + suffix = "^^" + serializeIRI(literal.datatype()); + } + return "\"" + lexicalForm + "\"" + suffix; + } + + static String escapeLiteral(String value) { + StringBuilder escaped = new StringBuilder(value.length()); + for (int i = 0; i < value.length(); i++) { + char ch = value.charAt(i); + int chCode = value.codePointAt(i); + switch (ch) { + case '\\': escaped.append("\\\\"); break; + case '"': escaped.append("\\\""); break; + case '\n': escaped.append("\\n"); break; + case '\r': escaped.append("\\r"); break; + case '\t': escaped.append("\\t"); break; + case '\b': escaped.append("\\b"); break; + case '\u000C': escaped.append("\\f"); break; + default: + if (chCode < 0x20) { + escaped.append("\\u"); + String hex = Integer.toHexString(ch); + escaped.repeat("0", 4 - hex.length()); + escaped.append(hex); + } else { + escaped.append(ch); + } + break; + } + } + return escaped.toString(); + } +} diff --git a/src/main/java/burp/ls/CSVIteration.java b/src/main/java/burp/ls/CSVIteration.java new file mode 100644 index 0000000..62a2f06 --- /dev/null +++ b/src/main/java/burp/ls/CSVIteration.java @@ -0,0 +1,36 @@ +package burp.ls; + +import burp.model.Iteration; +import com.opencsv.CSVWriter; + +import java.io.StringWriter; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +public class CSVIteration extends Iteration { + public final Map map = new LinkedHashMap<>(); + + public CSVIteration(String[] header, String[] rec, Set nulls) { + super(nulls); + if (header != null) { + for (int i = 0; i < header.length; i++) { + map.put(header[i], rec[i]); + } + } + } + + @Override + public String asString() { + StringWriter stringWriter = new StringWriter(); + try (CSVWriter writer = new CSVWriter(stringWriter)) { + String[] header = map.keySet().toArray(new String[0]); + writer.writeNext(header); + String[] rec = map.values().toArray(new String[0]); + writer.writeNext(rec); + } catch (Exception e) { + throw new RuntimeException("Error representing CSV iteration as CSV.", e); + } + return stringWriter.toString(); + } +} diff --git a/src/main/java/burp/ls/CSVReference.java b/src/main/java/burp/ls/CSVReference.java new file mode 100644 index 0000000..09b245d --- /dev/null +++ b/src/main/java/burp/ls/CSVReference.java @@ -0,0 +1,40 @@ +package burp.ls; + +import burp.model.Iteration; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; + +import java.util.Collections; +import java.util.List; + +public class CSVReference extends Reference { + public CSVReference(String reference, Origin origin) { + super(reference, origin); + } + + @Override + public List getValues(Iteration i) { + if (!(i instanceof CSVIteration csvIteration)) { + throw new IllegalArgumentException("CSVReference " + reference + " can only be used with CSVIteration."); + } + + if (!csvIteration.map.containsKey(reference)) { + String availableRefs = String.join(", ", csvIteration.map.keySet()); + throw new BurpException( + new RmlError( + "Attribute " + reference + " does not exist.\n" + + "Available references are: " + availableRefs, + origin, + RER.ReferenceFormulationExecutionError + ) + ); + } + + Object o = csvIteration.map.get(reference); + + return csvIteration.nulls.contains(o) ? Collections.emptyList() : Collections.singletonList(o); + } +} diff --git a/src/main/java/burp/ls/CSVSource.java b/src/main/java/burp/ls/CSVSource.java index 6910aaf..e1d17de 100644 --- a/src/main/java/burp/ls/CSVSource.java +++ b/src/main/java/burp/ls/CSVSource.java @@ -1,108 +1,88 @@ package burp.ls; -import java.io.FileReader; -import java.io.StringWriter; -import java.util.*; -import java.util.stream.Collectors; - +import burp.model.Iteration; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import burp.vocabularies.RML; import com.opencsv.CSVParserBuilder; import com.opencsv.CSVReader; import com.opencsv.CSVReaderBuilder; +import org.apache.commons.io.input.BOMInputStream; +import org.apache.jena.rdf.model.Resource; -import burp.model.Iteration; -import com.opencsv.CSVWriter; - -class CSVSource extends FileBasedLogicalSource { - - public char delimiter = ','; - public Boolean firstLineIsHeader = true; - - @Override - public Iterator iterator() { - try { - if (iterations == null) { - iterations = new ArrayList<>(); - - FileReader fr = new FileReader(getDecompressedFile(), encoding); - - CSVReader reader = new CSVReaderBuilder(fr) - .withCSVParser(new CSVParserBuilder() - .withSeparator(delimiter) - .build() - ).build(); - - - List all = reader.readAll(); - reader.close(); - - String[] header = null; - - // IF THE FIRST LINE IS THE HEADER, REMOVE THE FIRST FROM CSV - // OTHERWISE, CREATE A LIST OF NUMBERED COLUMNS STARTING FROM ONE - if(firstLineIsHeader) - header = all.remove(0); - else { - int n = all.get(0).length; - header = new String[n]; - for(int i = 0; i < n; i++) - header[i] = Integer.toString(i + 1); - } - - for (String[] rec : all) { - iterations.add(new CSVIteration(header, rec, nulls)); - } - } - return iterations.iterator(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - -} - -class CSVIteration extends Iteration { +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; - // Use a LinkedHashMap to preserve a correspondence between keys and values - private final Map map = new LinkedHashMap<>(); - - protected CSVIteration(String[] header, String[] rec, Set nulls) { - super(nulls); +public class CSVSource extends FileBasedLogicalSource { + public char delimiter = ','; + public boolean firstLineIsHeader = true; - for(int i = 0; i < header.length; i++) { - map.put(header[i], rec[i]); - } - } - - @Override - public List getValuesFor(String reference) { - List l = new ArrayList<>(); - if(!map.containsKey(reference)) - throw new RuntimeException("Attribute " + reference + " does not exist."); - - String o = map.get(reference); - if(nulls == null || !nulls.contains(o)) - l.add(o); - - return l; - } + @Override + public Iterable iterator() { + try { + if (iterations == null) { + iterations = new ArrayList<>(); + + FileInputStream fileReader = new FileInputStream(getDecompressedFile()); + BOMInputStream bomStream = BOMInputStream.builder().setInputStream(fileReader).get(); + InputStreamReader reader = new InputStreamReader(bomStream, encoding); + + CSVReader csvReader = new CSVReaderBuilder(reader) + .withCSVParser( + new CSVParserBuilder() + .withSeparator(delimiter) + .build() + ).build(); + + List all = csvReader.readAll(); + csvReader.close(); + + if (all.isEmpty()) { + return iterations; + } + + // IF THE FIRST LINE IS THE HEADER, REMOVE THE FIRST FROM CSV + // OTHERWISE, CREATE A LIST OF NUMBERED COLUMNS STARTING FROM ONE + String[] header; + if (firstLineIsHeader) { + header = all.removeFirst(); + } else { + int columnCount = all.getFirst().length; + header = new String[columnCount]; + for (int i = 0; i < columnCount; i++) { + header[i] = String.valueOf(i + 1); + } + } + + for (String[] rec : all) { + iterations.add(new CSVIteration(header, rec, nulls)); + } + } + return iterations; + } catch (BurpException e) { + throw e; + } catch (Exception e) { + throw new BurpException(new RmlError(e.getMessage(), new Origin(this, null), RER.Error, e)); + } + } - @Override - public List getStringsFor(String reference) { - return getValuesFor(reference).stream().map(Object::toString).collect(Collectors.toList()); - } + @Override + public Resource getReferenceFormulation() { + return RML.CSV; + } @Override - public String asString() { - StringWriter stringWriter = new StringWriter(); - try (CSVWriter writer = new CSVWriter(stringWriter)) { - String[] header = map.keySet().toArray(new String[0]); - writer.writeNext(header); - String[] rec = map.values().toArray(new String[0]); - writer.writeNext(rec); - } catch(Exception e) { - throw new RuntimeException("Error representing CSV iteration as CSV."); - } - return stringWriter.toString(); + public void setReferenceFormulation(Resource referenceFormulation) { + // do nothing } + @Override + public Reference buildExportedReference(String reference, Origin origin) { + return new CSVReference(reference, origin); + } } \ No newline at end of file diff --git a/src/main/java/burp/ls/CSVSourceProvider.java b/src/main/java/burp/ls/CSVSourceProvider.java new file mode 100644 index 0000000..5e2bc2a --- /dev/null +++ b/src/main/java/burp/ls/CSVSourceProvider.java @@ -0,0 +1,128 @@ +package burp.ls; + +import burp.model.Iteration; +import burp.model.LogicalSource; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.reporting.StatementPart; +import burp.vocabularies.CSVW; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import com.google.auto.service.AutoService; +import com.opencsv.CSVReader; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; + +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +@SuppressWarnings("unused") +@AutoService(LogicalSourceProvider.class) +public class CSVSourceProvider implements LogicalSourceProvider { + @Override + public boolean supports(Resource referenceFormulation) { + return RML.CSV.equals(referenceFormulation); + } + + @Override + public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { + Resource s = ls.getPropertyResourceValue(RML.source); + CSVSource source = new CSVSource(); + FileBaseSourceProvider.FileAndOrigin fileAndOrigin = FileBaseSourceProvider.getFile(s, mappingDirectory, currentWorkingDirectory); + source.file = fileAndOrigin.file; + source.fileOriginStmts = fileAndOrigin.origin; + source.compression = FileBaseSourceProvider.getCompression(s); + + if (s.hasProperty(RDF.type, CSVW.Table)) { + // IF IT IS A CSVW TABLE, THEN LOOK FOR THE ENCODING IN THE DIALECT + if (s.hasProperty(CSVW.dialect)) { + Resource r = s.getPropertyResourceValue(CSVW.dialect); + if (r.hasProperty(CSVW.encoding) && !ls.hasProperty(RML.encoding)) { + Statement encodingStmt = r.getProperty(CSVW.encoding); + String encoding = encodingStmt.getString(); + switch (encoding) { + case "UTF-8": + source.encoding = StandardCharsets.UTF_8; + break; + case "UTF-16": + source.encoding = StandardCharsets.UTF_16; + break; + default: + throw new BurpException( + new RmlError( + "Provided Character Set " + r + " not supported.", + new Origin(encodingStmt, StatementPart.Predicate, StatementPart.Object), + RER.Error, null + ) + ); + } + } + + if (r.hasProperty(CSVW.delimiter)) { + // TODO: According to CSVW, the delimiter is a string. But all examples are chars. + source.delimiter = r.getProperty(CSVW.delimiter).getChar(); + } + + if (r.hasProperty(CSVW.header)) { + source.firstLineIsHeader = r.getProperty(CSVW.header).getBoolean(); + } + + if (r.hasProperty(CSVW.NULL) && !ls.hasProperty(RML.NULL)) { + r.listProperties(CSVW.NULL).forEachRemaining((Consumer) t -> { + if (t.getObject().isResource()) { + // WE ASSUME WE CAN HAVE RESOURCES AS NULL FOR + // SPARQL SOURCES + source.nulls.add(t.getObject().asResource()); + } else { + source.nulls.add(t.getObject().asLiteral().getValue()); + } + }); + } + // TODO: Natural RDF mapping of CSV values + } else { + source.encoding = StandardCharsets.UTF_8; + } + } + + source.encoding = FileBaseSourceProvider.getEncoding(ls); + source.nulls.addAll(FileBaseSourceProvider.getNullValues(s)); + + return source; + } + + @Override + public List parseStringPayload(String payload, String iterator, Origin referenceFormulationOrigin) { + try { + CSVReader reader = new CSVReader(new StringReader(payload)); + List all = reader.readAll(); + reader.close(); + if (all.isEmpty()) return Collections.emptyList(); + String[] header = all.remove(0); + return all.stream() + .map(it -> (Iteration) new CSVIteration(header, it, Collections.emptySet())) + .collect(Collectors.toList()); + } catch (Exception e) { + throw new BurpException( + new RmlError( + "Unexpected Error while changing iterator to type CSV, iteration content " + payload + ".", + referenceFormulationOrigin, + RER.Error, + e + ) + ); + } + } + + @Override + public Reference buildReference(String reference, Origin origin, Origin referenceFormulationOrigin) { + return new CSVReference(reference, origin); + } +} diff --git a/src/main/java/burp/ls/FileBaseSourceProvider.java b/src/main/java/burp/ls/FileBaseSourceProvider.java new file mode 100644 index 0000000..7708716 --- /dev/null +++ b/src/main/java/burp/ls/FileBaseSourceProvider.java @@ -0,0 +1,128 @@ +package burp.ls; + +import burp.reporting.*; +import burp.vocabularies.CSVW; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.DCAT; +import org.apache.jena.vocabulary.RDF; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +public class FileBaseSourceProvider { + + public static Resource getCompression(Resource source) { + Resource compression = source.getPropertyResourceValue(RML.compression); + if (compression == null || RML.none.equals(compression)) { + return RML.none; + } + if (RML.zip.equals(compression) || RML.gzip.equals(compression) || RML.targz.equals(compression) || RML.tarxz.equals(compression)) { + return compression; + } + throw new RuntimeException("Provided compression " + compression + " not supported."); + } + + public static Charset getEncoding(Resource source) { + Resource enc = source.getPropertyResourceValue(RML.encoding); + if (enc == null || RML.UTF8.equals(enc)) { + return StandardCharsets.UTF_8; + } + if (RML.UTF16.equals(enc)) { + return StandardCharsets.UTF_16; + } + throw new BurpException( + new RmlError( + "Provided Character Set " + enc + " not supported.", + new Origin(source.getProperty(RML.encoding), StatementPart.Predicate, StatementPart.Object), + RER.Error + ) + ); + } + + public static List getNullValues(Resource source) { + List os = new ArrayList<>(); + source.listProperties(RML.NULL).forEachRemaining(stmt -> { + RDFNode obj = stmt.getObject(); + // WE ASSUME WE CAN HAVE RESOURCES AS NULL FOR SPARQL SOURCES + if (obj.isResource()) { + os.add(obj.asResource()); + } else { + os.add(obj.asLiteral().getValue()); + } + }); + return os; + } + + public static class FileAndOrigin { + public final SourceFile file; + public final List origin; + + public FileAndOrigin(SourceFile file, List origin) { + this.file = file; + this.origin = origin; + } + } + + public static FileAndOrigin getFile(Resource source, Path mappingDir, Path currentWorkingDir) { + if (source.hasProperty(RDF.type, RML.RelativePathSource) || source.hasProperty(RDF.type, RML.FilePath)) { + Statement pathStmt = source.getProperty(RML.path); + String file; + if (pathStmt != null && pathStmt.getObject().isLiteral()) { + file = pathStmt.getLiteral().getString(); + } else { + Origin origin = pathStmt != null ? new Origin(pathStmt, StatementPart.Object) : null; + throw new BurpException(new RmlError("The path must be a plain literal", origin, RER.MappingError)); + } + + Statement rootStmt = source.getProperty(RML.root); + RDFNode root = rootStmt != null ? rootStmt.getObject() : null; + + Path resolved; + if (RML.MappingDirectory.equals(root)) { + resolved = mappingDir.resolve(file); + } else if (root == null || RML.CurrentWorkingDirectory.equals(root)) { + resolved = currentWorkingDir.resolve(file); + } else if (root.isLiteral()) { + var literal = root.asLiteral(); + if (literal.getLanguage() != null && !literal.getLanguage().isEmpty() || literal.getDatatypeURI() != null && !literal.getDatatypeURI().equals("http://www.w3.org/2001/XMLSchema#string")) { + throw new RuntimeException("rml:root must be a plain literal or string " + literal); + } + resolved = Path.of(literal.getString()).resolve(file); + } else { + throw new RuntimeException("RelativePathSource specified root " + root + " is not supported."); + } + + List originList = new ArrayList<>(); + if (pathStmt != null) originList.add(StatementParts.fromPredicateObject(pathStmt)); + if (rootStmt != null) originList.add(StatementParts.fromPredicateObject(rootStmt)); + + return new FileAndOrigin(new SourceFile.Local(resolved.toString()), originList); + } + + if (source.hasProperty(RDF.type, DCAT.Distribution)) { + String url = source.getPropertyResourceValue(DCAT.downloadURL).getURI(); + return new FileAndOrigin(new SourceFile.Remote(url), List.of(StatementParts.fromPredicateObject(source.getProperty(DCAT.downloadURL)))); + } + + if (source.hasProperty(RDF.type, CSVW.Table)) { + String url = source.getProperty(CSVW.url).getLiteral().getString(); + return new FileAndOrigin(new SourceFile.Remote(url), List.of(StatementParts.fromPredicateObject(source.getProperty(CSVW.url)))); + } + + Resource type = source.getPropertyResourceValue(RDF.type); + throw new BurpException( + new RmlError( + "Source type (" + type + ") not yet implemented in source " + source, + new Origin(source.getProperty(RDF.type), StatementPart.Object), + RER.UnsupportedMapping + ) + ); + } +} diff --git a/src/main/java/burp/ls/FileBasedLogicalSource.java b/src/main/java/burp/ls/FileBasedLogicalSource.java index b9c6f6c..b4b49e2 100644 --- a/src/main/java/burp/ls/FileBasedLogicalSource.java +++ b/src/main/java/burp/ls/FileBasedLogicalSource.java @@ -1,25 +1,39 @@ package burp.ls; +import burp.model.Iteration; +import burp.model.LogicalSource; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.reporting.StatementParts; +import burp.util.Util; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; + +import java.io.File; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.Collections; import java.util.List; -import org.apache.jena.rdf.model.Resource; +public abstract class FileBasedLogicalSource extends LogicalSource { -import burp.model.Iteration; -import burp.model.LogicalSource; -import burp.util.Util; -import burp.vocabularies.RML; + public List iterations = null; -abstract class FileBasedLogicalSource extends LogicalSource { + public SourceFile file = null; - protected List iterations = null; - public String file; - public Charset encoding = StandardCharsets.UTF_8; - public Resource compression = RML.none; + public List fileOriginStmts = Collections.emptyList(); - public String getDecompressedFile() { - return Util.getDecompressedFile(file, compression); - } + public Charset encoding = StandardCharsets.UTF_8; + public Resource compression = RML.none; + public String getDecompressedFile() { + Origin origin = new Origin(this, fileOriginStmts); + File fileFile = file != null ? file.getFile(fileOriginStmts) : null; + if (fileFile == null || !fileFile.exists()) { + throw new BurpException(new RmlError("SourceAccessError: Cannot obtain file " + file, origin, RER.SourceAccessError)); + } + return Util.getDecompressedFile(fileFile.getAbsolutePath(), compression); + } } \ No newline at end of file diff --git a/src/main/java/burp/ls/JSONSource.java b/src/main/java/burp/ls/JSONSource.java deleted file mode 100644 index eec3580..0000000 --- a/src/main/java/burp/ls/JSONSource.java +++ /dev/null @@ -1,100 +0,0 @@ -package burp.ls; - -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.jayway.jsonpath.Configuration; -import com.jayway.jsonpath.DocumentContext; -import com.jayway.jsonpath.JsonPath; -import com.jayway.jsonpath.Option; -import com.jayway.jsonpath.PathNotFoundException; -import com.jayway.jsonpath.spi.json.JacksonJsonProvider; -import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; - -import burp.model.Iteration; -import net.minidev.json.JSONObject; - -class JSONSource extends FileBasedLogicalSource { - - public static final Configuration configuration = Configuration.builder() - .mappingProvider(new JacksonMappingProvider()) - .jsonProvider(new JacksonJsonProvider()) - .build() - .addOptions(Option.ALWAYS_RETURN_LIST); - - @Override - public Iterator iterator() { - try { - if (iterations == null) { - iterations = new ArrayList<>(); - String contents = Files.readString(Paths.get(getDecompressedFile()), encoding); - - List> nodes = JsonPath.using(configuration).parse(contents).read(iterator); - for (Map n : nodes) { - iterations.add(new JSONIteration(JSONObject.toJSONString(n), nulls)); - } - } - return iterations.iterator(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - -} - -class JSONIteration extends Iteration { - - private DocumentContext doc = null; - - protected JSONIteration(String json, Set nulls) { - super(nulls); - doc = JsonPath.using(JSONSource.configuration).parse(json); - } - - @Override - public List getValuesFor(String reference) { - List l2 = new ArrayList<>(); - try { - List l = doc.read(reference); - for(Object o : l) { - if (o instanceof List) - throw new RuntimeException("Data error: reference retrieved an array"); - if (o != null && (nulls == null || !nulls.contains(o))) - l2.add(o); - } - } catch (PathNotFoundException e) { - // No data, silently ignore - e.printStackTrace(); - } - return l2; - } - - @Override - public List getStringsFor(String reference) { - List l2 = new ArrayList<>(); - try { - List l = doc.read(reference); - for(Object o : l) { - if (o instanceof List) - throw new RuntimeException("Data error: reference retrieved an array"); - if (o != null && (nulls == null || !nulls.contains(o))) - l2.add(o.toString()); - } - } catch (PathNotFoundException e) { - // No data, silently ignore - e.printStackTrace(); - } - return l2; - } - - @Override - public String asString() { - return doc.jsonString(); - } - -} \ No newline at end of file diff --git a/src/main/java/burp/ls/JSONSourceProvider.java b/src/main/java/burp/ls/JSONSourceProvider.java new file mode 100644 index 0000000..72d3987 --- /dev/null +++ b/src/main/java/burp/ls/JSONSourceProvider.java @@ -0,0 +1,99 @@ +package burp.ls; + +import at.asitplus.jsonpath.JsonPath; +import at.asitplus.jsonpath.core.JsonPathCompilerException; +import at.asitplus.jsonpath.core.NodeListEntry; +import at.asitplus.jsonpath.implementation.AntlrJsonPathCompiler; +import burp.model.Iteration; +import burp.model.LogicalSource; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import com.google.auto.service.AutoService; +import kotlinx.serialization.json.Json; +import kotlinx.serialization.json.JsonElement; +import org.apache.jena.rdf.model.Resource; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@AutoService(LogicalSourceProvider.class) +public class JSONSourceProvider implements LogicalSourceProvider { + + @Override + public boolean supports(Resource referenceFormulation) { + return RML.JSONPath.equals(referenceFormulation); + } + + @Override + public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { + Resource source = ls.getPropertyResourceValue(RML.source); + String iterator = ls.getProperty(RML.iterator).getLiteral().getString(); + + FileBaseSourceProvider.FileAndOrigin fileAndOrigin = FileBaseSourceProvider.getFile(source, mappingDirectory, currentWorkingDirectory); + + JSONSourceRFC jsonSource = new JSONSourceRFC(); + jsonSource.file = fileAndOrigin.file; + jsonSource.fileOriginStmts = fileAndOrigin.origin; + jsonSource.iterator = iterator; + jsonSource.encoding = FileBaseSourceProvider.getEncoding(source); + jsonSource.compression = FileBaseSourceProvider.getCompression(source); + jsonSource.getNulls().addAll(FileBaseSourceProvider.getNullValues(source)); + + return jsonSource; + } + + @Override + public List parseStringPayload(String payload, String iterator, Origin referenceFormulationOrigin) { + try { + JsonElement jsonContent = Json.Default.parseToJsonElement(payload); + if (iterator == null) { + throw new BurpException( + new RmlError( + "Iterator is null", referenceFormulationOrigin, + RER.MappingError + ) + ); + } + JsonPath jsonPath = new JsonPath( + iterator, new AntlrJsonPathCompiler(), s -> null + ); + List results = jsonPath.query(jsonContent); + List iterationList = new ArrayList<>(); + for (NodeListEntry it : results) { + iterationList.add(new JSONIteration(it, Collections.emptySet())); + } + return iterationList; + } catch (Exception e) { + if (e instanceof BurpException) throw (BurpException) e; + if (e instanceof JsonPathCompilerException || e instanceof IllegalArgumentException) { + throw new BurpException( + new RmlError( + "Syntax error in JSONPath `" + iterator + "`", + referenceFormulationOrigin, + RER.ReferenceFormulationSyntaxError, + e + ) + ); + } + throw new BurpException( + new RmlError( + "Unexpected Error while changing iterator to JSONPath, iteration content " + payload + ".", + referenceFormulationOrigin, + RER.Error, + e + ) + ); + } + } + + @Override + public Reference buildReference(String reference, Origin origin, Origin referenceFormulationOrigin) { + return new JSONPathReference(reference, origin); + } +} diff --git a/src/main/java/burp/ls/JSONSourceRFC.java b/src/main/java/burp/ls/JSONSourceRFC.java new file mode 100644 index 0000000..24d505b --- /dev/null +++ b/src/main/java/burp/ls/JSONSourceRFC.java @@ -0,0 +1,176 @@ +package burp.ls; + +import at.asitplus.jsonpath.JsonPath; +import at.asitplus.jsonpath.core.JsonPathCompilerException; +import at.asitplus.jsonpath.core.JsonPathQueryException; +import at.asitplus.jsonpath.core.NodeListEntry; +import at.asitplus.jsonpath.implementation.AntlrJsonPathCompiler; +import burp.model.Iteration; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import kotlinx.serialization.json.*; +import org.apache.jena.rdf.model.Resource; + +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class JSONSourceRFC extends FileBasedLogicalSource { + public String iterator; + public Origin iteratorOrigin; + + @Override + public Iterable iterator() { + try { + String decompressedFile = getDecompressedFile(); + + String jsonString; + if (decompressedFile.endsWith(".bson")) { + throw new RuntimeException("BSON not supported."); + } else { + jsonString = Files.readString(Paths.get(decompressedFile), encoding); + } + + JsonElement jsonContent = Json.Default.parseToJsonElement(jsonString); + + JsonPath jsonPath = new JsonPath(iterator, new AntlrJsonPathCompiler(), JsonPath.Companion.getDefaultFunctionExtensionRepository()::getExtension); + List results = jsonPath.query(jsonContent); + + List iterationList = new ArrayList<>(); + for (NodeListEntry it : results) { + iterationList.add(new JSONIteration(it, getNulls())); + } + return iterationList; + } catch (BurpException burpException) { + throw burpException; + } catch (Exception exception) { + throw new BurpException(new RmlError("Error in JSON preparation of iterator.", new Origin(this, null), RER.LogicalSourceError, exception, null)); + } + } + + @Override + public Resource getReferenceFormulation() { + return RML.JSONPath; + } + + @Override + public void setReferenceFormulation(Resource value) { + } + + @Override + public Reference buildExportedReference(String reference, Origin origin) { + return new JSONPathReference(reference, origin); + } + +} + +class JSONPathReference extends Reference { + private final JsonPath compiledPath; + + public JSONPathReference(String reference, Origin origin) { + super(reference, origin); + JsonPath cp = null; + try { + if (reference != null) { + cp = new JsonPath(reference, new AntlrJsonPathCompiler(), JsonPath.Companion.getDefaultFunctionExtensionRepository()::getExtension); + } + } catch (Exception ex) { + if (ex instanceof JsonPathCompilerException) { + throw new BurpException(new RmlError("Syntax error in JSONPath `" + reference + "`", origin, RER.ReferenceFormulationSyntaxError, ex)); + } else if (ex instanceof BurpException burpException) { + throw burpException; + } else { + throw new BurpException(new RmlError("Unexpected Error in JSONPath preprocessing.", origin, RER.Error, ex)); + } + } + this.compiledPath = cp; + } + + @Override + public List getValues(Iteration i) { + assert i instanceof JSONIteration : "JSONPathReference can only be used with JSONIteration."; + + JSONIteration jsonIteration = (JSONIteration) i; + if (compiledPath == null) return new ArrayList<>(); + + List resultList = new ArrayList<>(); + try { + List entries = compiledPath.query(jsonIteration.json.getValue()); + for (NodeListEntry entry : entries) { + JsonElement jsonElement = entry.getValue(); + switch (jsonElement) { + case JsonArray jsonElements -> throw new BurpException( + new RmlError( + "Data error: reference retrieved an array with `" + reference + "`", + origin, + RER.ReferenceFormulationExecutionError + ) + ); + case JsonObject jsonObject -> resultList.add(jsonElement.toString()); + case JsonNull jsonNull -> { + // ignore nulls + } + case JsonPrimitive p -> { + Object content; + if (p.isString()) { + content = p.getContent(); + } else { + String strContent = p.getContent(); + try { + if (strContent.contains(".")) { + content = Double.parseDouble(strContent); + } else if (strContent.equalsIgnoreCase("true") || strContent.equalsIgnoreCase("false")) { + content = Boolean.parseBoolean(strContent); + } else { + content = Long.parseLong(strContent); + } + } catch (NumberFormatException ignored) { + content = strContent; + } + } + if (!jsonIteration.getNulls().contains(content)) { + resultList.add(content); + } + } + default -> { + } + } + } + } catch (Exception ex) { + if (ex instanceof JsonPathQueryException) { + throw new BurpException( + new RmlError( + "Execution error in JSONPath `" + reference + "`", origin, RER.ReferenceFormulationExecutionError, ex + ) + ); + } else if (ex instanceof BurpException) { + throw (BurpException) ex; + } else { + throw new BurpException(new RmlError("Unexpected Error", origin, RER.Error, ex)); + } + } + return resultList; + } +} + +class JSONIteration extends Iteration { + public final NodeListEntry json; + + public JSONIteration(NodeListEntry json, Set nulls) { + super(nulls); + this.json = json; + } + + @Override + public String asString() { + return json.getValue().toString(); + } +} + + diff --git a/src/main/java/burp/ls/LogicalSourceFactory.java b/src/main/java/burp/ls/LogicalSourceFactory.java index edbc704..f09515e 100644 --- a/src/main/java/burp/ls/LogicalSourceFactory.java +++ b/src/main/java/burp/ls/LogicalSourceFactory.java @@ -1,413 +1,102 @@ package burp.ls; -import java.io.File; -import java.io.StringReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.*; - -import burp.model.AbstractLogicalSource; import burp.model.Iteration; -import com.jayway.jsonpath.JsonPath; -import com.opencsv.CSVReader; -import net.minidev.json.JSONObject; -import org.apache.commons.io.IOUtils; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.apache.jena.vocabulary.DCAT; -import org.apache.jena.vocabulary.RDF; -import org.apache.jena.vocabulary.VOID; - import burp.model.LogicalSource; -import burp.util.Util; -import burp.vocabularies.CSVW; -import burp.vocabularies.D2RQ; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.reporting.StatementPart; +import burp.vocabularies.RER; import burp.vocabularies.RML; -import burp.vocabularies.SD; -import burp.vocabularies.UCOCore; -import burp.vocabularies.UCOObservable; -import burp.vocabularies.YS; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; +import java.nio.file.Path; +import java.util.List; +import java.util.ServiceLoader; +import java.util.stream.Collectors; public class LogicalSourceFactory { - public static LogicalSource createCSVSource(Resource ls, String mpath) { - CSVSource source = new CSVSource(); - - if (ls.getPropertyResourceValue(RML.source).hasProperty(RDF.type, CSVW.Table)) { - Resource s = ls.getPropertyResourceValue(RML.source); - - String file = getFile(ls); - source.file = getAbsoluteOrRelative(file, mpath); - - // IF IT IS A CSVW TABLE, THEN LOOK FOR THE ENCODING IN THE DIALECT - if (s.hasProperty(CSVW.dialect)) { - Resource r = s.getPropertyResourceValue(CSVW.dialect); - if (r.hasProperty(CSVW.encoding) && !ls.hasProperty(RML.encoding)) { - String e = r.getProperty(CSVW.encoding).getString(); - if ("UTF-8".equals(e)) - source.encoding = StandardCharsets.UTF_8; - else if ("UTF-16".equals(e)) - source.encoding = StandardCharsets.UTF_16; - else - throw new RuntimeException("Provided Character Set " + r + " not supported."); - } - - if (r.hasProperty(CSVW.delimiter)) { - // TODO: According to CSVW, the delimiter is a string. But all examples are chars. - source.delimiter = r.getProperty(CSVW.delimiter).getChar(); - } - - if (r.hasProperty(CSVW.header)) { - source.firstLineIsHeader = r.getProperty(CSVW.header).getBoolean(); - } - - if (r.hasProperty(CSVW.NULL) && !ls.hasProperty(RML.NULL)) { - r.listProperties(RML.NULL).forEach(t -> { - if(t.getObject().isResource()) { - // WE ASSUME WE CAN HAVE RESOURCES AS NULL FOR - // SPARQL SOURCES - source.nulls.add(t.getObject().asResource()); - } else { - source.nulls.add(t.getObject().asLiteral().getValue()); - } - }); - } - - } else { - source.encoding = StandardCharsets.UTF_8; - } - - source.compression = getCompression(ls); - - } else { - // WE HAVE A SIMPLE CSV FILE (CORE) - String file = getFile(ls); - source.file = getAbsoluteOrRelative(file, mpath); - source.compression = getCompression(ls); - } - - source.encoding = getEncoding(ls); - source.nulls.addAll(getNullValues(ls)); - - return source; - } - - public static LogicalSource createJSONSource(Resource ls, String mpath) { - String file = getFile(ls); - String iterator = ls.getProperty(RML.iterator).getLiteral().getString(); - JSONSource source = new JSONSource(); - source.file = getAbsoluteOrRelative(file, mpath); - source.iterator = iterator; - source.encoding = getEncoding(ls); - source.compression = getCompression(ls); - source.nulls.addAll(getNullValues(ls)); - return source; - } - - public static LogicalSource createXMLSource(Resource ls, String mpath) { - String file = getFile(ls); - String iterator = ls.getProperty(RML.iterator).getLiteral().getString(); - XMLSource source = new XMLSource(); - source.file = getAbsoluteOrRelative(file, mpath); - source.iterator = iterator; - source.encoding = getEncoding(ls); - source.compression = getCompression(ls); - source.nulls.addAll(getNullValues(ls)); - Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); - if (referenceFormulation.hasProperty(RDF.type, RML.XPathReferenceFormulation)) { - source.prefixMap = getPrefixMap(ls); - } - return source; - } - - public static LogicalSource createSQL2008TableSource(Resource ls, String mpath) { - Resource s = ls.getPropertyResourceValue(RML.source); - String jdbcDSN = s.getProperty(D2RQ.jdbcDSN).getLiteral().getString(); - String jdbcDriver = s.getProperty(D2RQ.jdbcDriver).getLiteral().getString(); - String username = s.getProperty(D2RQ.username).getLiteral().getString(); - String password = s.getProperty(D2RQ.password).getLiteral().getString(); - - Statement t = ls.getProperty(RML.iterator); - String query = "(SELECT * FROM " + t.getLiteral() + ")"; - - RDBSource source = new RDBSource(); - source.jdbcDSN = jdbcDSN; - source.jdbcDriver = jdbcDriver; - source.username = username; - source.password = password; - - // Apache jena "escapes" double quotes, so "Name" becomes \"Name\" - // which is internally stored as \\"Name\\". We thus need to remove - // occurrences of \\ - source.query = query.replace("\\", ""); - - source.nulls.addAll(getNullValues(ls)); - - return source; - } - - public static LogicalSource createSQL2008QuerySource(Resource ls, String mpath) { - Resource s = ls.getPropertyResourceValue(RML.source); - String jdbcDSN = s.getProperty(D2RQ.jdbcDSN).getLiteral().getString(); - String jdbcDriver = s.getProperty(D2RQ.jdbcDriver).getLiteral().getString(); - String username = s.getProperty(D2RQ.username).getLiteral().getString(); - String password = s.getProperty(D2RQ.password).getLiteral().getString(); - - Statement t = ls.getProperty(RML.iterator); - String query = t.getLiteral().toString(); - - RDBSource source = new RDBSource(); - source.jdbcDSN = jdbcDSN; - source.jdbcDriver = jdbcDriver; - source.username = username; - source.password = password; - - // Apache jena "escapes" double quotes, so "Name" becomes \"Name\" - // which is internally stored as \\"Name\\". We thus need to remove - // occurrences of \\ - source.query = query.replace("\\", ""); - - source.nulls.addAll(getNullValues(ls)); + private static final ServiceLoader LOADER = ServiceLoader.load(LogicalSourceProvider.class); - return source; - } + private LogicalSourceFactory() {} - public static LogicalSource createSPARQLSource(Resource ls, String mpath, boolean isTSV) { - String iterator = ls.getProperty(RML.iterator).getLiteral().getString(); - - Resource s = ls.getPropertyResourceValue(RML.source); - - if (s.hasProperty(RDF.type, VOID.Dataset)) { - SPARQLFileSource source = new SPARQLFileSource(isTSV); - String file = s.getPropertyResourceValue(VOID.dataDump).getURI(); - source.file = getAbsoluteOrRelativeFromFileProtocol(file, mpath); - source.compression = getCompression(ls); - source.encoding = getEncoding(ls); - source.iterator = iterator; - source.nulls.addAll(getNullValues(ls)); - return source; - } else if(s.hasProperty(RDF.type, SD.Service)) { - SPARQLServiceSource source = new SPARQLServiceSource(isTSV); - source.endpoint = s.getPropertyResourceValue(SD.endpoint).getURI(); - source.iterator = iterator; - source.nulls.addAll(getNullValues(ls)); - return source; - } else { - // WE HAVE A SIMPLE SPARQL SOURCE - SPARQLFileSource source = new SPARQLFileSource(isTSV); - String file = getFile(ls); - source.file = getAbsoluteOrRelative(file, mpath); - source.compression = getCompression(ls); - source.encoding = getEncoding(ls); - source.iterator = iterator; - source.nulls.addAll(getNullValues(ls)); - return source; - } - } - - // TODO: Do we really need RML.SPARQL_Results_TSV? - // TODO: Do we really need RML.SPARQL_Results_JSON? - // TODO: Do we really need RML.SPARQL_Results_XML? - - public static LogicalSource createNetconfQuerySource(Resource ls) { - Resource s = ls.getPropertyResourceValue(RML.source); - // Instantiate Netconf source based on Netconf operation - NetconfQuerySource source = new NetconfQuerySource(); - Resource datastore = s.getPropertyResourceValue(YS.sourceDatastore); - source.datastoreType = datastore.getPropertyResourceValue(RDF.type); - // Get YANG Server address connection details - Resource server = datastore.getPropertyResourceValue(YS.server); - Resource socketAddress = server.getPropertyResourceValue(YS.socketAddress); - source.endpoint = socketAddress.getProperty(UCOObservable.addressValue).getLiteral().getString(); - // Get YANG Server authentication details - Resource serverAccount = server.getPropertyResourceValue(YS.serverAccount); - source.username = serverAccount.getProperty(YS.username).getLiteral().getString(); - Resource accountAuthentication = serverAccount.getPropertyResourceValue(UCOCore.hasFacet); - source.password = accountAuthentication.getProperty(UCOObservable.password).getLiteral().getString(); - // Get operation filter - source.filter = s.getPropertyResourceValue(YS.filter); - // Set XPath for RML iterator - source.iterator = ls.getProperty(RML.iterator).getLiteral().getString(); - // Set map of prefixes for RML iterations - source.rmlPrefixMap = getPrefixMap(ls); - return source; - } - - // ************************************************************************* - // * - // * UTILITY FUNCTIONS FOR LOGICAL SOURCES - // * - // ************************************************************************* - - private static String getFile(Resource ls) { - Resource source = ls.getPropertyResourceValue(RML.source); - - if (source.hasProperty(RDF.type, RML.RelativePathSource)) { - String file = source.getProperty(RML.path).getLiteral().getString(); - - Resource root = source.getPropertyResourceValue(RML.root); - if (root != null) { - if (RML.MappingDirectory.equals(root)) return file; - if (RML.CurrentWorkingDirectory.equals(root)) - return new File(new File(System.getProperty("user.dir")), file).getPath(); - if (root.isLiteral()) return new File(root.asLiteral().getString(), file).getPath(); - throw new RuntimeException("RelativePathSource specified root value is not supported. " + root); - } - - // By default BURP treats it relative to mapping. - return file; - } - - if (source.hasProperty(RDF.type, DCAT.Distribution)) { - String url = source.getPropertyResourceValue(DCAT.downloadURL).getURI(); - return Util.downloadFile(url); - } - - if (source.hasProperty(RDF.type, CSVW.Table)) { - String url = source.getProperty(CSVW.url).getLiteral().getString(); - return Util.downloadFile(url); - } - - throw new RuntimeException("Source from this logical source type not yet implemented"); - } - - private static Resource getCompression(Resource ls) { - Resource r = ls.getPropertyResourceValue(RML.source); - - r = r.getPropertyResourceValue(RML.compression); - if (r == null || RML.none.equals(r)) - return RML.none; - if (RML.zip.equals(r)) - return RML.zip; - if (RML.gzip.equals(r)) - return RML.gzip; - if (RML.targz.equals(r)) - return RML.targz; - if (RML.tarxz.equals(r)) - return RML.tarxz; - - throw new RuntimeException("Provided compression " + r + " not supported."); - } - - private static Charset getEncoding(Resource ls) { - Resource r = ls.getPropertyResourceValue(RML.source); - - r = r.getPropertyResourceValue(RML.encoding); - if (r == null || RML.UTF8.equals(r)) - return StandardCharsets.UTF_8; - if (RML.UTF16.equals(r)) - return StandardCharsets.UTF_16; - - throw new RuntimeException("Provided Character Set " + r + " not supported."); - } - - private static String getAbsoluteOrRelative(String file, String mpath) { - if (new File(file).isAbsolute()) - return file; - return new File(mpath, file).getAbsolutePath(); - } - - private static String getAbsoluteOrRelativeFromFileProtocol(String file, String mpath) { - try { - URL url = new URL(file); - if (Util.isAbsoluteAndValidIRI(file)) - return file; - String abs = new File(mpath, url.getPath()).toURI().toURL().toString(); - return abs.replaceFirst("file:/", ""); - } catch (MalformedURLException e) { - throw new RuntimeException(file + " is not a file URL."); - } - } - - private static List getNullValues(Resource ls) { - Resource r = ls.getPropertyResourceValue(RML.source); - List os = new ArrayList<>(); - r.listProperties(RML.NULL).forEach(t -> { - if(t.getObject().isResource()) { - // WE ASSUME WE CAN HAVE RESOURCES AS NULL FOR - // SPARQL SOURCES - os.add(t.getObject().asResource()); - } else { - os.add(t.getObject().asLiteral().getValue()); - } - }); - return os; - } + public static LogicalSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { + Statement stmt = ls.getProperty(RML.referenceFormulation); + Resource referenceFormulation = stmt.getObject().asResource(); + for (LogicalSourceProvider provider : LOADER) { + if (provider.supports(referenceFormulation)) { + return provider.create(ls, mappingDirectory, currentWorkingDirectory); + } + } - // Generates prefix map from rml:namespace definitions - private static HashMap getPrefixMap(Resource ls) { - // Get XPathRerenceFormulation - Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); - // Set map of namespaces for XPath iteration - StmtIterator properties = referenceFormulation.listProperties(RML.namespace); - HashMap prefixMap = new HashMap<>(); - while (properties.hasNext()) { - Statement statement = properties.next(); - Resource namespace = statement.getResource(); - prefixMap.put( - namespace.getProperty(RML.namespacePrefix).getLiteral().getString(), - namespace.getProperty(RML.namespaceURL).getLiteral().getString() - ); - } - return prefixMap; - } + String supported = LOADER.stream() + .map(p -> p.type().getName()) + .collect(Collectors.joining(", ")); + String supportedMessage = !supported.isEmpty() ? "Are supported: " + supported + "." + : "None are supported, provide a `burp.ls.LogicalSourceProvider` in class path."; + + throw new BurpException( + new RmlError( + "Reference formulation not supported: " + referenceFormulation + ". " + supportedMessage, + new Origin(stmt, StatementPart.Object), + RER.Error + ) + ); + } - public static List changeIterator(String iterationAsString, Resource rf, String iterator) { - try { - if (RML.JSONPath.equals(rf)) { - // Create JSON iterations - List iterations = new ArrayList<>(); - String contents = iterationAsString; - List> nodes = JsonPath.using(JSONSource.configuration).parse(contents).read(iterator); - for (Map n : nodes) - // TODO: How do we provide null values? - iterations.add(new JSONIteration(JSONObject.toJSONString(n), new HashSet<>())); - return iterations; + public static List changeIterator( + String iterationAsString, + Resource referenceFormulation, + String iterator, + Origin referenceFormulationOrigin + ) { + for (LogicalSourceProvider provider : LOADER) { + if (provider.supports(referenceFormulation)) { + return provider.parseStringPayload(iterationAsString, iterator, referenceFormulationOrigin); + } + } - } else if (RML.CSV.equals(rf)) { - // Create CSV iterations - CSVReader reader = new CSVReader(new StringReader(iterationAsString)); - List all = reader.readAll(); - reader.close(); - String[] header = all.remove(0); - List iterations = new ArrayList<>(); - for (String[] rec : all) - // TODO: How do we provide null values? - iterations.add(new CSVIteration(header, rec, new HashSet<>())); - return iterations; + throw new BurpException( + new RmlError( + "Reference formulation not supported for nested string iterations: " + referenceFormulation, + referenceFormulationOrigin, + RER.UnsupportedMapping + ) + ); + } - } else if (RML.XPath.equals(rf)) { - // Create XPATH iterations - DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = builderFactory.newDocumentBuilder(); - Document xmlDocument = builder.parse(IOUtils.toInputStream(iterationAsString)); - XPath xPath = XPathFactory.newInstance().newXPath(); - NodeList nodes = (NodeList) xPath.compile(iterator).evaluate(xmlDocument, XPathConstants.NODESET); + public static List changeIterator( + String iterationAsString, + Resource referenceFormulation, + String iterator + ) { + return changeIterator(iterationAsString, referenceFormulation, iterator, null); + } - List iterations = new ArrayList<>(); - for (int index = 0; index < nodes.getLength(); index++) { - Node node = nodes.item(index); - // TODO: How do we provide null values? - // TODO: How do we provide the prefix mappings? - iterations.add(new XMLIteration(node, new HashSet<>(), new HashMap<>())); - } + public static Reference buildReference( + Resource referenceFormulation, String reference, Origin origin, Origin referenceFormulationOrigin + ) { + for (LogicalSourceProvider provider : LOADER) { + if (provider.supports(referenceFormulation)) { + return provider.buildReference(reference, origin, referenceFormulationOrigin); } - } catch (Throwable e) { - throw new RuntimeException(e); } - throw new RuntimeException("Other reference formulations for iterable fields are not yet supported: " + rf); + throw new BurpException( + new RmlError( + "Reference formulation not supported for nested references: " + referenceFormulation, + referenceFormulationOrigin, + RER.UnsupportedMapping + ) + ); + } + + public static Reference buildReference( + Resource referenceFormulation, String reference, Origin origin + ) { + return buildReference(referenceFormulation, reference, origin, null); } } diff --git a/src/main/java/burp/ls/LogicalSourceProvider.java b/src/main/java/burp/ls/LogicalSourceProvider.java new file mode 100644 index 0000000..374df23 --- /dev/null +++ b/src/main/java/burp/ls/LogicalSourceProvider.java @@ -0,0 +1,54 @@ +package burp.ls; + +import burp.model.Iteration; +import burp.model.LogicalSource; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import org.apache.jena.rdf.model.Resource; + +import java.nio.file.Path; +import java.util.List; + +public interface LogicalSourceProvider { + boolean supports(Resource referenceFormulation); + LogicalSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory); + + /** + * Parse a string payload into a list of nested Iterations (used by RML-LV IterableField). + * By default, throws an exception for formulations that don't support string payloads, + * highlighting the origin of the reference formulation that caused the issue. + */ + default List parseStringPayload(String payload, String iterator, Origin referenceFormulationOrigin) { + throw new BurpException( + new RmlError( + "Nested iterations from string payload are not supported for this reference formulation.", + referenceFormulationOrigin, + RER.UnsupportedMapping + ) + ); + } + + default List parseStringPayload(String payload, String iterator) { + return parseStringPayload(payload, iterator, null); + } + + /** + * Build a Reference extractor based purely on the reference formulation. + */ + default Reference buildReference(String reference, Origin origin, Origin referenceFormulationOrigin) { + throw new BurpException( + new RmlError( + "Nested references not supported for this formulation.", + referenceFormulationOrigin, + RER.UnsupportedMapping + ) + ); + } + + default Reference buildReference(String reference, Origin origin) { + return buildReference(reference, origin, null); + } +} diff --git a/src/main/java/burp/ls/NetconfQuerySource.java b/src/main/java/burp/ls/NetconfQuerySource.java index e6218a2..8ded88c 100644 --- a/src/main/java/burp/ls/NetconfQuerySource.java +++ b/src/main/java/burp/ls/NetconfQuerySource.java @@ -3,21 +3,13 @@ package burp.ls; -import java.io.IOException; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; - +import burp.model.Iteration; +import burp.model.LogicalSource; +import burp.model.Reference; +import burp.reporting.Origin; +import burp.util.SimpleNamespaceContext; +import burp.vocabularies.YS; +import com.tailf.jnc.*; import org.apache.commons.io.IOUtils; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; @@ -27,22 +19,26 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import com.tailf.jnc.Element; -import com.tailf.jnc.JNCException; -import com.tailf.jnc.NetconfSession; -import com.tailf.jnc.Prefix; -import com.tailf.jnc.PrefixMap; -import com.tailf.jnc.SSHConnection; -import com.tailf.jnc.SSHSession; -import com.tailf.jnc.XMLParser; - -import burp.model.Iteration; -import burp.model.LogicalSource; -import burp.util.SimpleNamespaceContext; -import burp.vocabularies.YS; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; class NetconfQuerySource extends LogicalSource { + @Override + public Reference buildExportedReference(String reference, Origin origin) { + return null; + } + public String endpoint; public String password; public String username; @@ -50,6 +46,10 @@ class NetconfQuerySource extends LogicalSource { public Resource filter; public HashMap rmlPrefixMap; + public String iterator; + public Resource referenceFormulation; + public Resource getReferenceFormulation() { return referenceFormulation; } + public void setReferenceFormulation(Resource ref) { this.referenceFormulation = ref; } protected List iterations = null; public Charset encoding = StandardCharsets.UTF_8; @@ -62,7 +62,7 @@ class NetconfQuerySource extends LogicalSource { private PrefixMap netconfPrefixMap; @Override - public Iterator iterator() { + public Iterable iterator() { //Element.setDebugLevel(2); # Helpful for debugging SSHConnection c = new SSHConnection(); String contents = null; @@ -148,10 +148,10 @@ public Iterator iterator() { for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); - iterations.add(new XMLIteration(node, nulls, rmlPrefixMap)); + throw new RuntimeException("XMLIteration with DOM Node is not supported here."); } } - return iterations.iterator(); + return iterations; } catch (Throwable e) { throw new RuntimeException(e); } diff --git a/src/main/java/burp/ls/RDBSource.java b/src/main/java/burp/ls/RDBSource.java index 897c916..e31f5db 100644 --- a/src/main/java/burp/ls/RDBSource.java +++ b/src/main/java/burp/ls/RDBSource.java @@ -1,127 +1,168 @@ package burp.ls; -import java.io.StringWriter; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.*; - -import com.opencsv.CSVWriter; -import org.apache.commons.text.StringEscapeUtils; - import burp.model.Iteration; import burp.model.LogicalSource; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; import burp.util.Util; +import burp.vocabularies.RER; +import org.apache.commons.text.StringEscapeUtils; +import org.apache.jena.rdf.model.Resource; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.sql.*; +import java.util.*; + +public class RDBSource extends LogicalSource { + public Path currentWorkingDirectory; + public String jdbcDriver; + public String jdbcDSN; + public String password; + public String username; + public String query; + + private Resource referenceFormulation; + + @Override + public Resource getReferenceFormulation() { + return referenceFormulation; + } + + @Override + public void setReferenceFormulation(Resource value) { + this.referenceFormulation = value; + } -class RDBSource extends LogicalSource { - - public String jdbcDriver; - public String jdbcDSN; - public String password; - public String username; - public String query; - - @Override - public Iterator iterator() { - try { - Properties props = new Properties(); - if (username != null && !username.isEmpty()) - props.setProperty("user", username); - if (password != null && !password.isEmpty()) - props.setProperty("password", password); - - Class.forName(jdbcDriver); - Connection connection = DriverManager.getConnection(jdbcDSN, props); - Statement statement = connection.createStatement(); - final ResultSet resultset = statement.executeQuery(query); - - Map indexMap = new HashMap<>(); - for (int i = 1; i <= resultset.getMetaData().getColumnCount(); i++) { - indexMap.put(resultset.getMetaData().getColumnLabel(i), i); - } - - return new Iterator<>() { - - @Override - public boolean hasNext() { - try { - return resultset.next(); - } catch (SQLException e) { - throw new RuntimeException("Problem querying database while iterating over rows."); - } - } - - @Override - public Iteration next() { - return new RDBIteration(resultset, indexMap, nulls); - } - - }; - } catch (Throwable e) { - throw new RuntimeException(e); - } - } + @Override + public Iterable iterator() { + try { + Properties props = new Properties(); + if (username != null && !username.isEmpty()) props.setProperty("user", username); + if (password != null && !password.isEmpty()) props.setProperty("password", password); + + if (jdbcDriver != null) { + try { + Class.forName(jdbcDriver); + } catch (ClassNotFoundException e) { + throw new BurpException( + new RmlError("Problem querying database.", null, RER.Error, e) + ); + } + } + + String resolvedJdbcDSN = jdbcDSN; + if (resolvedJdbcDSN != null && resolvedJdbcDSN.startsWith("jdbc:sqlite:") && !resolvedJdbcDSN.startsWith("jdbc:sqlite::")) { + Path userDir = Paths.get(System.getProperty("user.dir")).toAbsolutePath(); + if (!currentWorkingDirectory.toAbsolutePath().equals(userDir)) { + String pathPart = resolvedJdbcDSN.substring("jdbc:sqlite:".length()); + Path path = Paths.get(pathPart); + if (!path.isAbsolute()) { + resolvedJdbcDSN = "jdbc:sqlite:" + currentWorkingDirectory.resolve(path).toAbsolutePath(); + } + } + } + + Connection connection = DriverManager.getConnection(resolvedJdbcDSN, props); + Statement statement = connection.createStatement(); + ResultSet resultset = statement.executeQuery(query); + + Map indexMap = new HashMap<>(); + for (int i = 1; i <= resultset.getMetaData().getColumnCount(); i++) { + indexMap.put(resultset.getMetaData().getColumnLabel(i), i); + } + + return () -> new Iterator() { + @Override + public boolean hasNext() { + try { + boolean goNext = resultset.next(); + if (!goNext) { + resultset.close(); + statement.close(); + connection.close(); + } + return goNext; + } catch (SQLException e) { + throw new BurpException( + new RmlError("Problem querying database while iterating over rows.", null, RER.Error, e) + ); + } + } + + @Override + public Iteration next() { + return new RDBIteration(resultset, indexMap, getNulls()); + } + }; + } catch (Throwable e) { + throw new RuntimeException(e); + } + } + @Override + public Reference buildExportedReference(String reference, Origin origin) { + return new RDBReference(reference, origin); + } } -class RDBIteration extends Iteration { +class RDBReference extends Reference { + public RDBReference(String reference, Origin origin) { + super(reference, origin); + } - private final Map values = new LinkedHashMap<>(); - - protected RDBIteration(ResultSet resultSet, Map indexMap, Set nulls) { - super(nulls); - - for(String ref : indexMap.keySet()) { - try { - Object o = resultSet.getObject(indexMap.get(ref)); - if(o != null) { - if(o instanceof byte[]) { - o = Util.bytesToHexString((byte[]) o); - } - } - - values.put(ref, o); - } catch (Exception e) { - throw new RuntimeException("Error retrieving values from result set."); - } - } - } - - @Override - public List getValuesFor(String reference) { - List l = new ArrayList<>(); - String columnname = StringEscapeUtils.unescapeJava(reference); - - if(!values.containsKey(columnname) && !values.containsKey(columnname.replace("\"", ""))) - throw new RuntimeException("Attribute " + columnname + " does not exist."); - - Object value = values.get(columnname); - - // Check whether the user added the right column names in the mappings - if(value == null) - // Now try without quotes - value = values.get(columnname.replace("\"", "")); - - if(value != null && !nulls.contains(value)) - l.add(value); - - return l; - } - - @Override - public List getStringsFor(String reference) { - List l = new ArrayList<>(); - for(Object o : getValuesFor(reference)) - if(o != null) - l.add(o.toString()); - return l; - } + @Override + public List getValues(Iteration i) { + if (!(i instanceof RDBIteration)) { + throw new IllegalArgumentException("RDBReference can only be used with RDBIteration."); + } + RDBIteration rdbIteration = (RDBIteration) i; + List l = new ArrayList<>(); + String columnname = StringEscapeUtils.unescapeJava(reference); + + if (!rdbIteration.values.containsKey(columnname) && !rdbIteration.values.containsKey( + columnname != null ? columnname.replace("\"", "") : null)) { + throw new RuntimeException("Attribute " + columnname + " does not exist."); + } + + Object value = rdbIteration.values.get(columnname); + + if (value == null) { + value = rdbIteration.values.get(columnname != null ? columnname.replace("\"", "") : null); + } + + if (value != null && !rdbIteration.getNulls().contains(value)) { + l.add(value); + } + + return l; + } +} + +class RDBIteration extends Iteration { + public final Map values = new LinkedHashMap<>(); + + public RDBIteration(ResultSet resultSet, Map indexMap, Set nulls) { + super(nulls); + for (String ref : indexMap.keySet()) { + try { + Object o = resultSet.getObject(indexMap.get(ref)); + if (o != null) { + if (o instanceof byte[]) { + o = Util.bytesToHexString((byte[]) o); + } + } + values.put(ref, o); + } catch (Exception e) { + throw new RuntimeException("Error retrieving values from result set.", e); + } + } + } @Override public String asString() { - throw new RuntimeException("Not implemented. Does this make sense in the context of LV?"); + throw new UnsupportedOperationException("Not implemented. Does this make sense in the context of LV?"); } - } \ No newline at end of file diff --git a/src/main/java/burp/ls/RDBSourceProvider.java b/src/main/java/burp/ls/RDBSourceProvider.java new file mode 100644 index 0000000..6aac511 --- /dev/null +++ b/src/main/java/burp/ls/RDBSourceProvider.java @@ -0,0 +1,47 @@ +package burp.ls; + +import burp.vocabularies.D2RQ; +import burp.vocabularies.RML; +import com.google.auto.service.AutoService; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; + +import java.nio.file.Path; + +@AutoService(LogicalSourceProvider.class) +public class RDBSourceProvider implements LogicalSourceProvider { + @Override + public boolean supports(Resource referenceFormulation) { + return RML.SQL2008Query.equals(referenceFormulation); + } + + @Override + public RDBSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { + RDBSource source = new RDBSource(); + source.setReferenceFormulation(RML.SQL2008Query); + + Resource sourceNode = ls.getPropertyResourceValue(RML.source); + Statement jdbcDSNStmt = sourceNode.getProperty(D2RQ.jdbcDSN); + if (jdbcDSNStmt == null) { + throw new IllegalArgumentException("RDB source must have a d2rq:jdbcDSN property."); + } + source.jdbcDSN = jdbcDSNStmt.getLiteral().getString(); + + Statement jdbcDriverStmt = sourceNode.getProperty(D2RQ.jdbcDriver); + source.jdbcDriver = jdbcDriverStmt != null ? jdbcDriverStmt.getLiteral().getString() : null; + + Statement usernameStmt = sourceNode.getProperty(D2RQ.username); + source.username = usernameStmt != null ? usernameStmt.getLiteral().getString() : null; + + Statement passwordStmt = sourceNode.getProperty(D2RQ.password); + source.password = passwordStmt != null ? passwordStmt.getLiteral().getString() : null; + + String query = ls.getProperty(RML.iterator).getLiteral().getString(); + source.query = query.replace("\\", ""); + + source.getNulls().addAll(FileBaseSourceProvider.getNullValues(ls)); + source.currentWorkingDirectory = currentWorkingDirectory; + + return source; + } +} diff --git a/src/main/java/burp/ls/RDBTableSourceProvider.java b/src/main/java/burp/ls/RDBTableSourceProvider.java new file mode 100644 index 0000000..6f66384 --- /dev/null +++ b/src/main/java/burp/ls/RDBTableSourceProvider.java @@ -0,0 +1,22 @@ +package burp.ls; + +import burp.vocabularies.RML; +import com.google.auto.service.AutoService; +import org.apache.jena.rdf.model.Resource; +import java.nio.file.Path; + +@AutoService(LogicalSourceProvider.class) +public class RDBTableSourceProvider extends RDBSourceProvider { + @Override + public boolean supports(Resource referenceFormulation) { + return RML.SQL2008Table.equals(referenceFormulation); + } + + @Override + public RDBSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { + RDBSource source = super.create(ls, mappingDirectory, currentWorkingDirectory); + source.setReferenceFormulation(RML.SQL2008Table); + source.query = "SELECT * FROM " + source.query; + return source; + } +} diff --git a/src/main/java/burp/ls/SPARQLFileSource.java b/src/main/java/burp/ls/SPARQLFileSource.java index 2de1b88..0c4de57 100644 --- a/src/main/java/burp/ls/SPARQLFileSource.java +++ b/src/main/java/burp/ls/SPARQLFileSource.java @@ -1,120 +1,137 @@ package burp.ls; +import burp.model.Iteration; +import burp.model.Reference; +import burp.reporting.Origin; +import org.apache.jena.query.*; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.riot.RDFDataMgr; + import java.util.ArrayList; -import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.Set; -import org.apache.jena.query.Dataset; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.riot.RDFDataMgr; +public class SPARQLFileSource extends FileBasedLogicalSource { + private List iterations = null; + public List getIterations() { return iterations; } + public void setIterations(List i) { iterations = i; } + private final boolean isTSV; + private Resource referenceFormulation; + public String iterator; + public Origin iteratorOrigin; + + public SPARQLFileSource(boolean isTSV, Resource referenceFormulation) { + this.isTSV = isTSV; + this.referenceFormulation = referenceFormulation; + } -import burp.model.Iteration; + @Override + public Resource getReferenceFormulation() { + return referenceFormulation; + } + + @Override + public void setReferenceFormulation(Resource value) { + this.referenceFormulation = value; + } + + @Override + public Iterable iterator() { + try { + if (getIterations() == null) { + setIterations(new ArrayList<>()); + + String filePath = Objects.requireNonNull(file.getFile(fileOriginStmts)).getPath(); + Dataset ds = RDFDataMgr.loadDataset(filePath); + + try (QueryExecution exec = QueryExecutionFactory.create(iterator, ds)) { + ResultSet results = exec.execSelect(); + while (results.hasNext()) { + QuerySolution sol = results.next(); + if (isTSV) { + getIterations().add(new SPARQLTSVIteration(sol, getNulls())); + } else { + getIterations().add(new SPARQLIteration(sol, getNulls())); + } + } + } + } + return getIterations(); + } catch (Throwable e) { + throw new RuntimeException(e); + } + } + + @Override + public Reference buildExportedReference(String reference, Origin origin) { + if (isTSV) return new SPARQLTSVReference(reference, origin); + return new SPARQLReference(reference, origin); + } +} -class SPARQLFileSource extends FileBasedLogicalSource { - - private final boolean isTSV; - - public SPARQLFileSource(boolean isTSV) { - this.isTSV = isTSV; - } - - @Override - public Iterator iterator() { - try { - if (iterations == null) { - iterations = new ArrayList<>(); - - Dataset ds = RDFDataMgr.loadDataset(file); - - try (QueryExecution exec = QueryExecution.dataset(ds).query(iterator).build()) { - ResultSet results = exec.execSelect(); - - while(results.hasNext()) { - QuerySolution sol = results.next(); - - if(isTSV) - iterations.add(new SPARQLTSVIteratation(sol, nulls)); - else - iterations.add(new SPARQLIteratation(sol, nulls)); - } - } - } - return iterations.iterator(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } +class SPARQLReference extends Reference { + public SPARQLReference(String reference, Origin origin) { + super(reference, origin); + } + @Override + public List getValues(Iteration i) { + if (!(i instanceof SPARQLIteration)) { + throw new IllegalArgumentException("SPARQLReference can only be used with SPARQLIteration."); + } + SPARQLIteration sqIteration = (SPARQLIteration) i; + List l = new ArrayList<>(); + RDFNode n = sqIteration.sol != null ? sqIteration.sol.get(reference) : null; + if (n != null && !sqIteration.getNulls().contains(n)) { + l.add(n); + } + return l; + } } -class SPARQLIteratation extends Iteration { - - private QuerySolution sol = null; - - protected SPARQLIteratation(QuerySolution sol, Set nulls) { - super(nulls); - - this.sol = sol; - } - - @Override - public List getValuesFor(String reference) { - List l = new ArrayList<>(); - RDFNode n = sol.get(reference); - if(n != null && !nulls.contains(n)) - l.add(n); - return l; - } - - @Override - public List getStringsFor(String reference) { - List l = new ArrayList<>(); - RDFNode n = sol.get(reference); - if(n != null && !nulls.contains(n)) - l.add(n.toString()); - return l; - } +class SPARQLTSVReference extends Reference { + public SPARQLTSVReference(String reference, Origin origin) { + super(reference, origin); + } + + @Override + public List getValues(Iteration i) { + if (!(i instanceof SPARQLTSVIteration)) { + throw new IllegalArgumentException("SPARQLTSVReference can only be used with SPARQLTSVIteration."); + } + SPARQLTSVIteration sqIteration = (SPARQLTSVIteration) i; + List l = new ArrayList<>(); + RDFNode n = sqIteration.sol != null ? sqIteration.sol.get(reference != null ? reference.substring(1) : null) : null; + if (n != null && !sqIteration.getNulls().contains(n)) { + l.add(n); + } + return l; + } +} + +class SPARQLIteration extends Iteration { + public QuerySolution sol; + + public SPARQLIteration(QuerySolution sol, Set nulls) { + super(nulls); + this.sol = sol; + } @Override public String asString() { throw new RuntimeException("Not implemented. Does this make sense in the context of LV?"); } - } -class SPARQLTSVIteratation extends Iteration { - - private QuerySolution sol = null; - - protected SPARQLTSVIteratation(QuerySolution sol, Set nulls) { - super(nulls); - - this.sol = sol; - } - - @Override - public List getValuesFor(String reference) { - List l = new ArrayList<>(); - // REMOVE THE ? FROM THE REFERENCE - RDFNode n = sol.get(reference.substring(1)); - if(n != null && !nulls.contains(n)) - l.add(n); - return l; - } - - @Override - public List getStringsFor(String reference) { - List l = new ArrayList<>(); - // REMOVE THE ? FROM THE REFERENCE - RDFNode n = sol.get(reference.substring(1)); - if(n != null && !nulls.contains(n)) - l.add(n.toString()); - return l; - } +class SPARQLTSVIteration extends Iteration { + public QuerySolution sol; + + public SPARQLTSVIteration(QuerySolution sol, Set nulls) { + super(nulls); + this.sol = sol; + } @Override public String asString() { diff --git a/src/main/java/burp/ls/SPARQLServiceSource.java b/src/main/java/burp/ls/SPARQLServiceSource.java index abb6989..286c32d 100644 --- a/src/main/java/burp/ls/SPARQLServiceSource.java +++ b/src/main/java/burp/ls/SPARQLServiceSource.java @@ -1,51 +1,96 @@ package burp.ls; +import burp.model.Iteration; +import burp.model.LogicalSource; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import org.apache.jena.query.*; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.sparql.exec.http.QueryExecutionHTTP; + import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QuerySolution; -import org.apache.jena.query.ResultSet; -import org.apache.jena.sparql.exec.http.QueryExecutionHTTP; - -import burp.model.Iteration; -import burp.model.LogicalSource; +public class SPARQLServiceSource extends LogicalSource { + private final boolean isTSV; + private Resource referenceFormulation; + private List iterations; -class SPARQLServiceSource extends LogicalSource { + public String iterator; + public Origin iteratorOrigin; + public String endpoint; - private List iterations = null; - private final boolean isTSV; + public SPARQLServiceSource(boolean isTSV, Resource referenceFormulation) { + this.isTSV = isTSV; + this.referenceFormulation = referenceFormulation; + } - public String iterator; - public String endpoint; + @Override + public Resource getReferenceFormulation() { + return referenceFormulation; + } - public SPARQLServiceSource(boolean isTSV) { - this.isTSV = isTSV; - } + @Override + public void setReferenceFormulation(Resource value) { + this.referenceFormulation = value; + } - @Override - public Iterator iterator() { - try { - if (iterations == null) { - iterations = new ArrayList<>(); + @Override + public Iterable iterator() { + try { + if (iterations == null) { + iterations = new ArrayList<>(); - QueryExecution exec = QueryExecutionHTTP.service(endpoint).query(iterator).build(); - ResultSet results = exec.execSelect(); + QueryExecution exec = QueryExecutionHTTP.service(endpoint).query(iterator).build(); + ResultSet results = exec.execSelect(); - while (results.hasNext()) { - QuerySolution sol = results.next(); + while (results.hasNext()) { + QuerySolution sol = results.next(); - if (isTSV) - iterations.add(new SPARQLTSVIteratation(sol, nulls)); - else - iterations.add(new SPARQLIteratation(sol, nulls)); - } - } - return iterations.iterator(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } + if (isTSV) { + iterations.add(new SPARQLTSVIteration(sol, getNulls())); + } else { + iterations.add(new SPARQLIteration(sol, getNulls())); + } + } + } + return iterations; + } catch (QueryParseException e) { + throw new BurpException( + new RmlError( + "SPARQL Query Parse Error in " + iterator, + iteratorOrigin, + RER.ReferenceFormulationSyntaxError, + e + ) + ); + } catch (QueryException e) { + throw new BurpException( + new RmlError( + "SPARQL Query Error", + iteratorOrigin, + RER.ReferenceFormulationExecutionError, + e + ) + ); + } catch (Exception e) { + throw new BurpException( + new RmlError( + "SPARQL Source Unexpected Error", + iteratorOrigin, + RER.LogicalSourceError, + e + ) + ); + } + } + @Override + public Reference buildExportedReference(String reference, Origin origin) { + if (isTSV) return new SPARQLTSVReference(reference, origin); + return new SPARQLReference(reference, origin); + } } \ No newline at end of file diff --git a/src/main/java/burp/ls/SPARQLSourceProvider.java b/src/main/java/burp/ls/SPARQLSourceProvider.java new file mode 100644 index 0000000..1fce546 --- /dev/null +++ b/src/main/java/burp/ls/SPARQLSourceProvider.java @@ -0,0 +1,88 @@ +package burp.ls; + +import burp.model.LogicalSource; +import burp.reporting.Origin; +import burp.reporting.StatementPart; +import burp.reporting.StatementParts; +import burp.util.Util; +import burp.vocabularies.RML; +import burp.vocabularies.SD; +import com.google.auto.service.AutoService; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.VOID; + +import java.net.URI; +import java.nio.file.Path; +import java.util.List; + +import static burp.ls.FileBaseSourceProvider.*; + +@SuppressWarnings("unused") +@AutoService(LogicalSourceProvider.class) +public class SPARQLSourceProvider implements LogicalSourceProvider { + @Override + public boolean supports(Resource referenceFormulation) { + return RML.SPARQL_Results_CSV.equals(referenceFormulation) + || RML.SPARQL_Results_TSV.equals(referenceFormulation) + || RML.SPARQL_Results_XML.equals(referenceFormulation) + || RML.SPARQL_Results_JSON.equals(referenceFormulation); + } + + @Override + public LogicalSource create( + Resource ls, Path mappingDirectory, Path currentWorkingDirectory + ) { + String iterator = ls.getProperty(RML.iterator).getLiteral().getString(); + Origin iteratorOrigin = new Origin(ls.getProperty(RML.iterator), StatementPart.Object); + Resource sourceNode = ls.getPropertyResourceValue(RML.source); + boolean isTSV = RML.SPARQL_Results_TSV.equals(sourceNode.getPropertyResourceValue(RDF.type)); + Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); + + if (sourceNode.hasProperty(RDF.type, VOID.Dataset)) { + SPARQLFileSource source = new SPARQLFileSource(isTSV, referenceFormulation); + String file = sourceNode.getPropertyResourceValue(VOID.dataDump).getURI(); + source.file = getAbsoluteOrRelativeFromFileProtocol(file, currentWorkingDirectory); + source.fileOriginStmts = List.of(StatementParts.fromPredicateObject(sourceNode.getProperty(VOID.dataDump))); + source.compression = getCompression(sourceNode); + source.encoding = getEncoding(sourceNode); + source.iterator = iterator; + source.iteratorOrigin = iteratorOrigin; + source.nulls.addAll(getNullValues(sourceNode)); + return source; + } else if (sourceNode.hasProperty(RDF.type, SD.Service)) { + SPARQLServiceSource source = new SPARQLServiceSource(isTSV, referenceFormulation); + source.endpoint = sourceNode.getPropertyResourceValue(SD.endpoint).getURI(); + source.iterator = iterator; + source.iteratorOrigin = iteratorOrigin; + source.nulls.addAll(getNullValues(sourceNode)); + return source; + } else { + // WE HAVE A SIMPLE SPARQL SOURCE + SPARQLFileSource source = new SPARQLFileSource(isTSV, referenceFormulation); + FileBaseSourceProvider.FileAndOrigin fileAndOrigin = getFile(sourceNode, mappingDirectory, currentWorkingDirectory); + source.file = fileAndOrigin.file; + source.fileOriginStmts = fileAndOrigin.origin; + source.compression = getCompression(sourceNode); + source.encoding = getEncoding(sourceNode); + source.iterator = iterator; + source.iteratorOrigin = iteratorOrigin; + source.nulls.addAll(getNullValues(sourceNode)); + return source; + } + } + + private SourceFile getAbsoluteOrRelativeFromFileProtocol(String fileUri, Path rootPath) { + try { + URI url = new URI(fileUri); + if (Util.isValidAndAbsoluteIRI(fileUri)) return new SourceFile.Remote(fileUri); + if ("file".equals(url.getScheme())) { + return Path.of(url.getPath()).isAbsolute() ? new SourceFile.Local(url.getPath()) + : new SourceFile.Local(rootPath.resolve(url.getPath()).toString()); + } + return null; + } catch (Exception e) { + throw new RuntimeException(fileUri + " is not a file URL.", e); + } + } +} diff --git a/src/main/java/burp/ls/SourceFile.java b/src/main/java/burp/ls/SourceFile.java new file mode 100644 index 0000000..b70c174 --- /dev/null +++ b/src/main/java/burp/ls/SourceFile.java @@ -0,0 +1,106 @@ +package burp.ls; + +import burp.model.PlanNode; +import burp.reporting.StatementParts; +import burp.util.Util; + +import java.io.File; +import java.util.Collections; +import java.util.List; + +public interface SourceFile extends PlanNode { + File getFile(List fileOriginStmts); + + class Local implements SourceFile { + private final String path; + private PlanNode parent = null; + + public Local(String path) { + this.path = path; + } + + public String getPath() { + return path; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + return Collections.emptyList(); + } + + @Override + public Iterable dependencies() { + return Collections.emptyList(); + } + + @Override + public File getFile(List fileOriginStmts) { + return new File(path); + } + } + + class Remote implements SourceFile { + private final String url; + private String downloadedPath = null; + private PlanNode parent = null; + + public Remote(String url) { + this.url = url; + } + + public Remote(String url, String downloadedPath) { + this.url = url; + this.downloadedPath = downloadedPath; + } + + public String getUrl() { + return url; + } + + public String getDownloadedPath() { + return downloadedPath; + } + + public void setDownloadedPath(String downloadedPath) { + this.downloadedPath = downloadedPath; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + return Collections.emptyList(); + } + + @Override + public Iterable dependencies() { + return Collections.emptyList(); + } + + @Override + public File getFile(List fileOriginStmts) { + if (downloadedPath == null) { + downloadedPath = Util.downloadFile(url); + } + return downloadedPath != null ? new File(downloadedPath) : null; + } + } +} diff --git a/src/main/java/burp/ls/XMLIteration.java b/src/main/java/burp/ls/XMLIteration.java new file mode 100644 index 0000000..4b95fa1 --- /dev/null +++ b/src/main/java/burp/ls/XMLIteration.java @@ -0,0 +1,30 @@ +package burp.ls; + +import burp.model.Iteration; +import net.sf.saxon.s9api.XPathCompiler; +import net.sf.saxon.s9api.XdmItem; +import java.util.Set; + +public class XMLIteration extends Iteration { + private final XdmItem node; + private final XPathCompiler xPathCompiler; + + public XMLIteration(XdmItem node, Set nulls, XPathCompiler xPathCompiler) { + super(nulls); + this.node = node; + this.xPathCompiler = xPathCompiler; + } + + public XdmItem getNode() { + return node; + } + + public XPathCompiler getXPathCompiler() { + return xPathCompiler; + } + + @Override + public String asString() { + return node.toString(); + } +} diff --git a/src/main/java/burp/ls/XMLReference.java b/src/main/java/burp/ls/XMLReference.java new file mode 100644 index 0000000..624f376 --- /dev/null +++ b/src/main/java/burp/ls/XMLReference.java @@ -0,0 +1,44 @@ +package burp.ls; + +import burp.model.Iteration; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import net.sf.saxon.s9api.XPathSelector; +import net.sf.saxon.s9api.XdmItem; + +import java.util.ArrayList; +import java.util.List; + +public class XMLReference extends Reference { + public XMLReference(String reference, Origin origin) { + super(reference, origin); + } + + @Override + public List getValues(Iteration i) { + if (!(i instanceof XMLIteration xmlIteration)) { + throw new IllegalArgumentException("XMLReference " + reference + " can only be used with XMLIteration."); + } + try { + XPathSelector selector = xmlIteration.getXPathCompiler().compile(reference).load(); + selector.setContextItem(xmlIteration.getNode()); + List l = new ArrayList<>(); + for (XdmItem item : selector) { + l.add(item.getStringValue()); + } + return l; + } catch (Exception e) { + throw new BurpException( + new RmlError( + "Error executing XPath: " + reference + " on node " + i + ".", + origin, + RER.ReferenceFormulationExecutionError, + e + ) + ); + } + } +} diff --git a/src/main/java/burp/ls/XMLSource.java b/src/main/java/burp/ls/XMLSource.java index ba3dbe6..b72b0f3 100644 --- a/src/main/java/burp/ls/XMLSource.java +++ b/src/main/java/burp/ls/XMLSource.java @@ -1,176 +1,97 @@ package burp.ls; -import java.io.StringWriter; +import burp.model.Iteration; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import net.sf.saxon.s9api.*; +import org.apache.jena.rdf.model.Resource; + +import javax.xml.transform.stream.StreamSource; +import java.io.BufferedReader; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.List; -import java.util.Set; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; - -import org.apache.commons.io.IOUtils; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import burp.model.Iteration; -import burp.util.SimpleNamespaceContext; - -class XMLSource extends FileBasedLogicalSource { - - public HashMap prefixMap; - - @Override - public Iterator iterator() { - try { - if (iterations == null) { - iterations = new ArrayList<>(); - - String contents = Files.readString(Paths.get(getDecompressedFile()), encoding); - - DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); - if (prefixMap != null) { - // Required for prefix evaluation of XPath expression - builderFactory.setNamespaceAware(true); - } - DocumentBuilder builder = builderFactory.newDocumentBuilder(); - Document xmlDocument = builder.parse(IOUtils.toInputStream(contents, encoding)); - - XPath xPath = XPathFactory.newInstance().newXPath(); - if (prefixMap != null) { - SimpleNamespaceContext namespaces = new SimpleNamespaceContext(prefixMap); - xPath.setNamespaceContext(namespaces); - } - - NodeList nodes = (NodeList) xPath.compile(iterator).evaluate(xmlDocument, XPathConstants.NODESET); - - for (int i = 0; i < nodes.getLength(); i++) { - Node node = nodes.item(i); - iterations.add(new XMLIteration(node, nulls, prefixMap)); - } - } - return iterations.iterator(); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - -} - -class XMLIteration extends Iteration { - - private final Node node; - private final HashMap prefixMap; +import java.util.Map; - protected XMLIteration(Node node, Set nulls, HashMap prefixMap) { - super(nulls); +public class XMLSource extends FileBasedLogicalSource { + private List iterations = null; + public List getIterations() { return iterations; } + public void setIterations(List i) { iterations = i; } + public String iterator; + public Origin iteratorOrigin; + public Map prefixMap; + private XPathCompiler xPathCompiler; - this.node = node; - this.prefixMap = prefixMap; - } - - @Override - public List getValuesFor(String reference) { - // We need to explicitly convert the objects - // to strings because RML has not worked out - // "6.6.1 Automatically deriving datatypes" yet - List l2 = new ArrayList<>(); - try { - XPath xPath = XPathFactory.newInstance().newXPath(); - if (prefixMap != null) { - SimpleNamespaceContext namespaces = new SimpleNamespaceContext(prefixMap); - xPath.setNamespaceContext(namespaces); - } - - Object val = xPath.compile(reference).evaluate(node); - - if(val instanceof String s) { - if(!nulls.contains(s)) - l2.add(s); - } else if (val instanceof Double d) { - if(!nulls.contains(d.toString())) - l2.add(d.toString()); - } else if (val instanceof Boolean b) { - if(!nulls.contains(b.toString())) - l2.add(b.toString()); - } else if (val instanceof NodeList nodes) { - for(int i = 0; i < nodes.getLength(); i++) { - Node node = nodes.item(0); - if(node.getTextContent() != null && !nulls.contains(node.getTextContent())) - l2.add(node.getTextContent()); - } - } else { - throw new Exception("Unsupported XPath object"); - } - - } catch (Exception e) { - // No data, silently ignore - e.printStackTrace(); - } - return l2; - } - - @Override - public List getStringsFor(String reference) { - List l2 = new ArrayList<>(); - try { - XPath xPath = XPathFactory.newInstance().newXPath(); - if (prefixMap != null) { - SimpleNamespaceContext namespaces = new SimpleNamespaceContext(prefixMap); - xPath.setNamespaceContext(namespaces); - } - - Object val = xPath.compile(reference).evaluate(node); - - if(val instanceof String s) { - if(!nulls.contains(s)) - l2.add(s); - } else if (val instanceof Double d) { - if(!nulls.contains(d.toString())) - l2.add(d.toString()); - } else if (val instanceof Boolean b) { - if(!nulls.contains(b.toString())) - l2.add(b.toString()); - } else if (val instanceof NodeList nodes) { - for(int i = 0; i < nodes.getLength(); i++) { - Node node = nodes.item(0); - if(node.getTextContent() != null && !nulls.contains(node.getTextContent())) - l2.add(node.getTextContent()); - } - } else { - throw new Exception("Unsupported XPath object"); - } - - } catch (Exception e) { - // No data, silently ignore - e.printStackTrace(); - } - return l2; - } + public static final Processor processor = new Processor(false); + public static final DocumentBuilder documentBuilder = processor.newDocumentBuilder(); @Override - public String asString() { + public Iterable iterator() { try { - TransformerFactory tf = TransformerFactory.newInstance(); - Transformer transformer = tf.newTransformer(); - StringWriter writer = new StringWriter(); - transformer.transform(new DOMSource(node), new StreamResult(writer)); - return writer.toString(); + if (getIterations() == null) { + setIterations(new ArrayList<>()); + + XdmNode xmlDocument; + try (BufferedReader reader = Files.newBufferedReader(Paths.get(getDecompressedFile()), StandardCharsets.UTF_8)) { + xmlDocument = documentBuilder.build(new StreamSource(reader)); + } + + xPathCompiler = processor.newXPathCompiler(); + if (prefixMap != null) { + for (Map.Entry entry : prefixMap.entrySet()) { + xPathCompiler.declareNamespace(entry.getKey(), entry.getValue()); + } + } + + XPathSelector selector = xPathCompiler.compile(iterator).load(); + selector.setContextItem(xmlDocument); + + for (XdmItem item : selector) { + getIterations().add(new XMLIteration(item, getNulls(), xPathCompiler)); + } + } + return getIterations(); + } catch (SaxonApiException e) { + throw new BurpException( + new RmlError( + e.getMessage() != null ? e.getMessage() : "SaxonApiException", + iteratorOrigin, + RER.ReferenceFormulationSyntaxError, + e, + new HashMap<>() + ) + ); } catch (Exception e) { - throw new RuntimeException("Error converting Node to String", e); + throw new BurpException( + new RmlError( + e.getMessage() != null ? e.getMessage() : "Exception", + iteratorOrigin, + RER.ReferenceFormulationExecutionError, + e, + new HashMap<>() + ) + ); } } + @Override + public Resource getReferenceFormulation() { + return RML.XPath; + } + + @Override + public void setReferenceFormulation(Resource value) { + } + + @Override + public Reference buildExportedReference(String reference, Origin origin) { + return new XMLReference(reference, origin); + } } diff --git a/src/main/java/burp/ls/XMLSourceProvider.java b/src/main/java/burp/ls/XMLSourceProvider.java new file mode 100644 index 0000000..0cb6ac2 --- /dev/null +++ b/src/main/java/burp/ls/XMLSourceProvider.java @@ -0,0 +1,126 @@ +package burp.ls; + +import burp.model.Iteration; +import burp.model.LogicalSource; +import burp.model.Reference; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.reporting.StatementPart; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import com.google.auto.service.AutoService; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.rdf.model.StmtIterator; +import org.apache.jena.vocabulary.RDF; + +import javax.xml.transform.stream.StreamSource; +import java.io.StringReader; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import static burp.ls.FileBaseSourceProvider.*; + +@SuppressWarnings("unused") +@AutoService(LogicalSourceProvider.class) +public class XMLSourceProvider implements LogicalSourceProvider { + @Override + public boolean supports(Resource referenceFormulation) { + return RML.XPath.equals(referenceFormulation) + || referenceFormulation.hasProperty(RDF.type, RML.XPathReferenceFormulation); + } + + @Override + public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { + FileBaseSourceProvider.FileAndOrigin fileAndOrigin = getFile(ls.getPropertyResourceValue(RML.source), mappingDirectory, currentWorkingDirectory); + XMLSource source = new XMLSource(); + source.file = fileAndOrigin.file; + source.fileOriginStmts = fileAndOrigin.origin; + source.iterator = ls.getProperty(RML.iterator).getLiteral().getString(); + source.iteratorOrigin = new Origin(ls.getProperty(RML.iterator), StatementPart.Object); + source.encoding = getEncoding(ls); + source.compression = getCompression(ls); + source.nulls.addAll(getNullValues(ls)); + Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); + if (referenceFormulation.hasProperty(RDF.type, RML.XPathReferenceFormulation)) { + source.prefixMap = getPrefixMap(ls); + } + return source; + } + + @Override + public List parseStringPayload(String payload, String iterator, Origin referenceFormulationOrigin) { + try { + var xmlDocument = XMLSource.documentBuilder.build(new StreamSource(new StringReader(payload))); + var xPathCompiler = XMLSource.processor.newXPathCompiler(); + + if (iterator == null) { + throw new BurpException( + new RmlError( + "Iterator is null", + referenceFormulationOrigin, + RER.MappingError + ) + ); + } + + var selector = xPathCompiler.compile(iterator).load(); + selector.setContextItem(xmlDocument); + var nodes = selector.evaluate(); + + return StreamSupport.stream(nodes.spliterator(), false) + .map(it -> (Iteration) new XMLIteration(it, Set.of(), xPathCompiler)) + .collect(Collectors.toList()); + } catch (Exception e) { + if (e instanceof BurpException) throw (BurpException) e; + throw new BurpException( + new RmlError( + "Unexpected Error while changing iterator to type XPath, iteration content " + payload + ".", + referenceFormulationOrigin, + RER.Error, + e + ) + ); + } + } + + @Override + public Reference buildReference(String reference, Origin origin, Origin referenceFormulationOrigin) { + return new XMLReference(reference, origin); + } + + /** + * Generates prefix map from rml:namespace definitions + * + * ls should look like: + * + * ls rml:referenceFormulation [ + * rml:namespace [ + * rml:namespacePrefix "prefix" + * rml:namespaceURL "url" + * ] + * ] + * + */ + public static Map getPrefixMap(Resource ls) { + // Get XPathReferenceFormulation + Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); + // Set the map of namespaces for XPath iteration + StmtIterator properties = referenceFormulation.listProperties(RML.namespace); + Map prefixMap = new HashMap<>(); + while (properties.hasNext()) { + Statement statement = properties.next(); + Resource namespace = statement.getResource(); + String prefixValue = namespace.getProperty(RML.namespacePrefix).getLiteral().getString(); + String urlValue = namespace.getProperty(RML.namespaceURL).getLiteral().getString(); + prefixMap.put(prefixValue, urlValue); + } + return prefixMap; + } +} diff --git a/src/main/java/burp/model/AbstractLogicalSource.java b/src/main/java/burp/model/AbstractLogicalSource.java index ec46309..2558233 100644 --- a/src/main/java/burp/model/AbstractLogicalSource.java +++ b/src/main/java/burp/model/AbstractLogicalSource.java @@ -1,13 +1,34 @@ package burp.model; -import org.apache.jena.rdf.model.Resource; -import java.util.*; +import burp.reporting.BurpException; -public abstract class AbstractLogicalSource extends Iterable implements FieldParent { +import java.util.HashSet; +import java.util.Set; + +public abstract class AbstractLogicalSource implements FormulationIterable, FieldParent, ExportedReferenceScope, LogicalTargetScope { public Set nulls = new HashSet<>(); - public abstract Iterator iterator(); + public Set getNulls() { return nulls; } + private Set logicalTargets = new HashSet<>(); + private PlanNode parent = null; + + @Override + public Set getLogicalTargets() { + return logicalTargets; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + public abstract Iterable iterator() throws BurpException; @Override public String getAbsoluteFieldName() { diff --git a/src/main/java/burp/model/BaseIRIScope.java b/src/main/java/burp/model/BaseIRIScope.java new file mode 100644 index 0000000..7cb9020 --- /dev/null +++ b/src/main/java/burp/model/BaseIRIScope.java @@ -0,0 +1,5 @@ +package burp.model; + +public interface BaseIRIScope extends PlanNode { + String getBaseIri(); +} diff --git a/src/main/java/burp/model/BaseObjectMap.java b/src/main/java/burp/model/BaseObjectMap.java new file mode 100644 index 0000000..ca79278 --- /dev/null +++ b/src/main/java/burp/model/BaseObjectMap.java @@ -0,0 +1,4 @@ +package burp.model; + +public sealed interface BaseObjectMap extends PlanNode, TermGenerator permits ObjectMap, ReferencingObjectMap { +} diff --git a/src/main/java/burp/model/ConcreteExpressionMap.java b/src/main/java/burp/model/ConcreteExpressionMap.java index aa52432..5e1c718 100644 --- a/src/main/java/burp/model/ConcreteExpressionMap.java +++ b/src/main/java/burp/model/ConcreteExpressionMap.java @@ -1,32 +1,10 @@ package burp.model; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - /** * * A ConcreteExpressionMap is a concrete implementation of the abstract class * ExpressionMap for use in join conditions and logical views - * + * */ public class ConcreteExpressionMap extends ExpressionMap { - - public List generateValues(Iteration i) { - - if(expression instanceof RDFNodeConstant) - return Collections.singletonList(((RDFNodeConstant) expression).constant); - - if(expression instanceof Template) - return new ArrayList<>(((Template) expression).values(i)); - - if(expression instanceof Reference) - return ((Reference) expression).values(i); - - if(expression instanceof FunctionExecution) - return ((FunctionExecution) expression).values(i, null); - - throw new RuntimeException("Error generating values."); - } - } \ No newline at end of file diff --git a/src/main/java/burp/model/DatatypeMap.java b/src/main/java/burp/model/DatatypeMap.java index 2e23157..b4fdf59 100644 --- a/src/main/java/burp/model/DatatypeMap.java +++ b/src/main/java/burp/model/DatatypeMap.java @@ -1,5 +1,4 @@ package burp.model; public class DatatypeMap extends ExpressionMap { - } \ No newline at end of file diff --git a/src/main/java/burp/model/ExportedReferenceScope.java b/src/main/java/burp/model/ExportedReferenceScope.java new file mode 100644 index 0000000..0770e82 --- /dev/null +++ b/src/main/java/burp/model/ExportedReferenceScope.java @@ -0,0 +1,12 @@ +package burp.model; + +import burp.reporting.Origin; + +public interface ExportedReferenceScope extends PlanNode { + /** + * Builds an exported reference for external querying. + * When a TriplesMap uses a LogicalView as its logical source, references from the TriplesMap + * are evaluated against the exported fields of the LogicalView, not its internal iterators. + */ + Reference buildExportedReference(String reference, Origin origin); +} diff --git a/src/main/java/burp/model/Expression.java b/src/main/java/burp/model/Expression.java index b40b988..24acbe3 100644 --- a/src/main/java/burp/model/Expression.java +++ b/src/main/java/burp/model/Expression.java @@ -1,6 +1,9 @@ package burp.model; -public abstract class Expression { +public interface Expression extends PlanNode { + @Override + PlanNode getParent(); + @Override + void setParent(PlanNode parent); } - diff --git a/src/main/java/burp/model/ExpressionField.java b/src/main/java/burp/model/ExpressionField.java index 8339555..70292a4 100644 --- a/src/main/java/burp/model/ExpressionField.java +++ b/src/main/java/burp/model/ExpressionField.java @@ -1,7 +1,8 @@ package burp.model; +import burp.model.lv.LogicalIteration; + import java.util.ArrayList; -import java.util.Iterator; import java.util.List; public class ExpressionField extends Field { @@ -12,7 +13,7 @@ public List enrich(LogicalIteration underlying){ List list = new ArrayList<>(); int i = 0; - for(Object o : fieldExpressionMap.generateValues(underlying.getIteration(parent.getAbsoluteFieldName()))){ + for(Object o : fieldExpressionMap.generateValues(underlying.getIteration(parent.getAbsoluteFieldName()), TemplateReferenceSafety.SAFE_IRI)){ LogicalIteration e = underlying.copy(); e.put(getAbsoluteFieldName() + ".#", i++); e.put(getAbsoluteFieldName(), o); diff --git a/src/main/java/burp/model/ExpressionMap.java b/src/main/java/burp/model/ExpressionMap.java index c078d97..60aa871 100644 --- a/src/main/java/burp/model/ExpressionMap.java +++ b/src/main/java/burp/model/ExpressionMap.java @@ -1,304 +1,325 @@ package burp.model; -import java.math.BigDecimal; -import java.net.URI; -import java.sql.Date; -import java.sql.Timestamp; -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; +import burp.model.rdf.*; +import burp.parse.turtleprov.ProvTurtleVisitor; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.PointRange; +import burp.reporting.RmlError; +import burp.util.Util; +import burp.vocabularies.RER; +import org.apache.jena.util.URIref; -import org.apache.jena.datatypes.BaseDatatype; -import org.apache.jena.datatypes.xsd.XSDDatatype; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.ResourceFactory; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; -import burp.util.Util; +public abstract class ExpressionMap implements LogicalTargetScope, PlanNode { -public abstract class ExpressionMap { + private Expression expression = null; + private Origin expressionOrigin = null; + private final Set logicalTargets = new HashSet<>(); + private PlanNode parent = null; + + private String baseIRI = null; - public Expression expression = null; - - protected List generateIRIs(Iteration i, String baseIRI) { - List set = new ArrayList<>(); - - if(expression instanceof RDFNodeConstant) { - // It is assumed to be an IRI, otherwise the shapes - // Would have caught the error. - set.add(((RDFNodeConstant) expression).constant.asResource()); - return set; - } - - if(expression instanceof Template) { - for(String v : ((Template) expression).values(i, true)) { - - if(Util.isAbsoluteAndValidIRI(v)) - set.add(ResourceFactory.createResource(v)); - else if(Util.isAbsoluteAndValidIRI(baseIRI + v)) - set.add(ResourceFactory.createResource(baseIRI + v)); - else - throw new RuntimeException(baseIRI + " and " + v + " do not constitute a valid IRI"); - - } - return set; - } - - if(expression instanceof Reference) { - for(Object v : ((Reference) expression).values(i)) { - String s = v.toString(); - - if(Util.isAbsoluteAndValidIRI(s)) - set.add(ResourceFactory.createResource(s)); - else if(Util.isAbsoluteAndValidIRI(baseIRI + s)) - set.add(ResourceFactory.createResource(baseIRI + s)); - else - throw new RuntimeException(baseIRI + " and " + s + " do not constitute a valid IRI"); - } - return set; - } - - if(expression instanceof FunctionExecution) { - for(Object v : ((FunctionExecution) expression).values(i, baseIRI)) { - String s = v.toString(); - - if(Util.isAbsoluteAndValidIRI(s)) - set.add(ResourceFactory.createResource(s)); - else if(Util.isAbsoluteAndValidIRI(baseIRI + s)) - set.add(ResourceFactory.createResource(baseIRI + s)); - else - throw new RuntimeException(baseIRI + " and " + s + " do not constitute a valid IRI"); - } - return set; - } - - throw new RuntimeException("Error generating IRI."); - } + public Expression getExpression() { + return expression; + } + + public void setExpression(Expression expression) { + this.expression = expression; + } - protected List generateURIs(Iteration i, String baseIRI) { - List set = new ArrayList<>(); + public Origin getExpressionOrigin() { + return expressionOrigin; + } - if(expression instanceof RDFNodeConstant) { - // It is assumed to be an IRI, otherwise the shapes - // Would have caught the error. But we need to test whether it is - // a URI. + public void setExpressionOrigin(Origin expressionOrigin) { + this.expressionOrigin = expressionOrigin; + } - Resource r = ((RDFNodeConstant) expression).constant.asResource(); + @Override + public Set getLogicalTargets() { + return logicalTargets; + } - try { - new URI(r.getURI()); - } catch (Exception e) { - throw new RuntimeException("This is not a valid URI."); - } + @Override + public PlanNode getParent() { + return parent; + } - set.add(((RDFNodeConstant) expression).constant.asResource()); - return set; + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + List children = new ArrayList<>(); + if (expression != null) { + children.add(expression); } + return children; + } - if(expression instanceof Template) { - for(String v : ((Template) expression).values(i, true)) { + @Override + public Iterable dependencies() { + return children(); + } - if(Util.isAbsoluteAndValidURI(v)) - set.add(ResourceFactory.createResource(v)); - else if(Util.isAbsoluteAndValidURI(baseIRI + v)) - set.add(ResourceFactory.createResource(baseIRI + v)); - else - throw new RuntimeException(baseIRI + " and " + v + " do not constitute a valid URI"); + private String getBaseIRI() { + if (baseIRI == null) { + BaseIRIScope scope = (BaseIRIScope) ancestor(BaseIRIScope.class); + if (scope != null) { + baseIRI = scope.getBaseIri(); + } + } + return baseIRI; + } + public List generateValues(Iteration i, TemplateReferenceSafety safe) { + if (expression instanceof RDFNodeConstant) { + RDFNodeConstant expr = (RDFNodeConstant) expression; + List list = new ArrayList<>(); + if (expr.constant != null) { + list.add(expr.constant); } - return set; + return list; + } else if (expression instanceof Template) { + return (List) (List) ((Template) expression).values(i, safe); + } else if (expression instanceof Reference) { + return ((Reference) expression).values(i); + } else if (expression instanceof FunctionExecution) { + return ((FunctionExecution) expression).values(i); + } else { + throw new BurpException( + new RmlError( + "Error generating values, expression is not supported.", + expressionOrigin, + RER.UnsupportedMapping + ) + ); } + } - if(expression instanceof Reference) { - for(Object v : ((Reference) expression).values(i)) { - String s = v.toString(); + public List generateUnsafeIRIs(Iteration i) { + Set targets = getEffectiveTargets(); + List values = generateValues(i, TemplateReferenceSafety.UNSAFE); + List result = new ArrayList<>(); + + for (Object it : values) { + if (it instanceof IRITerm) { + result.add(new IRITerm(((IRITerm) it).uri(), targets)); + } else { + String string; + if (it instanceof String) { + string = (String) it; + } else if (it instanceof LiteralTerm) { + string = ((LiteralTerm) it).value(); + } else { + string = it.toString(); + } + + String encoded = URIref.encode(string); + String baseIriVal = getBaseIRI(); + String baseEncoded = URIref.encode(baseIriVal + string); + + if (Util.isValidAndAbsoluteIRI(encoded)) { + result.add(new IRITerm(string, targets)); + } else if (Util.isValidAndAbsoluteIRI(baseEncoded)) { + result.add(new IRITerm(baseIriVal + string, targets)); + } else { + throw new BurpException( + new RmlError( + baseIriVal + " and " + string + " do not constitute a valid UnsafeIRI", + expressionOrigin, + RER.InvalidIRI + ) + ); + } + } + } + return result; + } - if(Util.isAbsoluteAndValidURI(s)) - set.add(ResourceFactory.createResource(s)); - else if(Util.isAbsoluteAndValidURI(baseIRI + s)) - set.add(ResourceFactory.createResource(baseIRI + s)); - else - throw new RuntimeException(baseIRI + " and " + s + " do not constitute a valid URI"); + public List generateIRIs(Iteration i) { + Set targets = getEffectiveTargets(); + List values = generateValues(i, TemplateReferenceSafety.SAFE_IRI); + List result = new ArrayList<>(); + + for (Object it : values) { + if (it instanceof IRITerm) { + result.add(new IRITerm(((IRITerm) it).uri(), targets)); + } else { + String string; + if (it instanceof String) { + string = (String) it; + } else if (it instanceof LiteralTerm) { + string = ((LiteralTerm) it).value(); + } else { + string = it.toString(); + } + + String baseIriVal = getBaseIRI(); + + if (Util.isValidAndAbsoluteIRI(string)) { + result.add(new IRITerm(string, targets)); + } else if (Util.isValidAndAbsoluteIRI(baseIriVal + string)) { + result.add(new IRITerm(baseIriVal + string, targets)); + } else { + throw new BurpException( + new RmlError( + baseIriVal + " and " + string + " do not constitute a valid IRI", + expressionOrigin, + RER.InvalidIRI + ) + ); + } } - return set; } + return result; + } - if(expression instanceof FunctionExecution) { - for(Object v : ((FunctionExecution) expression).values(i, baseIRI)) { - String s = v.toString(); + public List generateURIs(Iteration i) { + Set targets = getEffectiveTargets(); + List values = generateValues(i, TemplateReferenceSafety.SAFE_URI); + List result = new ArrayList<>(); + + for (Object it : values) { + if (it instanceof IRITerm) { + result.add(new IRITerm(((IRITerm) it).uri(), targets)); + } else { + String string; + if (it instanceof String) { + string = (String) it; + } else { + string = it.toString(); + } + + String baseIriVal = getBaseIRI(); + + if (Util.isValidAndAbsoluteURI(string)) { + result.add(new IRITerm(string, targets)); + } else if (Util.isValidAndAbsoluteURI(baseIriVal + string)) { + result.add(new IRITerm(baseIriVal + string, targets)); + } else { + throw new BurpException( + new RmlError( + baseIriVal + " and " + string + " do not constitute a valid URI", + expressionOrigin, + RER.InvalidURI + ) + ); + } + } + } + return result; + } - if(Util.isAbsoluteAndValidURI(s)) - set.add(ResourceFactory.createResource(s)); - else if(Util.isAbsoluteAndValidURI(baseIRI + s)) - set.add(ResourceFactory.createResource(baseIRI + s)); - else - throw new RuntimeException(baseIRI + " and " + s + " do not constitute a valid IRI"); + protected List generateBlankNodes(Iteration i) { + Set targets = getEffectiveTargets(); + + if (expression instanceof RDFNodeConstant) { + RDFNodeConstant expr = (RDFNodeConstant) expression; + if (expr.constant instanceof BlankNodeTerm) { + BlankNodeTerm constant = (BlankNodeTerm) expr.constant; + return Collections.singletonList(new BlankNodeTerm(constant.id(), targets)); + } else { + return Collections.emptyList(); } - return set; + } else if (expression instanceof Template) { + return ((Template) expression).values(i, TemplateReferenceSafety.UNSAFE).stream() + .map(val -> blankNodeFor(val, targets)) + .collect(Collectors.toList()); + } else if (expression instanceof Reference) { + return ((Reference) expression).values(i).stream() + .map(val -> blankNodeFor(val, targets)) + .collect(Collectors.toList()); + } else if (expression instanceof FunctionExecution) { + return ((FunctionExecution) expression).values(i).stream() + .map(val -> blankNodeFor(val, targets)) + .collect(Collectors.toList()); + } else if (expression == null) { + return Collections.singletonList(new BlankNodeTerm("bnode-" + (blankNodeIdCounter++), targets)); + } else { + throw new RuntimeException("Error generating blank node."); } + } + + private BlankNodeTerm blankNodeFor(Object value, Set targets) { + String id = blankNodeMap.computeIfAbsent(value, k -> "bnode-" + (blankNodeIdCounter++)); + return new BlankNodeTerm(id, targets); + } + + private Set intersectTargets(Set t1, Set t2) { + if (t1.isEmpty()) return t2; + if (t2.isEmpty()) return t1; + Set intersection = new HashSet<>(t1); + intersection.retainAll(t2); + return intersection; + } - throw new RuntimeException("Error generating IRI."); + protected List generateLiterals(Iteration i, DatatypeMap dm, LanguageMap lm) { + List datatypes = dm != null ? dm.generateIRIs(i) : null; + List languages = lm != null ? lm.generateLanguageTags(i) : null; + Set baseTargets = getEffectiveTargets(); + + if (expression instanceof RDFNodeConstant) { + RDFNodeConstant expr = (RDFNodeConstant) expression; + if (expr.constant instanceof LiteralTerm) { + LiteralTerm constant = (LiteralTerm) expr.constant; + return Collections.singletonList(new LiteralTerm(constant.value(), constant.datatype(), constant.language(), baseTargets)); + } else { + return Collections.emptyList(); + } + } else if (expression instanceof Template) { + return ((Template) expression).values(i, TemplateReferenceSafety.UNSAFE).stream() + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .collect(Collectors.toList()); + } else if (expression instanceof Reference) { + return ((Reference) expression).values(i).stream() + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .collect(Collectors.toList()); + } else if (expression instanceof FunctionExecution) { + return ((FunctionExecution) expression).values(i).stream() + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .collect(Collectors.toList()); + } else { + throw new RuntimeException("Error generating literal or value."); + } + } + + private List literalFor(Object value, List datatypes, List languages, Set baseTargets) { + if (value == null) { + return Collections.emptyList(); + } else if (languages != null) { + return languages.stream() + .map(langTag -> new LiteralTerm(value.toString(), null, langTag.tag(), intersectTargets(baseTargets, langTag.targets()))) + .collect(Collectors.toList()); + } else if (datatypes != null) { + return datatypes.stream() + .map(dt -> new LiteralTerm(value.toString(), dt, null, intersectTargets(baseTargets, dt.targets()))) + .collect(Collectors.toList()); + } else { + Term term = Datardf.toTerm(value); + if (term instanceof LiteralTerm) { + LiteralTerm lt = (LiteralTerm) term; + return List.of(new LiteralTerm(lt.value(), lt.datatype(), lt.language(), baseTargets)); + } else { + return Collections.singletonList(new LiteralTerm(value.toString(), null, null, baseTargets)); + } + } + } + + @Override + public List nodeRanges() { + if (expressionOrigin == null || expressionOrigin.sourceStatements() == null) { + return Collections.emptyList(); + } + return ProvTurtleVisitor.retrieveTurtleLocation(expressionOrigin.sourceStatements()); } - static private final Map map = new HashMap<>(); - protected List generateBlankNodes(Iteration i, String baseIRI) { - List set = new ArrayList<>(); - - if(expression instanceof RDFNodeConstant) { - // It is assumed to be a BN, otherwise the shapes - // Would have caught the error. - RDFNode n = ((RDFNodeConstant) expression).constant.asResource(); - set.add(map.computeIfAbsent(n, (x) -> ResourceFactory.createResource())); - return set; - } - - if(expression instanceof Template) { - for(String v : ((Template) expression).values(i)) { - set.add(map.computeIfAbsent(v, (x) -> ResourceFactory.createResource())); - } - return set; - } - - if(expression instanceof Reference) { - for(Object v : ((Reference) expression).values(i)) { - set.add(map.computeIfAbsent(v, (x) -> ResourceFactory.createResource())); - } - return set; - } - - if(expression == null) { - // IF NO REFERENCE, TEMPLATE, OR CONSTANT, - // THEN WE GENERATE BLANK NODES (BASED ON THE ITERATION) - set.add(ResourceFactory.createResource()); - return set; - } - - if(expression instanceof FunctionExecution) { - for(Object v : ((FunctionExecution) expression).values(i, baseIRI)) { - set.add(map.computeIfAbsent(v, (x) -> ResourceFactory.createResource())); - } - return set; - } - - throw new RuntimeException("Error generating blank node."); - } - - protected List generateLiterals(Iteration i, String baseIRI, DatatypeMap dm, LanguageMap lm) { - List set = new ArrayList<>(); - - if(expression instanceof RDFNodeConstant) { - // It is assumed to be a literal, otherwise the shapes - // Would have caught the error. - set.add(((RDFNodeConstant) expression).constant); - return set; - } - - List datatypes = dm != null ? dm.generateIRIs(i, baseIRI) : null; - List languages = lm != null ? lm.generateStrings(i) : null; - - if(expression instanceof Template) { - for(String v : ((Template) expression).values(i)) { - if(languages != null) { - for(String l : languages) { - set.add(ResourceFactory.createLangLiteral(v, l)); - } - } else if(datatypes != null) { - for(RDFNode dt : datatypes) { - String dturi = dt.asResource().getURI(); - set.add(ResourceFactory.createTypedLiteral(v, new BaseDatatype(dturi))); - } - } else { - set.add(createTypedLiteral(v)); - } - } - return set; - } - - if(expression instanceof Reference) { - for(Object v : ((Reference) expression).values(i)) { - if(languages != null) { - for(String l : languages) { - set.add(ResourceFactory.createLangLiteral(v.toString(), l)); - } - } else if(datatypes != null) { - for(RDFNode dt : datatypes) { - String dturi = dt.asResource().getURI(); - set.add(ResourceFactory.createTypedLiteral(v.toString(), new BaseDatatype(dturi))); - } - } else { - set.add(createTypedLiteral(v)); - } - } - return set; - } - - if(expression instanceof FunctionExecution) { - for(Object v : ((FunctionExecution) expression).values(i, baseIRI)) { - if(languages != null) { - for(String l : languages) { - set.add(ResourceFactory.createLangLiteral(v.toString(), l)); - } - } else if(datatypes != null) { - for(RDFNode dt : datatypes) { - String dturi = dt.asResource().getURI(); - set.add(ResourceFactory.createTypedLiteral(v.toString(), new BaseDatatype(dturi))); - } - } else { - set.add(createTypedLiteral(v)); - } - } - return set; - } - - throw new RuntimeException("Error generating literal or value."); - } - - private Literal createTypedLiteral(Object o) { - if(o instanceof Integer || o instanceof Long) - return ResourceFactory.createTypedLiteral(o.toString(), XSDDatatype.XSDinteger); - else if(o instanceof Float) { - String s = doubleCanonicalMap(Double.valueOf(o.toString())); - return ResourceFactory.createTypedLiteral(s, XSDDatatype.XSDdouble); - } else if(o instanceof Double) { - String s = doubleCanonicalMap(((Double) o)); - return ResourceFactory.createTypedLiteral(s, XSDDatatype.XSDdouble); - } else if(o instanceof Date) { - return ResourceFactory.createTypedLiteral(o.toString(), XSDDatatype.XSDdate); - } else if(o instanceof Timestamp t) { - String s = o.toString().replace(" ", "T"); - - // Ensure canonical xsd:dateTime by removing the ".0" when no fraction - if(t.getNanos() == 0) - s = s.replace(".0", ""); - - return ResourceFactory.createTypedLiteral(s, XSDDatatype.XSDdateTime); - } else if(o instanceof Literal) { - return (Literal) o; - } - - return ResourceFactory.createTypedLiteral(o); - } - - private static String doubleCanonicalMap(Double d) { - BigDecimal f = BigDecimal.valueOf(d); - // The number of digits in the unscaled value - int p = f.precision(); - // We start from two digits - // Add the remaining digits to the pattern - String x = "0.0" + "#".repeat(Math.max(0, p - 2)) + - // Let's not forget the e-notation - "E0"; - - NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US); - DecimalFormat formatter = (DecimalFormat) numberFormat; - formatter.applyPattern(x); - - return formatter.format(d); - } - + private static long blankNodeIdCounter = 0L; + private static final Map blankNodeMap = new ConcurrentHashMap<>(); } \ No newline at end of file diff --git a/src/main/java/burp/model/Field.java b/src/main/java/burp/model/Field.java index c57efe6..b31ae56 100644 --- a/src/main/java/burp/model/Field.java +++ b/src/main/java/burp/model/Field.java @@ -1,5 +1,7 @@ package burp.model; +import burp.model.lv.LogicalIteration; + import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/burp/model/FilePathTarget.java b/src/main/java/burp/model/FilePathTarget.java new file mode 100644 index 0000000..2767d8d --- /dev/null +++ b/src/main/java/burp/model/FilePathTarget.java @@ -0,0 +1,21 @@ +package burp.model; + +import org.apache.jena.rdf.model.Resource; + +public class FilePathTarget extends RMLTarget { + private String path; + private Resource root; + + public FilePathTarget(String path, Resource root) { + this.path = path; + this.root = root; + } + + public String getPath() { + return path; + } + + public Resource getRoot() { + return root; + } +} diff --git a/src/main/java/burp/model/FormulationIterable.java b/src/main/java/burp/model/FormulationIterable.java new file mode 100644 index 0000000..47bd328 --- /dev/null +++ b/src/main/java/burp/model/FormulationIterable.java @@ -0,0 +1,8 @@ +package burp.model; + +import org.apache.jena.rdf.model.Resource; + +public interface FormulationIterable extends PlanNode { + Resource getReferenceFormulation(); + void setReferenceFormulation(Resource referenceFormulation); +} \ No newline at end of file diff --git a/src/main/java/burp/model/FunctionExecution.java b/src/main/java/burp/model/FunctionExecution.java index d9346da..b3ce8a8 100644 --- a/src/main/java/burp/model/FunctionExecution.java +++ b/src/main/java/burp/model/FunctionExecution.java @@ -1,68 +1,125 @@ package burp.model; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.jena.rdf.model.RDFNode; - -import burp.model.fnmlutil.Functions; - -public class FunctionExecution extends Expression { - - public FunctionMap functionMap; - public List inputs = new ArrayList<>(); - public ReturnMap returnMap; - - public List values(Iteration i, String baseIRI) { - List list = new ArrayList<>(); - - // TODO: We assume that function maps, parameter maps, and input value maps only yield one value - List functions = functionMap.generateIRIs(i, baseIRI); - if(functions.size() != 1) - throw new RuntimeException("Function map should generate exactly one value."); - - String function = functions.get(0).asResource().getURI(); - - // Bind parameters via a map - Map map = new HashMap<>(); - - for(Input input : inputs) { - List parameters = input.parameterMap.generateIRIs(i, baseIRI); - if(parameters.size() != 1) - throw new RuntimeException("Parameter map should generate exactly one value."); - - String parameter = parameters.get(0).asResource().getURI(); - - List inputs = input.inputValueMap.generateTerms(i, baseIRI); - if(inputs.size() != 1) - throw new RuntimeException("Input value map should generate exactly one value."); - - Object in = inputs.get(0).isResource() ? inputs.get(0) : inputs.get(0).asLiteral(); - - map.put(parameter, in); - } - - for(Return o : Functions.execute(function, map)) { - // if return map is null, then we return the default return value - // Otherwise, look for the value identified by the return map - if(returnMap == null) { - list.add(o.defaultValue); - } else { - List returns = returnMap.generateIRIs(i, baseIRI); - if(returns.size() != 1) - throw new RuntimeException("Input value map should generate exactly one value."); - - Object v = o.get(returns.get(0)); - if(v == null) - throw new RuntimeException("Return value %s no known.".formatted(returns.get(0))); - - list.add(v); - } - } - - return list; - } +import burp.model.fnmlutil.FunctionsRegistry; +import burp.model.rdf.IRITerm; +import burp.parse.turtleprov.ProvTurtleVisitor; +import burp.reporting.*; +import burp.vocabularies.RER; +import java.util.*; + +public class FunctionExecution implements Expression { + private PlanNode parent = null; + public FunctionMap functionMap = null; + public List inputs = new ArrayList<>(); + public ReturnMap returnMap = null; + + public StatementParts callStmt; + public List inputsStmt = new ArrayList<>(); + public StatementParts returnMapStmt = null; + public StatementParts functionMapStmt = null; + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public List children() { + List list = new ArrayList<>(); + if (functionMap != null) list.add(functionMap); + for (Input input : inputs) { + if (input.parameterMap != null) list.add(input.parameterMap); + if (input.inputValueMap != null) list.add(input.inputValueMap); + } + if (returnMap != null) list.add(returnMap); + return list; + } + + @Override + public List dependencies() { + return Collections.emptyList(); + } + + @Override + public List nodeRanges() { + List pointers = new ArrayList<>(); + pointers.add(callStmt); + if (functionMapStmt != null) pointers.add(functionMapStmt); + if (returnMapStmt != null) pointers.add(returnMapStmt); + pointers.addAll(inputsStmt); + return ProvTurtleVisitor.retrieveTurtleLocation(pointers); + } + + public List values(Iteration iteration) { + List list = new ArrayList<>(); + + List functions = functionMap.generateIRIs(iteration); + if (functions.size() != 1) { + throw new BurpException(new RmlError( + "Function map should generate exactly one value.", + new Origin(this, functionMapStmt != null ? List.of(functionMapStmt) : List.of()), + RER.FunctionExecutionError + )); + } + + String functionUri = functions.get(0).uri(); + + Map map = new HashMap<>(); + + for (int i = 0; i < inputs.size(); i++) { + Input input = inputs.get(i); + List parameters = input.parameterMap.generateIRIs(iteration); + if (parameters.size() != 1) { + throw new BurpException(new RmlError( + "Parameter map should generate exactly one value.", + new Origin(this, List.of(inputsStmt.get(i))), + RER.FunctionExecutionError + )); + } + + String parameterUri = parameters.getFirst().uri(); + + var generatedInputs = input.inputValueMap.generateTerms(iteration); + if (generatedInputs.size() != 1) { + throw new BurpException(new RmlError( + "Input value map should generate exactly one value.", + new Origin(this, List.of(inputsStmt.get(i))), + RER.FunctionExecutionError + )); + } + + map.put(parameterUri, generatedInputs.getFirst()); + } + + Origin originCall = new Origin(this, List.of(callStmt)); + + List results = FunctionsRegistry.execute(functionUri, map, originCall); + for (Return o : results) { + Origin originReturnMap = new Origin(this, returnMapStmt != null ? List.of(returnMapStmt) : List.of()); + if (returnMap == null) { + list.add(o.defaultValue); + } else { + List returns = returnMap.generateIRIs(iteration); + if (returns.size() != 1) { + throw new BurpException(new RmlError( + "Return map should generate exactly one value.", + originReturnMap, + RER.FunctionExecutionError + )); + } + + String returnUri = returns.get(0).uri(); + Object v = o.get(returnUri); + list.add(v); + } + } + + return list; + } } \ No newline at end of file diff --git a/src/main/java/burp/model/FunctionMap.java b/src/main/java/burp/model/FunctionMap.java index 3171156..37d68d6 100644 --- a/src/main/java/burp/model/FunctionMap.java +++ b/src/main/java/burp/model/FunctionMap.java @@ -1,30 +1,21 @@ package burp.model; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; +import java.util.Set; public class FunctionMap extends TermMap { + public FunctionMap() { + this.termType = RML.IRI; + } - public FunctionMap() { - termType = RML.IRI; - } - - @Override - public List generateTerms(Iteration i, String baseIRI) { - if(termType == RML.IRI) - return generateIRIs(i, baseIRI); - if(termType == RML.URI) - return generateURIs(i, baseIRI); - - throw new RuntimeException("Incorrect term type for function map."); - } + @Override + public String getName() { + return "function map"; + } - @Override - public boolean isGatherMap() { - return false; - } - + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/GraphMap.java b/src/main/java/burp/model/GraphMap.java index 5c10e27..3df3ed0 100644 --- a/src/main/java/burp/model/GraphMap.java +++ b/src/main/java/burp/model/GraphMap.java @@ -1,31 +1,23 @@ package burp.model; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; + +import java.util.Set; public class GraphMap extends TermMap { - - public GraphMap() { - termType = RML.IRI; - } - public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(termType == RML.URI) - return generateURIs(i, baseIRI); - if(RML.BLANKNODE.equals(termType)) - return generateBlankNodes(i, baseIRI); - - throw new RuntimeException("Incorrect term type for graph map."); - } - - @Override - public boolean isGatherMap() { - return false; - } - + public GraphMap() { + this.termType = RML.IRI; + } + + @Override + public String getName() { + return "graph map"; + } + + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI, RML.BLANKNODE); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/Input.java b/src/main/java/burp/model/Input.java index e6a3cba..ea6a6c3 100644 --- a/src/main/java/burp/model/Input.java +++ b/src/main/java/burp/model/Input.java @@ -1,7 +1,6 @@ package burp.model; public class Input { - - public ParameterMap parameterMap; - public InputValueMap inputValueMap; + public ParameterMap parameterMap; + public InputValueMap inputValueMap; } diff --git a/src/main/java/burp/model/InputValueMap.java b/src/main/java/burp/model/InputValueMap.java index 663a15f..59aaffa 100644 --- a/src/main/java/burp/model/InputValueMap.java +++ b/src/main/java/burp/model/InputValueMap.java @@ -1,37 +1,22 @@ package burp.model; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - +import burp.vocabularies.BURP; import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; +import java.util.Set; public class InputValueMap extends TermMap { - - public DatatypeMap datatypeMap = null; - public LanguageMap languageMap = null; - - public InputValueMap() { - termType = RML.LITERAL; - } - - @Override - public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(RML.URI.equals(termType)) - return generateURIs(i, baseIRI); - if(RML.BLANKNODE.equals(termType)) - return generateBlankNodes(i, baseIRI); - if(RML.LITERAL.equals(termType)) - return generateLiterals(i, baseIRI, datatypeMap, languageMap); - - throw new RuntimeException("Incorrect term type for input value map."); - } + public InputValueMap() { + this.termType = RML.LITERAL; + } + + @Override + public String getName() { + return "input value map"; + } - @Override - public boolean isGatherMap() { - return false; - } - + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI, RML.BLANKNODE, RML.LITERAL, BURP.CollectionOrContainer); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/Iterable.java b/src/main/java/burp/model/Iterable.java deleted file mode 100644 index 3503f3d..0000000 --- a/src/main/java/burp/model/Iterable.java +++ /dev/null @@ -1,14 +0,0 @@ -package burp.model; - -import org.apache.jena.rdf.model.Resource; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -public abstract class Iterable { - - public String iterator; - public Resource referenceFormulation; - -} \ No newline at end of file diff --git a/src/main/java/burp/model/IterableField.java b/src/main/java/burp/model/IterableField.java index 3e3a321..d6d9bb7 100644 --- a/src/main/java/burp/model/IterableField.java +++ b/src/main/java/burp/model/IterableField.java @@ -1,16 +1,30 @@ package burp.model; import burp.ls.LogicalSourceFactory; +import burp.model.lv.LogicalIteration; +import burp.reporting.Origin; import org.apache.jena.rdf.model.Resource; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -public class IterableField extends Field { +public class IterableField extends Field implements FormulationIterable { public String iterator; - public Resource referenceFormulation; +public Resource declaredReferenceFormulation; +public Origin declaredReferenceFormulationOrigin; +public Resource referenceFormulation; +private PlanNode planNodeParent; + +@Override +public Resource getReferenceFormulation() { return referenceFormulation; } +@Override +public void setReferenceFormulation(Resource r) { referenceFormulation = r; } + +@Override +public PlanNode getParent() { return planNodeParent; } +@Override +public void setParent(PlanNode p) { planNodeParent = p; } public List enrich(LogicalIteration underlying) { List list = new ArrayList<>(); diff --git a/src/main/java/burp/model/Iteration.java b/src/main/java/burp/model/Iteration.java index bfa29bd..99bd7f3 100644 --- a/src/main/java/burp/model/Iteration.java +++ b/src/main/java/burp/model/Iteration.java @@ -1,20 +1,15 @@ package burp.model; -import java.util.HashSet; -import java.util.List; import java.util.Set; public abstract class Iteration { - - public Set nulls = new HashSet<>(); - - public Iteration(Set nulls) { - this.nulls = nulls; - } + public final Set nulls; - public abstract List getValuesFor(String reference); + public Set getNulls() { return nulls; } - public abstract List getStringsFor(String reference); + public Iteration(Set nulls) { + this.nulls = nulls; + } public abstract String asString(); } \ No newline at end of file diff --git a/src/main/java/burp/model/JoinCondition.java b/src/main/java/burp/model/JoinCondition.java index 0aa3c9b..0498b52 100644 --- a/src/main/java/burp/model/JoinCondition.java +++ b/src/main/java/burp/model/JoinCondition.java @@ -1,8 +1,55 @@ package burp.model; -public class JoinCondition { - - public ConcreteExpressionMap parentMap = null; - public ConcreteExpressionMap childMap = null; +import java.util.ArrayList; +import java.util.List; +public class JoinCondition implements PlanNode, ReferenceHolder { + public ConcreteExpressionMap parentMap; + public ConcreteExpressionMap childMap; + + private PlanNode parent = null; + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + List list = new ArrayList<>(); + if (parentMap != null) list.add(parentMap); + if (childMap != null) list.add(childMap); + return list; + } + + @Override + public Iterable dependencies() { + return children(); + } + + @Override + public void compileReferences() { + ParentJoinReferenceScope parentScope = ancestor(ParentJoinReferenceScope.class); + if (parentScope != null && parentMap != null) { + for (RawReference ref : parentMap.descendants(RawReference.class).toList()) { + if (ref.getReference() != null && ref.getCompiledReference() == null) { + ref.setCompiledReference(parentScope.buildParentJoinReference(ref.getReference(), ref.getOrigin())); + } + } + } + + LocalReferenceScope localScope = ancestor(LocalReferenceScope.class); + if (localScope != null && childMap != null) { + for (RawReference ref : childMap.descendants(RawReference.class).toList()) { + if (ref.getReference() != null && ref.getCompiledReference() == null) { + ref.setCompiledReference(localScope.buildLocalReference(ref.getReference(), ref.getOrigin())); + } + } + } + } } \ No newline at end of file diff --git a/src/main/java/burp/model/LanguageMap.java b/src/main/java/burp/model/LanguageMap.java index 244286a..f940ce0 100644 --- a/src/main/java/burp/model/LanguageMap.java +++ b/src/main/java/burp/model/LanguageMap.java @@ -1,39 +1,47 @@ package burp.model; -import java.util.ArrayList; + +import burp.model.rdf.LiteralTerm; +import burp.reporting.BurpException; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import org.apache.jena.langtagx.LangTagX; + import java.util.List; -import java.util.regex.Pattern; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; public class LanguageMap extends ExpressionMap { - public List generateStrings(Iteration i) { - List set = new ArrayList<>(); - - if(expression instanceof RDFNodeConstant) { - // It is assumed to be a string, otherwise the shapes - // Would have caught the error. - set.add(((RDFNodeConstant) expression).constant.toString()); - } - else if(expression instanceof Template) { - set.addAll(((Template) expression).values(i)); - } - else if(expression instanceof Reference) { - for(Object o : ((Reference) expression).values(i)) - set.add(o.toString()); - } - - set.forEach((l) -> { - if(!isValidLanguageCode(l)) - throw new RuntimeException("Invalid language code: " + l); - }); - - return set; - } - - // Source of REGEX based on, but reduced: https://www.regextester.com/103066 - private static Pattern p = Pattern.compile("^(((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?))(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$"); - private boolean isValidLanguageCode(String lang) { - return p.matcher(lang).find(); - } + /** + * Generate valid Language Tags according to RFC 5646 + */ + public List generateLanguageTags(Iteration i) { + Set targets = getEffectiveTargets(); + return generateValues(i, TemplateReferenceSafety.UNSAFE) + .stream() + .filter(Objects::nonNull) + .map(it -> { + String string; + if (it instanceof LiteralTerm literalTerm) { + string = literalTerm.value(); + } else { + string = it.toString(); + } + if (LangTagX.checkLanguageTag(string)) { + return new LanguageTag(string, targets); + } else { + throw new BurpException( + new RmlError( + "Invalid language code: " + it, + getExpressionOrigin(), + RER.InvalidLanguageTagError + ) + ); + } + }) + .collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/LanguageTag.java b/src/main/java/burp/model/LanguageTag.java new file mode 100644 index 0000000..769ed72 --- /dev/null +++ b/src/main/java/burp/model/LanguageTag.java @@ -0,0 +1,6 @@ +package burp.model; + +import java.util.Set; + +public record LanguageTag(String tag, Set targets) { +} diff --git a/src/main/java/burp/model/LocalReferenceScope.java b/src/main/java/burp/model/LocalReferenceScope.java new file mode 100644 index 0000000..780f3f9 --- /dev/null +++ b/src/main/java/burp/model/LocalReferenceScope.java @@ -0,0 +1,11 @@ +package burp.model; + +import burp.reporting.Origin; + +public interface LocalReferenceScope extends PlanNode { + /** + * Builds a reference for the local scope context. + * Use this for normal properties, subjects, objects, or the childMap of a join condition. + */ + Reference buildLocalReference(String reference, Origin origin); +} diff --git a/src/main/java/burp/model/LogicalSource.java b/src/main/java/burp/model/LogicalSource.java index 2398e46..48fca3f 100644 --- a/src/main/java/burp/model/LogicalSource.java +++ b/src/main/java/burp/model/LogicalSource.java @@ -2,10 +2,28 @@ import org.apache.jena.rdf.model.Resource; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; +import java.util.Collections; public abstract class LogicalSource extends AbstractLogicalSource { + public Resource referenceFormulation; + @Override + public Iterable children() { + return Collections.emptyList(); + } + + @Override + public Iterable dependencies() { + return children(); + } + + @Override + public Resource getReferenceFormulation() { + return referenceFormulation; + } + + @Override + public void setReferenceFormulation(Resource referenceFormulation) { + this.referenceFormulation = referenceFormulation; + } } \ No newline at end of file diff --git a/src/main/java/burp/model/LogicalTarget.java b/src/main/java/burp/model/LogicalTarget.java new file mode 100644 index 0000000..559a682 --- /dev/null +++ b/src/main/java/burp/model/LogicalTarget.java @@ -0,0 +1,37 @@ +package burp.model; + +import org.apache.jena.rdf.model.Resource; + +public class LogicalTarget { + private RMLTarget target; + private Resource serialization; + private Resource compression; + private Resource encoding; + + public LogicalTarget(RMLTarget target, Resource serialization, Resource compression, Resource encoding) { + this.target = target; + this.serialization = serialization; + this.compression = compression; + this.encoding = encoding; + } + + public LogicalTarget(RMLTarget target) { + this.target = target; + } + + public RMLTarget getTarget() { + return target; + } + + public Resource getSerialization() { + return serialization; + } + + public Resource getCompression() { + return compression; + } + + public Resource getEncoding() { + return encoding; + } +} diff --git a/src/main/java/burp/model/LogicalTargetScope.java b/src/main/java/burp/model/LogicalTargetScope.java new file mode 100644 index 0000000..3efc637 --- /dev/null +++ b/src/main/java/burp/model/LogicalTargetScope.java @@ -0,0 +1,25 @@ +package burp.model; + +import java.util.Collections; +import java.util.Set; + +public interface LogicalTargetScope extends PlanNode { + Set getLogicalTargets(); + + default Set getEffectiveTargets() { + if (getLogicalTargets() != null && !getLogicalTargets().isEmpty()) { + return getLogicalTargets(); + } + PlanNode p = getParent(); + while (p != null) { + if (p instanceof LogicalTargetScope) { + LogicalTargetScope lts = (LogicalTargetScope) p; + if (lts.getLogicalTargets() != null && !lts.getLogicalTargets().isEmpty()) { + return lts.getLogicalTargets(); + } + } + p = p.getParent(); + } + return Collections.emptySet(); + } +} diff --git a/src/main/java/burp/model/LogicalView.java b/src/main/java/burp/model/LogicalView.java deleted file mode 100644 index 5dec733..0000000 --- a/src/main/java/burp/model/LogicalView.java +++ /dev/null @@ -1,214 +0,0 @@ -package burp.model; - -import com.opencsv.CSVWriter; - -import java.io.StringWriter; -import java.util.*; -import java.util.stream.Collectors; - -public class LogicalView extends AbstractLogicalSource implements ContainsFields { - - private List iterations = null; - - public AbstractLogicalSource logicalSource; - - public List expressionFields = new ArrayList<>(); - public List iterableFields = new ArrayList<>(); - - public List joins = new ArrayList<>(); - - @Override - public Iterator iterator() { - try { - if (iterations == null) { - iterations = new ArrayList<>(); - - List list = new ArrayList<>(); - Iterator iterator = logicalSource.iterator(); - int index = 0; - while (iterator.hasNext()) { - Iteration i = iterator.next(); - LogicalIteration li = new LogicalIteration(logicalSource.nulls); - li.put("#", index++); - li.put("", i); - list.add(li); - } - - iterations = Field.expand(list, expressionFields, iterableFields); - - for(ViewJoin join : joins) { - iterations = join.expand(iterations); - } - } - - // Create wrapper to safely treat LogicalIterations as Iterations... - return new Iterator<>() { - private final Iterator inner = iterations.iterator(); - - @Override - public boolean hasNext() { - return inner.hasNext(); - } - - @Override - public Iteration next() { - return inner.next(); - } - }; - - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - @Override - public List getIterableFields() { - return iterableFields; - } - - @Override - public List getExpressionFields() { - return expressionFields; - } - - @Override - public void addField(Field field) { - // The parent of a logical view's fields is its logical source. - field.parent = this.logicalSource; - - if (field instanceof IterableField) { - iterableFields.add((IterableField) field); - } else if (field instanceof ExpressionField) { - expressionFields.add((ExpressionField) field); - } else - throw new RuntimeException("Unknown field type."); - } - - public void addJoin(ViewJoin join) { - joins.add(join); - } - -} - -class LogicalIteration extends Iteration { - - public Map map = new HashMap<>(); - - public LogicalIteration(Set nulls) { - super(nulls); - } - - public LogicalIteration(Map map, Set nulls) { - super(nulls); - this.map = map; - } - - @Override - public List getValuesFor(String reference) { - List l = new ArrayList<>(); - if(!map.containsKey(reference)) - throw new RuntimeException("Attribute " + reference + " does not exist."); - - Object o = map.get(reference); - - if(o instanceof Iteration) - throw new RuntimeException("Attribute " + reference + " refers to a record key."); - - if(nulls == null || !nulls.contains(o)) - l.add(o); - - return l; - } - - @Override - public List getStringsFor(String reference) { - return getValuesFor(reference) - .stream() - .filter(x -> x != null) - .map(Object::toString) - .collect(Collectors.toList()); - } - - @Override - public String asString() { - StringWriter stringWriter = new StringWriter(); - try (CSVWriter writer = new CSVWriter(stringWriter)) { - String[] header = map.keySet().toArray(new String[0]); - writer.writeNext(header); - String[] rec = map.values().toArray(new String[0]); - writer.writeNext(rec); - } catch(Exception e) { - throw new RuntimeException("Error representing logical iteration as String/CSV."); - } - return stringWriter.toString(); - } - - public String toString() { - Map widths = new LinkedHashMap<>(); - for (var e : map.entrySet()) { - int width = Math.max(e.getKey().length(), String.valueOf(e.getValue()).length()); - widths.put(e.getKey(), width); - } - - StringBuilder sb = new StringBuilder(); - - // Build horizontal line - String line = "+" + widths.values().stream() - .map(w -> "-".repeat(w + 2)) - .reduce("", (a, b) -> a + "+" + b) - .substring(1) + "+"; - - // Header row (keys) - sb.append(line).append("\n"); - sb.append("|"); - for (var e : map.entrySet()) { - sb.append(" ").append(String.format("%-" + widths.get(e.getKey()) + "s", e.getKey())).append(" |"); - } - sb.append("\n").append(line).append("\n"); - - // Value row - sb.append("|"); - for (var e : map.entrySet()) { - sb.append(" ").append(String.format("%-" + widths.get(e.getKey()) + "s", e.getValue())).append(" |"); - } - sb.append("\n").append(line); - - return sb.toString(); - } - - public LogicalIteration copy() { - return new LogicalIteration(new HashMap<>(map),null); - } - - public void put(String key, Object o) { - if (map.containsKey(key)) { - throw new RuntimeException("Attribute " + key + " already exists in logical iteration (duplicate names in fields or joins)."); - } - map.put(key, o); - } - - // Used by ExpressionField - public Iteration getIteration(String fieldName) { - return (Iteration) map.get(fieldName); - } - - // Used by IterableField - public String getIterationString(String fieldName) { - Object o = map.get(fieldName); - if(o instanceof Iteration) - return ((Iteration) o).asString(); - return o.toString(); - } - - public void retainKeys(List keys) { - // remove all the keys in the map. - map.keySet().retainAll(keys); - } - - public void add(LogicalIteration iteration) { - for(String k : iteration.map.keySet()) { - // Use the Iteration's put instead of the maps to ensure not duplicate fields. - put(k, iteration.map.get(k)); - } - } -} \ No newline at end of file diff --git a/src/main/java/burp/model/MappingDocument.java b/src/main/java/burp/model/MappingDocument.java new file mode 100644 index 0000000..0dfeff6 --- /dev/null +++ b/src/main/java/burp/model/MappingDocument.java @@ -0,0 +1,190 @@ +package burp.model; + +import burp.model.rdf.*; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import org.apache.jena.vocabulary.RDF; + +import java.util.*; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +public class MappingDocument implements PlanNode { + public final List triplesMaps; + private PlanNode parent = null; + + public MappingDocument(List triplesMaps) { + this.triplesMaps = triplesMaps; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + return new ArrayList<>(triplesMaps); + } + + @Override + public Iterable dependencies() { + return new ArrayList<>(triplesMaps); + } + + public List generate() { + List stmts = new ArrayList<>(); + for (TriplesMap tm : triplesMaps) { + var iter = tm.logicalSource.iterator(); + if (iter == null) { + throw new BurpException(new RmlError( + "Constant Triples Map without logical source", + new Origin(this, Collections.emptyList()), + RER.UnsupportedMapping + )); + } + for (var i : iter) { + stmts.addAll(tm.generate(i)); + } + } + + return postProcessContainers(stmts); + } + + private List postProcessContainers(List stmts) { + Map> containers = new HashMap<>(); + Map> expandedContainer = new HashMap<>(); + List result = new ArrayList<>(); + + for (RdfStatementLike stmt : stmts) { + if (stmt instanceof RdfStatement) { + RdfStatement rStmt = (RdfStatement) stmt; + extractAndMergeContainers(rStmt.getSubject(), rStmt.getGraph(), containers, expandedContainer, newTerm -> rStmt.setSubject((BlankNodeOrIRI) newTerm)); + extractAndMergeContainers(rStmt.getObject(), rStmt.getGraph(), containers, expandedContainer, newTerm -> rStmt.setObject(newTerm)); + } else if (stmt instanceof RdfStatementSubjectGraph) { + RdfStatementSubjectGraph rStmtGraph = (RdfStatementSubjectGraph) stmt; + extractAndMergeContainers(rStmtGraph.getSubject(), rStmtGraph.getGraph(), containers, expandedContainer, newTerm -> rStmtGraph.setSubject((BlankNodeOrIRI) newTerm)); + } + } + + for (Map.Entry> entry : containers.entrySet()) { + IRITerm graph = entry.getKey(); + Map graphContainers = entry.getValue(); + + List values = new ArrayList<>(graphContainers.values()); + for (int index = 0; index < values.size(); index++) { + CollectionOrContainerTerm c = values.get(index); + if (c.getId() instanceof BlankNodeTerm) { + BlankNodeTerm newId = new BlankNodeTerm("gathermap-" + (graph != null ? graph.toString() : "default") + "-" + index); + graphContainers.get(c.getId()).setId(newId); + } + } + } + + List containerStmts = new ArrayList<>(); + + for (Map.Entry> entry : containers.entrySet()) { + IRITerm graph = entry.getKey(); + Map graphContainers = entry.getValue(); + + for (CollectionOrContainerTerm c : graphContainers.values()) { + Term subject = c.getId(); + + if (c instanceof RdfListTerm) { + Term currentListId = subject; + for (int i = 0; i < c.getElements().size(); i++) { + boolean isLast = i == c.getElements().size() - 1; + Term element = c.getElements().get(i); + + containerStmts.add(new RdfStatement( + (BlankNodeOrIRI) currentListId, + new IRITerm(RDF.first.getURI()), + TermExtensions.itselfOrId(element), + graph, + null + )); + + Term restObj = isLast ? new IRITerm(RDF.nil.getURI()) : new BlankNodeTerm(subject.toString() + "_" + (i + 1)); + + containerStmts.add(new RdfStatement( + (BlankNodeOrIRI) currentListId, + new IRITerm(RDF.rest.getURI()), + restObj, + graph, + null + )); + + currentListId = restObj; + } + } else if (c instanceof RdfBagTerm) { + emitContainerStmts(c, subject, new IRITerm(RDF.Bag.getURI()), graph, containerStmts); + } else if (c instanceof RdfSeqTerm) { + emitContainerStmts(c, subject, new IRITerm(RDF.Seq.getURI()), graph, containerStmts); + } else if (c instanceof RdfAltTerm) { + emitContainerStmts(c, subject, new IRITerm(RDF.Alt.getURI()), graph, containerStmts); + } + } + } + + List rdfStmtsWithoutCollections = stmts.stream() + .filter(s -> s instanceof RdfStatement) + .map(s -> (RdfStatement) s) + .map(it -> new RdfStatement( + (BlankNodeOrIRI) rewrite(it.getSubject()), + it.getPredicate(), + rewrite(it.getObject()), + it.getGraph(), + it.targets() + )) + .collect(Collectors.toList()); + + result.addAll(rdfStmtsWithoutCollections); + result.addAll(containerStmts); + + return result; + } + + private void emitContainerStmts(CollectionOrContainerTerm c, Term subject, IRITerm type, IRITerm graph, List containerStmts) { + containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, new IRITerm(RDF.type.getURI()), type, graph, null)); + for (int i = 0; i < c.getElements().size(); i++) { + Term element = c.getElements().get(i); + containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, new IRITerm("http://www.w3.org/1999/02/22-rdf-syntax-ns#_" + (i + 1)), TermExtensions.itselfOrId(element), graph, null)); + } + } + + private Term rewrite(Term t) { + if (t instanceof RdfListTerm && ((RdfListTerm) t).getElements().isEmpty()) { + return new IRITerm(RDF.nil.getURI()); + } + if (t instanceof CollectionOrContainerTerm) { + return ((CollectionOrContainerTerm) t).getId(); + } + return t; + } + + private void extractAndMergeContainers(Term t, IRITerm graph, Map> containers, Map> expandedContainer, Consumer replaceTermBy) { + if (t instanceof CollectionOrContainerTerm) { + CollectionOrContainerTerm c = (CollectionOrContainerTerm) t; + Set set = expandedContainer.computeIfAbsent(graph, k -> new HashSet<>()); + if (set.add(c)) { + Map graphContainers = containers.computeIfAbsent(graph, k -> new HashMap<>()); + if (graphContainers.containsKey(c.getId())) { + graphContainers.get(c.getId()).getElements().addAll(c.getElements()); + replaceTermBy.accept(graphContainers.get(c.getId())); + } else { + graphContainers.put(c.getId(), c); + } + for (Term element : c.getElements()) { + extractAndMergeContainers(element, graph, containers, expandedContainer, replaceTermBy); + } + } + } + } +} diff --git a/src/main/java/burp/model/ObjectMap.java b/src/main/java/burp/model/ObjectMap.java index 5155310..e0d9c48 100644 --- a/src/main/java/burp/model/ObjectMap.java +++ b/src/main/java/burp/model/ObjectMap.java @@ -1,37 +1,24 @@ package burp.model; -import java.util.List; +import burp.vocabularies.BURP; +import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.RDFNode; +import java.util.Set; -import burp.vocabularies.RML; +public final class ObjectMap extends TermMap implements BaseObjectMap { + + public ObjectMap() { + this.termType = RML.IRI; + } -public class ObjectMap extends TermMap { - - public DatatypeMap datatypeMap = null; - public LanguageMap languageMap = null; - - public ObjectMap() { - termType = RML.IRI; - } - - @Override - public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(RML.URI.equals(termType)) - return generateURIs(i, baseIRI); - if(RML.BLANKNODE.equals(termType)) - return generateBlankNodes(i, baseIRI); - if(RML.LITERAL.equals(termType)) - return generateLiterals(i, baseIRI, datatypeMap, languageMap); - - throw new RuntimeException("Incorrect term type for object map."); - } + @Override + public String getName() { + return "object map"; + } - @Override - public boolean isGatherMap() { - return gatherMap != null; - } - + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI, RML.BLANKNODE, RML.LITERAL, BURP.CollectionOrContainer); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/ParameterMap.java b/src/main/java/burp/model/ParameterMap.java index 65e0a1b..c04be8d 100644 --- a/src/main/java/burp/model/ParameterMap.java +++ b/src/main/java/burp/model/ParameterMap.java @@ -1,30 +1,21 @@ package burp.model; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; +import java.util.Set; public class ParameterMap extends TermMap { + public ParameterMap() { + this.termType = RML.IRI; + } - public ParameterMap() { - termType = RML.IRI; - } - - @Override - public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(RML.URI.equals(termType)) - return generateURIs(i, baseIRI); - - throw new RuntimeException("Incorrect term type for parameter map."); - } + @Override + public String getName() { + return "parameter map"; + } - @Override - public boolean isGatherMap() { - return false; - } - + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/ParentJoinReferenceScope.java b/src/main/java/burp/model/ParentJoinReferenceScope.java new file mode 100644 index 0000000..66b03df --- /dev/null +++ b/src/main/java/burp/model/ParentJoinReferenceScope.java @@ -0,0 +1,11 @@ +package burp.model; + +import burp.reporting.Origin; + +public interface ParentJoinReferenceScope extends PlanNode { + /** + * Builds a reference for a joined parent scope. + * When a JoinCondition evaluates its parentMap, it asks its scope to build a parent reference. + */ + Reference buildParentJoinReference(String reference, Origin origin); +} diff --git a/src/main/java/burp/model/PlanNode.java b/src/main/java/burp/model/PlanNode.java new file mode 100644 index 0000000..1e0bea1 --- /dev/null +++ b/src/main/java/burp/model/PlanNode.java @@ -0,0 +1,53 @@ +package burp.model; + +import burp.reporting.PointRange; + +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +public interface PlanNode { + PlanNode getParent(); + void setParent(PlanNode parent); + + default Set getDependents() { + // By default returning an empty or modifiable set might be tricky, + // we'll leave it abstract or default to a new HashSet if overridden. + return new HashSet<>(); + } + + default Iterable children() { return Collections.emptyList(); } + default Iterable dependencies() { return Collections.emptyList(); } + + default Iterable dependents() { + return getDependents(); + } + + default List nodeRanges() { + return Collections.emptyList(); + } + + default T ancestor(Class clazz) { + PlanNode p = getParent(); + while (p != null) { + if (clazz.isInstance(p)) { + return clazz.cast(p); + } + p = p.getParent(); + } + return null; + } + + default Stream descendants(Class clazz) { + return StreamSupport.stream(children().spliterator(), false).flatMap(child -> { + Stream rest = child.descendants(clazz); + if (clazz.isInstance(child)) { + return Stream.concat(Stream.of(clazz.cast(child)), rest); + } + return rest; + }); + } +} diff --git a/src/main/java/burp/model/PredicateMap.java b/src/main/java/burp/model/PredicateMap.java index 0a1e894..c5fe6b5 100644 --- a/src/main/java/burp/model/PredicateMap.java +++ b/src/main/java/burp/model/PredicateMap.java @@ -1,30 +1,23 @@ package burp.model; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; + +import java.util.Set; public class PredicateMap extends TermMap { - public PredicateMap() { - termType = RML.IRI; - } - - @Override - public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(RML.URI.equals(termType)) - return generateURIs(i, baseIRI); + public PredicateMap() { + this.termType = RML.IRI; + } - throw new RuntimeException("Incorrect term type for predicate map."); - } + @Override + public String getName() { + return "predicate map"; + } - @Override - public boolean isGatherMap() { - return false; - } - + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/PredicateObjectMap.java b/src/main/java/burp/model/PredicateObjectMap.java index d053a22..39e9782 100644 --- a/src/main/java/burp/model/PredicateObjectMap.java +++ b/src/main/java/burp/model/PredicateObjectMap.java @@ -1,12 +1,91 @@ package burp.model; +import burp.model.rdf.IRITerm; +import burp.model.rdf.Term; + import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import java.util.stream.Stream; + +public class PredicateObjectMap implements LogicalTargetScope, PlanNode { + private final Set logicalTargets = new HashSet<>(); + public List predicateMaps = new ArrayList<>(); + public List objectMaps = new ArrayList<>(); + public List graphMaps = new ArrayList<>(); + + private PlanNode parent = null; + + @Override + public Set getLogicalTargets() { + return logicalTargets; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + return () -> Stream.of( + predicateMaps.stream(), + objectMaps.stream(), + graphMaps.stream() + ).flatMap(s -> s).map(node -> (PlanNode) node).iterator(); + } + + @Override + public Iterable dependencies() { + return children(); + } + + @SafeVarargs + private Set unionTargets(Set... targetSets) { + Set union = new HashSet<>(); + for (Set set : targetSets) { + if (set != null && !set.isEmpty()) { + union.addAll(set); + } + } + return union; + } + + public List generate(Iteration i) { + List lists = new ArrayList<>(); -public class PredicateObjectMap { + for (PredicateMap pm : predicateMaps) { + var predicates = pm.generateTerms(i); + for (Term p : predicates) { + if (!(p instanceof IRITerm pIri)) continue; - public List predicateMaps = new ArrayList<>(); - public List objectMaps = new ArrayList<>(); - public List refObjectMaps = new ArrayList<>(); - public List graphMaps = new ArrayList<>(); + for (BaseObjectMap om : objectMaps) { + var objects = om.generateTerms(i); + for (Term o : objects) { + if (graphMaps.isEmpty()) { + lists.add(new RdfPredicateObject(pIri, o, null, unionTargets(p.targets(), o.targets()))); + } else { + for (GraphMap gm : graphMaps) { + var graphs = gm.generateTerms(i); + for (Term g : graphs) { + if (g instanceof IRITerm gIri) { + // Graph targets are NOT applied here. They are applied per-graph in TriplesMap + // to avoid graph-level targets leaking across different named graphs. + lists.add(new RdfPredicateObject(pIri, o, gIri, unionTargets(p.targets(), o.targets()))); + } + } + } + } + } + } + } + } + return lists; + } } diff --git a/src/main/java/burp/model/RDFNodeConstant.java b/src/main/java/burp/model/RDFNodeConstant.java index a8414a1..8efbe50 100644 --- a/src/main/java/burp/model/RDFNodeConstant.java +++ b/src/main/java/burp/model/RDFNodeConstant.java @@ -1,13 +1,38 @@ package burp.model; -import org.apache.jena.rdf.model.RDFNode; - -public class RDFNodeConstant extends Expression { - - public RDFNode constant = null; - - public RDFNodeConstant(RDFNode constant) { - this.constant = constant; - } - +import burp.model.rdf.Term; + +import java.util.Collections; + +public class RDFNodeConstant implements Expression { + public Term constant; + private PlanNode parent = null; + + public RDFNodeConstant() { + this.constant = null; + } + + public RDFNodeConstant(Term constant) { + this.constant = constant; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + return Collections.emptyList(); + } + + @Override + public Iterable dependencies() { + return Collections.emptyList(); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/RMLFunction.java b/src/main/java/burp/model/RMLFunction.java index 29876bf..cb1d453 100644 --- a/src/main/java/burp/model/RMLFunction.java +++ b/src/main/java/burp/model/RMLFunction.java @@ -1,10 +1,10 @@ package burp.model; +import burp.reporting.Origin; + import java.util.List; import java.util.Map; -public abstract class RMLFunction { - - abstract public List apply(Map map); - +public interface RMLFunction { + List apply(Map parameters, Origin origin); } diff --git a/src/main/java/burp/model/RMLTarget.java b/src/main/java/burp/model/RMLTarget.java new file mode 100644 index 0000000..f4e537d --- /dev/null +++ b/src/main/java/burp/model/RMLTarget.java @@ -0,0 +1,4 @@ +package burp.model; + +public abstract class RMLTarget { +} diff --git a/src/main/java/burp/model/RawReference.java b/src/main/java/burp/model/RawReference.java new file mode 100644 index 0000000..6e3dd14 --- /dev/null +++ b/src/main/java/burp/model/RawReference.java @@ -0,0 +1,51 @@ +package burp.model; + +import burp.parse.turtleprov.ProvTurtleVisitor; +import burp.reporting.Origin; +import burp.reporting.PointRange; + +import java.util.Collections; +import java.util.List; + +public class RawReference extends Reference implements ReferenceHolder { + private Reference compiledReference = null; + + public RawReference(String reference, Origin origin) { + super(reference, origin); + } + + public Reference getCompiledReference() { + return compiledReference; + } + + public void setCompiledReference(Reference compiledReference) { + this.compiledReference = compiledReference; + } + + @Override + public List nodeRanges() { + Object pointers = origin.sourceStatements(); + if (pointers == null) return Collections.emptyList(); + return ProvTurtleVisitor.retrieveTurtleLocation(pointers); + } + + @Override + public List getValues(Iteration i) { + return compiledReference.getValues(i); + } + + @Override + public void compileReferences() { + if (compiledReference == null && reference != null) { + LocalReferenceScope scope = ancestor(LocalReferenceScope.class); + if (scope != null) { + compiledReference = scope.buildLocalReference(reference, origin); + } + } + } + + @Override + public List getStrings(Iteration i) { + return compiledReference.getStrings(i); + } +} diff --git a/src/main/java/burp/model/RdfPredicateObject.java b/src/main/java/burp/model/RdfPredicateObject.java new file mode 100644 index 0000000..075815d --- /dev/null +++ b/src/main/java/burp/model/RdfPredicateObject.java @@ -0,0 +1,16 @@ +package burp.model; + +import burp.model.rdf.IRITerm; +import burp.model.rdf.Term; + +import java.util.Set; + +public record RdfPredicateObject(IRITerm predicate, Term object, IRITerm graph, Set targets) { + public RdfPredicateObject(IRITerm predicate, Term object) { + this(predicate, object, null, Set.of()); + } + + public RdfPredicateObject(IRITerm predicate, Term object, IRITerm graph) { + this(predicate, object, graph, Set.of()); + } +} diff --git a/src/main/java/burp/model/RdfStatement.java b/src/main/java/burp/model/RdfStatement.java new file mode 100644 index 0000000..b2b86f6 --- /dev/null +++ b/src/main/java/burp/model/RdfStatement.java @@ -0,0 +1,64 @@ +package burp.model; + +import burp.model.rdf.BlankNodeOrIRI; +import burp.model.rdf.IRITerm; +import burp.model.rdf.Term; + +import java.util.Objects; +import java.util.Set; + +public final class RdfStatement implements RdfStatementLike { + private BlankNodeOrIRI subject; + private IRITerm predicate; + private Term object; + private IRITerm graph; + private final Set targets; + + public RdfStatement(BlankNodeOrIRI subject, IRITerm predicate, Term object, IRITerm graph, Set targets) { + this.subject = subject; + this.predicate = predicate; + this.object = object; + this.graph = graph; + this.targets = targets != null ? targets : Set.of(); + } + + public RdfStatement(BlankNodeOrIRI subject, IRITerm predicate, Term object) { + this(subject, predicate, object, null, Set.of()); + } + + public BlankNodeOrIRI getSubject() { return subject; } + public void setSubject(BlankNodeOrIRI subject) { this.subject = subject; } + + public IRITerm getPredicate() { return predicate; } + public void setPredicate(IRITerm predicate) { this.predicate = predicate; } + + public Term getObject() { return object; } + public void setObject(Term object) { this.object = object; } + + public IRITerm getGraph() { return graph; } + public void setGraph(IRITerm graph) { this.graph = graph; } + + @Override + public Set targets() { return targets; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof RdfStatement that)) return false; + return Objects.equals(subject, that.subject) && + Objects.equals(predicate, that.predicate) && + Objects.equals(object, that.object) && + Objects.equals(graph, that.graph) && + Objects.equals(targets, that.targets); + } + + @Override + public int hashCode() { + return Objects.hash(subject, predicate, object, graph, targets); + } + + @Override + public String toString() { + return "RdfStatement(subject=" + subject + ", predicate=" + predicate + ", object=" + object + ", graph=" + graph + ", targets=" + targets + ")"; + } +} diff --git a/src/main/java/burp/model/RdfStatementLike.java b/src/main/java/burp/model/RdfStatementLike.java new file mode 100644 index 0000000..0f43ebe --- /dev/null +++ b/src/main/java/burp/model/RdfStatementLike.java @@ -0,0 +1,7 @@ +package burp.model; + +import java.util.Set; + +public interface RdfStatementLike { + Set targets(); +} diff --git a/src/main/java/burp/model/RdfStatementSubjectGraph.java b/src/main/java/burp/model/RdfStatementSubjectGraph.java new file mode 100644 index 0000000..058234f --- /dev/null +++ b/src/main/java/burp/model/RdfStatementSubjectGraph.java @@ -0,0 +1,51 @@ +package burp.model; + +import burp.model.rdf.BlankNodeOrIRI; +import burp.model.rdf.IRITerm; + +import java.util.Objects; +import java.util.Set; + +public final class RdfStatementSubjectGraph implements RdfStatementLike { + private BlankNodeOrIRI subject; + private IRITerm graph; + private final Set targets; + + public RdfStatementSubjectGraph(BlankNodeOrIRI subject, IRITerm graph, Set targets) { + this.subject = subject; + this.graph = graph; + this.targets = targets != null ? targets : Set.of(); + } + + public RdfStatementSubjectGraph(BlankNodeOrIRI subject) { + this(subject, null, Set.of()); + } + + public BlankNodeOrIRI getSubject() { return subject; } + public void setSubject(BlankNodeOrIRI subject) { this.subject = subject; } + + public IRITerm getGraph() { return graph; } + public void setGraph(IRITerm graph) { this.graph = graph; } + + @Override + public Set targets() { return targets; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof RdfStatementSubjectGraph that)) return false; + return Objects.equals(subject, that.subject) && + Objects.equals(graph, that.graph) && + Objects.equals(targets, that.targets); + } + + @Override + public int hashCode() { + return Objects.hash(subject, graph, targets); + } + + @Override + public String toString() { + return "RdfStatementSubjectGraph(subject=" + subject + ", graph=" + graph + ", targets=" + targets + ")"; + } +} diff --git a/src/main/java/burp/model/Reference.java b/src/main/java/burp/model/Reference.java index 11c909d..dcae9ba 100644 --- a/src/main/java/burp/model/Reference.java +++ b/src/main/java/burp/model/Reference.java @@ -1,20 +1,63 @@ package burp.model; +import burp.reporting.Origin; +import java.util.Collections; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; -public class Reference extends Expression { - - public String reference = null; - - public Reference(String reference) { - this.reference = reference; - } - - // If the term map is a reference-valued term map, - // then the generated RDF term is determined by applying the - // term generation rules to its reference value. - public List values(Iteration i) { - return i.getValuesFor(reference); - } - +public abstract class Reference implements Expression { + protected final String reference; + protected Origin origin; + protected PlanNode parent = null; + + public Reference(String reference, Origin origin) { + this.reference = reference; + this.origin = origin; + } + + public String getReference() { + return reference; + } + + public Origin getOrigin() { + return origin; + } + + public void setOrigin(Origin origin) { + this.origin = origin; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + return Collections.emptyList(); + } + + @Override + public Iterable dependencies() { + return Collections.emptyList(); + } + + public List values(Iteration i) { + return getValues(i); + } + + public abstract List getValues(Iteration i); + + public List getStrings(Iteration i) { + return getValues(i).stream() + .filter(Objects::nonNull) + .map(Object::toString) + .collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/ReferenceHolder.java b/src/main/java/burp/model/ReferenceHolder.java new file mode 100644 index 0000000..295ddd0 --- /dev/null +++ b/src/main/java/burp/model/ReferenceHolder.java @@ -0,0 +1,5 @@ +package burp.model; + +public interface ReferenceHolder extends PlanNode { + void compileReferences(); +} diff --git a/src/main/java/burp/model/ReferencingObjectMap.java b/src/main/java/burp/model/ReferencingObjectMap.java index 2ea1833..5e6d55e 100644 --- a/src/main/java/burp/model/ReferencingObjectMap.java +++ b/src/main/java/burp/model/ReferencingObjectMap.java @@ -1,80 +1,114 @@ package burp.model; +import burp.model.gathermap.GatherMap; +import burp.model.rdf.BlankNodeOrIRI; +import burp.model.rdf.Datardf; +import burp.model.rdf.Term; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; + import java.util.ArrayList; -import java.util.Iterator; +import java.util.HashSet; import java.util.List; -import java.util.stream.Collectors; +import java.util.Set; + +import static burp.model.TemplateReferenceSafety.UNSAFE; + +public final class ReferencingObjectMap implements TermGenerator, PlanNode, ParentJoinReferenceScope, BaseObjectMap { + public TriplesMap parentTriplesMap; + public List joinConditions = new ArrayList<>(); + + public GatherMap gatherMap; + private PlanNode parent = null; + public final Set logicalTargets = new HashSet<>(); + + @Override + public PlanNode getParent() { + return parent; + } -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.RDFNode; + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } -import burp.model.gathermaputil.GatherMapMixin; -import burp.model.gathermaputil.SubGraph; + @Override + public Iterable children() { + List list = new ArrayList<>(joinConditions); + if (gatherMap != null) { + list.add(gatherMap); + } + return list; + } -public class ReferencingObjectMap implements GatherMap { - - public TriplesMap parent = null; - public List joinConditions = new ArrayList<>(); - - public GatherMapMixin gatherMap = null; - - @Override - public boolean isGatherMap() { - return gatherMap != null; - } - - @Override - public List generateGatherMapGraphs(Iteration i, String baseIRI) { - if(!isGatherMap()) - throw new RuntimeException("Trying to process a non-gathermap as gathermap"); - - List g = new ArrayList<>(); - - for(RDFNode n : generateTerms(i, baseIRI)) { - SubGraph sg = new SubGraph(n, ModelFactory.createDefaultModel()); - g.add(sg); - } - - return g; - } + @Override + public Iterable dependencies() { + List list = new ArrayList<>(); + children().forEach(list::add); + if (parentTriplesMap != null && parentTriplesMap.subjectMap != null) { + list.add(parentTriplesMap.subjectMap); + } + return list; + } - @Override - public List generateTerms(Iteration i, String baseIRI) { - // If there are no join conditions, then we generate resources - // from the child iteration. This is only guaranteed to work - // for logical sources of the same type or if the parent triple - // map' subject map only uses simple references. - if(joinConditions.isEmpty()) { - return parent.subjectMap.generateTerms(i, baseIRI); - } else { - List list = new ArrayList<>(); - Iterator iter2 = parent.logicalSource.iterator(); - while (iter2.hasNext()) { - Iteration i2 = iter2.next(); + @Override + public List generateTerms(Iteration i) { + if (gatherMap != null) { + List generatedIds = generateTermsFromParentJoins(i).stream() + .filter(it -> it instanceof BlankNodeOrIRI) + .map(it -> (BlankNodeOrIRI) it) + .toList(); + return gatherMap.generateTerms(i, generatedIds); + } + return generateTermsFromParentJoins(i); + } - // Expression Maps are multi-valued. We thus need - // For each join condition at least one match. - boolean ok = true; - for (JoinCondition jc : joinConditions) { + public List generateTermsFromParentJoins(Iteration i) { + if (joinConditions.isEmpty()) { + return parentTriplesMap.subjectMap.generateTerms(i); + } else { + List list = new ArrayList<>(); + var parentIterator = parentTriplesMap.logicalSource.iterator(); + if (parentIterator == null) { + throw new BurpException(new RmlError( + "Constant triples map in referencing object map " + this + " for triples map " + parentTriplesMap + " (without logical source) are not supported.", + null, + RER.UnsupportedMapping + )); + } - List values1 = jc.childMap.generateValues(i); - List values2 = jc.parentMap.generateValues(i2); + for (Iteration parentIteration : parentIterator) { + boolean ok = true; + for (JoinCondition jc : joinConditions) { + List valuesChild = jc.childMap.generateValues(i, UNSAFE); + List valuesParent = jc.parentMap.generateValues(parentIteration, UNSAFE); - if (values1.stream().distinct().filter(values2::contains) - .collect(Collectors.toSet()).isEmpty()) { - // No match, break. - ok = false; - break; - } - } + boolean matchFound = valuesChild.stream().anyMatch(vC -> valuesParent.stream().anyMatch(vP -> Datardf.semanticEquals(vC, vP))); + if (!matchFound) { + ok = false; + break; + } + } - if (ok) { - list.addAll(parent.subjectMap.generateTerms(i2, baseIRI)); - } - } - - return list; - } - } + if (ok) { + list.addAll(parentTriplesMap.subjectMap.generateTerms(parentIteration)); + } + } + return list; + } + } + @Override + public Reference buildParentJoinReference(String reference, Origin origin) { + if (parentTriplesMap == null) { + throw new BurpException(new RmlError( + "ReferencingObjectMap is missing parentTriplesMap", + origin, + RER.UnsupportedMapping + )); + } + return parentTriplesMap.buildLocalReference(reference, origin); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/Return.java b/src/main/java/burp/model/Return.java index 8b73c48..3d4f63d 100644 --- a/src/main/java/burp/model/Return.java +++ b/src/main/java/burp/model/Return.java @@ -7,10 +7,17 @@ public class Return { private final Map returns = new HashMap<>(); - public Object defaultValue = null; - + public Object defaultValue; + public Map additionalOutputs; + public Return(Object defaultValue) { this.defaultValue = defaultValue; + this.additionalOutputs = Map.of(); + } + + public Return(Object defaultValue, Map additionalOutputs) { + this.defaultValue = defaultValue; + this.additionalOutputs = additionalOutputs; } public Object get(Object key) { diff --git a/src/main/java/burp/model/ReturnMap.java b/src/main/java/burp/model/ReturnMap.java index a660ea5..d9b1819 100644 --- a/src/main/java/burp/model/ReturnMap.java +++ b/src/main/java/burp/model/ReturnMap.java @@ -1,30 +1,21 @@ package burp.model; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; +import java.util.Set; public class ReturnMap extends TermMap { + public ReturnMap() { + this.termType = RML.IRI; + } - public ReturnMap() { - termType = RML.IRI; - } - - @Override - public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(RML.URI.equals(termType)) - return generateURIs(i, baseIRI); - - throw new RuntimeException("Incorrect term type for function map."); - } + @Override + public String getName() { + return "return map"; + } - @Override - public boolean isGatherMap() { - return false; - } - + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/SubjectMap.java b/src/main/java/burp/model/SubjectMap.java index 51d20f0..45a52f9 100644 --- a/src/main/java/burp/model/SubjectMap.java +++ b/src/main/java/burp/model/SubjectMap.java @@ -1,37 +1,36 @@ package burp.model; -import java.util.ArrayList; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; +import burp.vocabularies.BURP; +import burp.vocabularies.RML; import org.apache.jena.rdf.model.Resource; -import burp.vocabularies.RML; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; public class SubjectMap extends TermMap { - - public List classes = new ArrayList<>(); - public List graphMaps = new ArrayList<>(); - - public SubjectMap() { - termType = RML.IRI; - } - - @Override - public List generateTerms(Iteration i, String baseIRI) { - if(RML.IRI.equals(termType)) - return generateIRIs(i, baseIRI); - if(RML.URI.equals(termType)) - return generateURIs(i, baseIRI); - if(RML.BLANKNODE.equals(termType)) - return generateBlankNodes(i, baseIRI); - - throw new RuntimeException("Incorrect term type for subject map."); - } - - @Override - public boolean isGatherMap() { - return gatherMap != null; - } - + public List classes = new ArrayList<>(); + public List graphMaps = new ArrayList<>(); + + public SubjectMap() { + this.termType = RML.IRI; + } + + @Override + public Iterable children() { + List children = new ArrayList<>(); + super.children().forEach(children::add); + graphMaps.forEach(children::add); + return children; + } + + @Override + public String getName() { + return "subject map"; + } + + @Override + public Set getAllowedTermTypes() { + return Set.of(RML.IRI, RML.URI, RML.BLANKNODE, BURP.CollectionOrContainer); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/Template.java b/src/main/java/burp/model/Template.java index f0deae5..7403aae 100644 --- a/src/main/java/burp/model/Template.java +++ b/src/main/java/burp/model/Template.java @@ -1,66 +1,215 @@ package burp.model; +import burp.parse.turtleprov.Point; +import burp.reporting.LiteralPart; +import burp.reporting.Origin; +import burp.reporting.PointRange; +import burp.util.Util; +import com.google.common.collect.Lists; +import org.apache.commons.text.StringEscapeUtils; +import org.apache.jena.rdf.model.Statement; + import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.apache.commons.text.StringEscapeUtils; +public class Template implements Expression { -import burp.util.Util; + private String template; + private Statement stmt; + private PlanNode parent = null; + private List segments; + + public Template(String template) { + this(template, null); + } + + public Template(String template, Statement stmt) { + this.template = template; + this.stmt = stmt; + this.segments = parseTemplate(); + } + + public String getTemplate() { + return template; + } + + public void setTemplate(String template) { + this.template = template; + } + + public Statement getStmt() { + return stmt; + } + + public void setStmt(Statement stmt) { + this.stmt = stmt; + } + + public List getSegments() { + return segments; + } + + public void setSegments(List segments) { + this.segments = segments; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + return new ArrayList<>(segments); + } + + public List values(Iteration i) { + return values(i, TemplateReferenceSafety.UNSAFE); + } + + public List values(Iteration i, boolean safe) { + return values(i, safe ? TemplateReferenceSafety.SAFE_IRI : TemplateReferenceSafety.UNSAFE); + } + + public List values(Iteration i, TemplateReferenceSafety safety) { + List> evaluatedSegments = new ArrayList<>(); + for (Segment segment : segments) { + evaluatedSegments.add(switch (segment) { + case ReferenceSegment refSegment -> { + List refVals = refSegment.reference().getStrings(i); + yield switch (safety) { + case SAFE_IRI -> refVals.stream().map(Util::toIRISafe).collect(Collectors.toList()); + case SAFE_URI -> refVals.stream().map(Util::toURISafe).collect(Collectors.toList()); + case UNSAFE -> refVals; + }; + } + case LiteralSegment literalSegment -> Collections.singletonList(literalSegment.literal()); + }); + } + + return Lists.cartesianProduct(evaluatedSegments).stream() + .map(list -> String.join("", list)) + .collect(Collectors.toList()); + } + + public List references() { + List list = new ArrayList<>(); + Matcher m = bracesPattern.matcher(template); + while (m.find()) { + String temp = template.substring(m.start(1), m.end(1)); + list.add(StringEscapeUtils.unescapeJava(temp)); + } + return list; + } + + + public sealed interface Segment extends PlanNode permits LiteralSegment, ReferenceSegment { + int offset(); + + PointRange range(); + + PlanNode parent(); + + @Override + default PlanNode getParent() { + return parent(); + } + + @Override + default void setParent(PlanNode parent) { + if (parent != parent()) { + throw new UnsupportedOperationException("Cannot mutate parent of a template segment: " + this); + } + } + } + + public record LiteralSegment(int offset, PointRange range, Template parent, String literal) implements Segment { + } + + public record ReferenceSegment(int offset, PointRange range, Template parent, Reference reference) + implements Segment { + @Override + public Iterable children() { + return Collections.singletonList(reference); + } + } + + public enum SegmentKind {Literal, Reference} + + private record SegmentData(SegmentKind kind, String value, int offset) { + } + + private List parseTemplate() { + String rest = template; + int offset = 0; + List segments = new ArrayList<>(); + + while (!rest.isEmpty()) { + Matcher m = bracesPattern.matcher(rest); + if (m.find()) { + if (m.start() > 0) { + String literal = rest.substring(0, m.start()); + String escapeLiteral = escape(literal); + segments.add(new SegmentData(SegmentKind.Literal, escapeLiteral, offset)); + offset += literal.length(); + } + String reference = m.group(1); + String escapeReference = escape(reference); + segments.add(new SegmentData(SegmentKind.Reference, escapeReference, offset + 1)); + + offset += m.end() - m.start(); // Advance offset by the exact matched length (including braces) + rest = rest.substring(m.end()); + } else { + segments.add(new SegmentData(SegmentKind.Literal, escape(rest), offset)); + offset += rest.length(); + rest = ""; + } + } + return constructSegmentsRangeAndReference(segments); + } + + private List constructSegmentsRangeAndReference(List segments) { + if (segments.isEmpty()) return Collections.emptyList(); + + List points = new ArrayList<>(); + for (SegmentData segment : segments) { + points.add(Point.fromOffset(template, segment.offset())); + } + points.add(Point.fromOffset(template, template.length())); + + List constructedSegments = new ArrayList<>(); + for (int i = 0; i < segments.size(); i++) { + SegmentData segment = segments.get(i); + Point startPoint = points.get(i); + Point endPoint = points.get(i + 1); + PointRange range = new PointRange(startPoint, endPoint); + + constructedSegments.add(switch (segment.kind()) { + case Literal -> new LiteralSegment(segment.offset(), range, this, segment.value()); + case Reference -> { + Origin origin = (stmt == null) ? new Origin() : new Origin(this, Collections.singletonList(new LiteralPart(stmt, range))); + RawReference rawReference = new RawReference(segment.value(), origin); + yield new ReferenceSegment(segment.offset(), range, this, rawReference); + } + }); + } + + return constructedSegments; + } + + private String escape(String s) { + return s.replace("\\\\{", "{").replace("\\\\}", "}"); + } -public class Template extends Expression { - - public String template = null; - - public Template(String template) { - this.template = template; - } - - // If the term map is a template-valued term map, - // then the generated RDF term is determined by applying - // the term generation rules to its template value. - public List values(Iteration i) { - return values(i, false); - } - - public List values(Iteration i, boolean safe) { - List list = new ArrayList<>(); - list.add(template); - - for(String reference : references()) { - List valuesForReference = i.getStringsFor(reference); - List newset = new ArrayList<>(); - - String search = "{" + StringEscapeUtils.escapeJava(reference).replaceAll("([{}])", "\\\\$1") + "}"; - - for(String s : list) - for(String v : valuesForReference) - if(v != null) { - newset.add(s.replace(search, safe ? Util.toIRISafe(v) : v)); - } - - list = newset; - } - - list = list.stream(). - map((s)-> s.replace("\\{", "{").replace("\\}", "}")). - collect(Collectors.toList()); - - return list; - - } - - private static final Pattern p = Pattern.compile("(? references() { - List list = new ArrayList<>(); - Matcher m = p.matcher(template); - while(m.find()) { - String temp = template.substring(m.start(1), m.end(1)); - list.add(StringEscapeUtils.unescapeJava(temp)); - } - return list; - } + private static final Pattern bracesPattern = Pattern.compile("(? generateTerms(Iteration i); +} diff --git a/src/main/java/burp/model/TermMap.java b/src/main/java/burp/model/TermMap.java index 5b00912..5c08f27 100644 --- a/src/main/java/burp/model/TermMap.java +++ b/src/main/java/burp/model/TermMap.java @@ -1,39 +1,84 @@ package burp.model; -import java.util.ArrayList; -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; +import burp.model.gathermap.GatherMap; +import burp.model.rdf.BlankNodeOrIRI; +import burp.model.rdf.Term; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.BURP; +import burp.vocabularies.RER; +import burp.vocabularies.RML; import org.apache.jena.rdf.model.Resource; -import burp.model.gathermaputil.GatherMapMixin; -import burp.model.gathermaputil.SubGraph; - -public abstract class TermMap extends ExpressionMap implements GatherMap { - - public Resource termType; - - public GatherMapMixin gatherMap = null; - - @Override - public List generateGatherMapGraphs(Iteration i, String baseIRI) { - if(!isGatherMap()) - throw new RuntimeException("Trying to process a non-gathermap as gathermap"); - - List g = new ArrayList<>(); - - if(expression == null) { - g.addAll(gatherMap.generateGraphs(i, baseIRI)); - } else { - for(RDFNode n : generateTerms(i, baseIRI)) { - for(SubGraph sg : gatherMap.generateGraphs(i, baseIRI)) { - sg.updateNode(n); - g.add(sg); - } - } - } - - return g; - } +import java.util.*; + +public abstract class TermMap extends ExpressionMap implements TermGenerator { + public DatatypeMap datatypeMap = null; + public LanguageMap languageMap = null; + public Resource termType = null; + public GatherMap gatherMap = null; + + @Override + public Iterable children() { + List children = new ArrayList<>(); + super.children().forEach(children::add); + if (datatypeMap != null) children.add(datatypeMap); + if (languageMap != null) children.add(languageMap); + if (gatherMap != null) children.add(gatherMap); + return children; + } + + public abstract String getName(); + + public abstract Set getAllowedTermTypes(); + + @Override + public List generateTerms(Iteration i) { + Set allowed = this.getAllowedTermTypes(); + + if (gatherMap != null && allowed.contains(BURP.CollectionOrContainer)) { + if (getExpression() == null) { + return gatherMap.generateTerms(i, null); + } else { + var generatedIds = generateExpressionTerms(i, Set.of(RML.LITERAL)).stream() + .filter(it -> it instanceof BlankNodeOrIRI) + .map(it -> (BlankNodeOrIRI) it) + .toList(); + return gatherMap.generateTerms(i, generatedIds); + } + } + + return generateExpressionTerms(i); + } + + public List generateExpressionTerms(Iteration i) { + return generateExpressionTerms(i, Collections.emptySet()); + } + + @SuppressWarnings("unchecked") + public List generateExpressionTerms(Iteration i, Set disallowed) { + Set allowed = new HashSet<>(this.getAllowedTermTypes()); + allowed.removeAll(disallowed); + if (RML.IRI.equals(termType) && allowed.contains(RML.IRI)) { + return (List) (List) generateIRIs(i); + } else if (termType.toString().equals("http://w3id.org/rml/URI") && allowed.contains(RML.IRI)) { + return (List) (List) generateIRIs(i); // URI mapped to IRI + } else if (termType.toString().equals("http://w3id.org/rml/UnsafeIRI") && allowed.contains(RML.IRI)) { + return (List) (List) generateUnsafeIRIs(i); // UnsafeIRI mapped to IRI + } else if (RML.BLANKNODE.equals(termType) && allowed.contains(RML.BLANKNODE)) { + return (List) (List) generateBlankNodes(i); + } else if (RML.LITERAL.equals(termType) && allowed.contains(RML.LITERAL)) { + return (List) (List) generateLiterals(i, datatypeMap, languageMap); + } else { + throw new BurpException( + new RmlError( + "The term map " + this.getName() + " generates " + termType + ", which is not allowed. Expected one of " + allowed, + new Origin(this, null), + RER.IncorrectTermType + ) + ); + } + } } \ No newline at end of file diff --git a/src/main/java/burp/model/TriplesMap.java b/src/main/java/burp/model/TriplesMap.java index 1ffec0b..66c2fa5 100644 --- a/src/main/java/burp/model/TriplesMap.java +++ b/src/main/java/burp/model/TriplesMap.java @@ -1,13 +1,154 @@ package burp.model; +import burp.Main; +import burp.model.rdf.BlankNodeOrIRI; +import burp.model.rdf.CollectionOrContainerTerm; +import burp.model.rdf.IRITerm; +import burp.model.rdf.Term; +import burp.reporting.Origin; +import org.apache.jena.rdf.model.Resource; + import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; + +public class TriplesMap implements PlanNode, BaseIRIScope, LocalReferenceScope, LogicalTargetScope { + public Resource subject; + public AbstractLogicalSource logicalSource; + public SubjectMap subjectMap; + public List predicateObjectMaps = new ArrayList<>(); + public String baseIRI; + + private PlanNode parent = null; + public long countGeneratedStatements = 0; + public final Set logicalTargets = new HashSet<>(); + + public TriplesMap(Resource subject) { + this.subject = subject; + } + + @Override + public String getBaseIri() { + return baseIRI != null ? baseIRI : Main.baseIRI; + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + List list = new ArrayList<>(); + if (logicalSource != null) list.add(logicalSource); + if (subjectMap != null) list.add(subjectMap); + list.addAll(predicateObjectMaps); + return list; + } + + @Override + public Iterable dependencies() { + return children(); + } + + @Override + public Set getLogicalTargets() { + return logicalTargets; + } + + private Set unionTargets(Set... targetSets) { + Set union = new HashSet<>(); + for (Set set : targetSets) { + if (set != null && !set.isEmpty()) { + union.addAll(set); + } + } + return union; + } + + public List generate(Iteration i) { + String tmBaseIRI = getBaseIri(); + List stmts = new ArrayList<>(); + + Set subjectGraphs = new HashSet<>(); + for (TermGenerator map : subjectMap.graphMaps) { + for (Term t : map.generateTerms(i)) { + if (t instanceof IRITerm) { + subjectGraphs.add((IRITerm) t); + } + } + } + + Set targetGraphsForSubjectMap = subjectMap.graphMaps.isEmpty() ? new HashSet<>() : subjectGraphs; + if (subjectMap.graphMaps.isEmpty()) { + targetGraphsForSubjectMap.add(null); + } + + var subjects = subjectMap.generateTerms(i); + + for (Term s : subjects) { + if (!(s instanceof BlankNodeOrIRI)) continue; + BlankNodeOrIRI sIri = (BlankNodeOrIRI) s; + + if (s instanceof CollectionOrContainerTerm) { + for (IRITerm g : targetGraphsForSubjectMap) { + stmts.add(new RdfStatementSubjectGraph( + sIri, g, unionTargets(s.targets(), g != null ? g.targets() : null) + )); + } + } + + for (Resource c : subjectMap.classes) { + Set classTargets = subjectMap.getEffectiveTargets(); + for (IRITerm g : targetGraphsForSubjectMap) { + stmts.add(new RdfStatement( + sIri, + new IRITerm("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), + new IRITerm(c.getURI(), classTargets), + g, + unionTargets(s.targets(), classTargets, g != null ? g.targets() : null) + )); + countGeneratedStatements++; + } + } + } + + for (PredicateObjectMap pom : predicateObjectMaps) { + List generatedPoms = pom.generate(i); + for (Term s : subjects) { + if (!(s instanceof BlankNodeOrIRI)) continue; + BlankNodeOrIRI sIri = (BlankNodeOrIRI) s; -public class TriplesMap { + for (RdfPredicateObject po : generatedPoms) { + Set combinedGraphs = new HashSet<>(); + if (subjectGraphs.isEmpty() && pom.graphMaps.isEmpty()) { + combinedGraphs.add(null); + } else { + combinedGraphs.addAll(subjectGraphs); + if (po.graph() != null) { + combinedGraphs.add((IRITerm) po.graph()); + } + } - public AbstractLogicalSource logicalSource = null; - public SubjectMap subjectMap = null; - public List predicateObjectMaps = new ArrayList<>(); - public String baseIRI = null; + for (IRITerm g : combinedGraphs) { + Set finalTargets = unionTargets(s.targets(), po.targets(), g != null ? g.targets() : null); + stmts.add(new RdfStatement(sIri, po.predicate(), po.object(), g, finalTargets)); + countGeneratedStatements++; + } + } + } + } + return stmts; + } + @Override + public Reference buildLocalReference(String reference, Origin origin) { + return logicalSource.buildExportedReference(reference, origin); + } } \ No newline at end of file diff --git a/src/main/java/burp/model/ViewJoin.java b/src/main/java/burp/model/ViewJoin.java deleted file mode 100644 index 2000b4a..0000000 --- a/src/main/java/burp/model/ViewJoin.java +++ /dev/null @@ -1,120 +0,0 @@ -package burp.model; - -import java.util.ArrayList; -import java.util.List; -import java.util.Spliterators; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; - -public class ViewJoin { - - public LogicalView parentLogicalView; - public List joinConditions = new ArrayList<>(); - public List expressionFields = new ArrayList<>(); - public boolean isInnerJoin = false; - - private List iterations = null; - - public List expand(List childIterations) { - try { - if (iterations == null) { - // Get logical iterations of parent logical view - iterations = StreamSupport - .stream(Spliterators.spliteratorUnknownSize(parentLogicalView.iterator(), 0), false) - .map(a -> (LogicalIteration) a) - .collect(Collectors.toList()); - } - - List newList = new ArrayList<>(); - - for (LogicalIteration childIteration : childIterations) { - boolean hasACorrespondence = false; - - // Discussion with Els. For each child, the counter for the parents are "reset" to 0 - // So we assign 0, 1, ..., n from the child's perspective. - int count = -1; // start at -1 as no match found yet - - for(LogicalIteration parentIteration : iterations) { - if(matches(childIteration, parentIteration)) { - hasACorrespondence = true; - - // Increment the index - count++; - - // Create new logical iterations for each value of each expression map - List result = new ArrayList<>(); - result.add(childIteration); - for (ExpressionField e : expressionFields) { - result = enrichForJoin(e, count, result, parentIteration); - } - - // add all new iterations to the list - newList.addAll(result); - } - } - - // Make the outer join if there is no match - if(!hasACorrespondence && !isInnerJoin) { - LogicalIteration newIteration = childIteration.copy(); - for (ExpressionField e : expressionFields) { - newIteration.put(e.fieldName, null); - newIteration.put(e.fieldName + ".#", null); - } - newList.add(newIteration); - } - } - - return newList; - } catch (Throwable e) { - throw new RuntimeException(e); - } - } - - private List enrichForJoin(ExpressionField e, int index, List result, LogicalIteration parentIteration) { - List nlist = new ArrayList<>(); - - for(LogicalIteration li : result) { - for (Object o : e.fieldExpressionMap.generateValues(parentIteration)) { - LogicalIteration newLogicalIteration = li.copy(); - newLogicalIteration.put(e.fieldName, o); - newLogicalIteration.put(e.fieldName + ".#", index); - nlist.add(newLogicalIteration); - } - } - - return nlist; - } - - private boolean matches(LogicalIteration childIteration, LogicalIteration parentIteration) { - // Expression Maps are multi-valued. We thus need - // For each join condition at least one match. - boolean ok = true; - for (JoinCondition jc : joinConditions) { - - List values1 = jc.childMap.generateValues(childIteration); - List values2 = jc.parentMap.generateValues(parentIteration); - - if (values1.stream().distinct().filter(values2::contains) - .collect(Collectors.toSet()).isEmpty()) { - // No match, break. - ok = false; - break; - } - } - return ok; - } - - public List getExpressionFields() { - return expressionFields; - } - - public void addField(Field field) { - field.parent = parentLogicalView; - if (field instanceof ExpressionField) { - getExpressionFields().add((ExpressionField) field); - } - else - throw new RuntimeException("Unknown field type for ViewJoin."); - } - -} diff --git a/src/main/java/burp/model/fnmlutil/BuiltInFunctions.java b/src/main/java/burp/model/fnmlutil/BuiltInFunctions.java new file mode 100644 index 0000000..47ec26c --- /dev/null +++ b/src/main/java/burp/model/fnmlutil/BuiltInFunctions.java @@ -0,0 +1,110 @@ +package burp.model.fnmlutil; + +import burp.model.RMLFunction; +import burp.model.Return; +import burp.model.rdf.Term; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.util.Util; +import burp.vocabularies.RER; +import com.google.auto.service.AutoService; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public class BuiltInFunctions { + + private static Term getRequiredParameter(Map parameters, String name, Origin origin) { + Object val = parameters.get(name); + if (val instanceof Term) return (Term) val; + throw new BurpException(new RmlError("Missing parameter: " + name, origin, RER.Error)); + } + + @AutoService(RMLFunction.class) + public static class HelloWorldFunction implements RMLFunction { + + @Override + public List apply(Map parameters, Origin origin) { + return List.of(new Return("Hello World!")); + } + } + + @AutoService(RMLFunction.class) + public static class SchemaFunction implements RMLFunction { + + @Override + public List apply(Map parameters, Origin origin) { + String s = parameters.get("http://example.com/functions/stringParameter").toString(); + String out = "https://schema.org/" + s; + return List.of(new Return(out, Map.of("http://example.com/functions/stringOutput", out))); + } + } + + @AutoService(RMLFunction.class) + public static class ParseURL implements RMLFunction { + + @Override + public List apply(Map parameters, Origin origin) { + try { + String s = parameters.get("http://example.com/functions/stringParameter").toString(); + URI uri = new URI(s); + + String protocol = uri.getScheme(); + String domain = uri.getHost(); + String path = uri.getPath(); + + Return r = new Return( + path, + Map.of( + "http://example.com/functions/stringOutput", path, + "http://example.com/functions/protocolOutput", protocol != null ? protocol : "", + "http://example.com/functions/domainOutput", domain != null ? domain : "" + ) + ); + return List.of(r); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + @AutoService(RMLFunction.class) + public static class UUIDFunction implements RMLFunction { + + @Override + public List apply(Map parameters, Origin origin) { + return List.of(new Return(UUID.randomUUID().toString())); + } + } + + @AutoService(RMLFunction.class) + public static class ToSafeIRIFunction implements RMLFunction { + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + Term term = getRequiredParameter(parameters, valueParam, origin); + String string = term.toString(); + String out = string != null ? Util.toIRISafe(string) : null; + + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class ToSafeURIFunction implements RMLFunction { + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + Term term = getRequiredParameter(parameters, valueParam, origin); + String string = term.toString(); + String out = string != null ? Util.toURISafe(string) : null; + + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } +} diff --git a/src/main/java/burp/model/fnmlutil/Functions.java b/src/main/java/burp/model/fnmlutil/Functions.java index 16edd34..3bec3ab 100644 --- a/src/main/java/burp/model/fnmlutil/Functions.java +++ b/src/main/java/burp/model/fnmlutil/Functions.java @@ -1,19 +1,19 @@ package burp.model.fnmlutil; -import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.*; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.text.StringEscapeUtils; - import burp.model.RMLFunction; import burp.model.Return; +import burp.reporting.Origin; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.text.WordUtils; import org.apache.jena.rdf.model.Literal; import org.apache.jena.vocabulary.XSD; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.*; + public class Functions { public static Map functions = prepareFunctions(); @@ -22,7 +22,7 @@ static public List execute(String function, Map map) { RMLFunction f = functions.get(function); if(f != null) - return f.apply(map); + return f.apply(map, null); throw new RuntimeException(String.format("Function %s not yet supported.", function)); } @@ -34,7 +34,7 @@ private static Map prepareFunctions() { functions.put("http://example.com/functions/helloworld", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); l.add(new Return("Hello World!")); @@ -49,7 +49,7 @@ public List apply(Map map) { functions.put("http://example.com/functions/schema", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://example.com/functions/stringParameter").toString(); @@ -71,7 +71,7 @@ public List apply(Map map) { functions.put("http://example.com/functions/parseURL", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { String s = map.get("http://example.com/functions/stringParameter").toString(); try { @@ -99,7 +99,7 @@ public List apply(Map map) { functions.put("https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#uuid", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try{ List l = new ArrayList(); l.add(new Return(UUID.randomUUID().toString())); @@ -115,7 +115,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_and", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); @@ -135,7 +135,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_not", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool"); @@ -154,7 +154,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_or", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); @@ -174,7 +174,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_xor", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); @@ -194,7 +194,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_chomp", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -214,7 +214,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_contains", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -234,7 +234,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_contains_pattern", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -254,7 +254,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#endsWith", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -276,7 +276,7 @@ public List apply(Map map) { // Note that quotes are required around your mode. See the recipes for examples of escaping and unescaping. functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#escape", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -309,7 +309,7 @@ else if("url".equals(p.toLowerCase())) functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#length", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -328,7 +328,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#math_abs", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); Literal s = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); @@ -363,7 +363,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#math_ceil", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); Literal s = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); @@ -398,7 +398,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#math_floor", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); Literal s = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); @@ -433,7 +433,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#startsWith", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -456,7 +456,7 @@ public List apply(Map map) { // that the second argument n to is omitted a single character will be returned. functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_get", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -489,7 +489,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_replace", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -510,7 +510,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_strip", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -529,7 +529,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_substring", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -562,7 +562,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_trim", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); @@ -581,7 +581,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#toLowerCase", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); @@ -601,7 +601,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); @@ -621,7 +621,7 @@ public List apply(Map map) { functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#toTitleCase", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); @@ -645,7 +645,7 @@ public List apply(Map map) { functions.put("http://example.com/idlab/function/toUpperCaseURL", new RMLFunction() { @Override - public List apply(Map map) { + public List apply(Map map, Origin origin) { try { List l = new ArrayList(); String str = map.get("http://example.com/idlab/function/str").toString().toUpperCase(); diff --git a/src/main/java/burp/model/fnmlutil/FunctionsRegistry.java b/src/main/java/burp/model/fnmlutil/FunctionsRegistry.java new file mode 100644 index 0000000..2e855b7 --- /dev/null +++ b/src/main/java/burp/model/fnmlutil/FunctionsRegistry.java @@ -0,0 +1,66 @@ +package burp.model.fnmlutil; + +import burp.Main; +import burp.model.RMLFunction; +import burp.model.Return; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.ServiceLoader; + +public class FunctionsRegistry { + + public static Map functions = loadFunctions(); + + public static List execute(String function, Map map, Origin expressionOrigin) { + RMLFunction f = functions.get(function); + if (f != null) { + return f.apply(map, expressionOrigin); + } + throw new BurpException( + new RmlError( + "UnsupportedFunction: Function " + function + " not yet supported.", + expressionOrigin, + RER.UnsupportedFunction + ) + ); + } + + private static Map loadFunctions() { + ServiceLoader load = ServiceLoader.load(RMLFunction.class); + Map functionsMap = new HashMap<>(); + + for (RMLFunction f : load) { + if (!functionsMap.containsKey(f.toString())) { + functionsMap.put(f.toString(), f); + } else { + if (Main.report != null && Main.report.getErrors() != null) { + Main.report.getErrors().add( + new RmlError( + "Function " + f.toString() + " already exists, not loading from service loader " + f + ".", + null, + RER.Warning + ) + ); + } + } + } + + if (Main.report != null && Main.report.getErrors() != null) { + Main.report.getErrors().add( + new RmlError( + "The following " + functionsMap.size() + " functions were loaded: " + String.join(", ", functionsMap.keySet()), + null, + RER.Information + ) + ); + } + + return functionsMap; + } +} diff --git a/src/main/java/burp/model/gathermap/GatherMap.java b/src/main/java/burp/model/gathermap/GatherMap.java new file mode 100644 index 0000000..4390c1b --- /dev/null +++ b/src/main/java/burp/model/gathermap/GatherMap.java @@ -0,0 +1,136 @@ +package burp.model.gathermap; + +import burp.model.Iteration; +import burp.model.PlanNode; +import burp.model.TermGenerator; +import burp.model.rdf.*; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class GatherMap implements PlanNode { + + private PlanNode parent = null; + public boolean allowEmptyListAndContainer = false; + public Resource gatherAs = null; + public Resource strategy = RML.append; + public Origin strategyOrigin = null; + public List gatherMaps = new ArrayList<>(); + + private static long idCounter = 0L; + + public static BlankNodeTerm nextId() { + return new BlankNodeTerm("gathermap-" + (idCounter++)); + } + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public List children() { + return new ArrayList<>(gatherMaps); + } + + @Override + public List dependencies() { + return children(); + } + + public List generateTerms(Iteration i, List explicitIds) { + var superCollection = gatherMaps.stream() + .map(gm -> gm.generateTerms(i)) + .toList(); + + List> itemSets; + + if (RML.append.equals(strategy)) { + var flattened = superCollection.stream() + .flatMap(List::stream) + .toList(); + itemSets = List.of(flattened); + } else if (RML.cartesianProduct.equals(strategy)) { + itemSets = cartesianProduct(superCollection); + } else { + throw new BurpException( + new RmlError( + "Unknown strategy: " + strategy + ", choose either " + RML.append + " or " + RML.cartesianProduct + ".", + strategyOrigin, + RER.OutOfSpec, + null, + Map.of(RML.strategy, strategy) + ) + ); + } + + List results = new ArrayList<>(); + + for (List items : itemSets) { + List idsToUse; + boolean idGenerated; + if (explicitIds != null) { + idsToUse = explicitIds; + idGenerated = false; + } else { + idsToUse = List.of(nextId()); + idGenerated = true; + } + + for (BlankNodeOrIRI id : idsToUse) { + if (items.isEmpty() && !allowEmptyListAndContainer) continue; + + List itemsMutable = new ArrayList<>(items); + CollectionOrContainerTerm container; + + if (RDF.Alt.equals(gatherAs)) { + container = new RdfAltTerm(itemsMutable, id, idGenerated); + } else if (RDF.Bag.equals(gatherAs)) { + container = new RdfBagTerm(itemsMutable, id, idGenerated); + } else if (RDF.Seq.equals(gatherAs)) { + container = new RdfSeqTerm(itemsMutable, id, idGenerated); + } else { + container = new RdfListTerm(itemsMutable, id, idGenerated); + } + results.add(container); + } + } + + return results; + } + + public List generateTerms(Iteration i) { + return generateTerms(i, null); + } + + private List> cartesianProduct(List> lists) { + List> result = new ArrayList<>(); + result.add(new ArrayList<>()); + + for (List list : lists) { + List> currentResult = new ArrayList<>(); + for (T item : list) { + for (List combination : result) { + List newCombination = new ArrayList<>(combination); + newCombination.add(item); + currentResult.add(newCombination); + } + } + result = currentResult; + } + return result; + } +} diff --git a/src/main/java/burp/model/gathermaputil/GatherMapMixin.java b/src/main/java/burp/model/gathermaputil/GatherMapMixin.java index 6bed292..2c9cc3b 100644 --- a/src/main/java/burp/model/gathermaputil/GatherMapMixin.java +++ b/src/main/java/burp/model/gathermaputil/GatherMapMixin.java @@ -4,15 +4,11 @@ import burp.model.Iteration; import burp.vocabularies.RML; import com.google.common.collect.Lists; +import org.apache.jena.rdf.model.*; +import org.apache.jena.vocabulary.RDF; + import java.util.ArrayList; import java.util.List; -import org.apache.jena.rdf.model.Container; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.RDFList; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.RDF; public class GatherMapMixin { diff --git a/src/main/java/burp/model/lv/JoinType.java b/src/main/java/burp/model/lv/JoinType.java new file mode 100644 index 0000000..ef7ac5d --- /dev/null +++ b/src/main/java/burp/model/lv/JoinType.java @@ -0,0 +1,5 @@ +package burp.model.lv; + +public enum JoinType { + INNER, LEFT +} diff --git a/src/main/java/burp/model/lv/LogicalIteration.java b/src/main/java/burp/model/lv/LogicalIteration.java new file mode 100644 index 0000000..0d333d0 --- /dev/null +++ b/src/main/java/burp/model/lv/LogicalIteration.java @@ -0,0 +1,73 @@ +package burp.model.lv; + +import burp.model.Iteration; +import com.opencsv.CSVWriter; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class LogicalIteration extends Iteration { + public Map map; + + public LogicalIteration(Set nulls) { + super(nulls); + this.map = new HashMap<>(); + } + + public LogicalIteration(Map map, Set nulls) { + super(nulls); + this.map = map; + } + + @Override + public String asString() { + StringWriter stringWriter = new StringWriter(); + try (CSVWriter writer = new CSVWriter(stringWriter)) { + String[] header = map.keySet().toArray(new String[0]); + writer.writeNext(header); + String[] rec = map.values().stream() + .map(o -> o == null ? "null" : o.toString()) + .toArray(String[]::new); + writer.writeNext(rec); + } catch (Exception e) { + throw new RuntimeException("Error representing logical iteration as String/CSV.", e); + } + return stringWriter.toString(); + } + + public LogicalIteration copy() { + return new LogicalIteration(new HashMap<>(map), nulls); + } + + public void put(String key, Object o) { + if (map.containsKey(key)) { + throw new RuntimeException("Attribute " + key + " already exists in logical iteration (duplicate names in fields or joins)."); + } + map.put(key, o); + } + + public Iteration getIteration(String fieldName) { + Object o = map.get(fieldName); + return o instanceof Iteration ? (Iteration) o : null; + } + + public String getIterationString(String fieldName) { + Object o = map.get(fieldName); + if (o instanceof Iteration) { + return ((Iteration) o).asString(); + } + return o == null ? null : o.toString(); + } + + public void retainKeys(List keys) { + map.keySet().retainAll(keys); + } + + public void add(LogicalIteration iteration) { + for (Map.Entry entry : iteration.map.entrySet()) { + put(entry.getKey(), entry.getValue()); + } + } +} diff --git a/src/main/java/burp/model/lv/LogicalView.java b/src/main/java/burp/model/lv/LogicalView.java new file mode 100644 index 0000000..2a8e10a --- /dev/null +++ b/src/main/java/burp/model/lv/LogicalView.java @@ -0,0 +1,153 @@ +package burp.model.lv; + +import burp.model.*; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.BURP; +import burp.vocabularies.RER; +import org.apache.jena.rdf.model.Resource; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class LogicalView extends AbstractLogicalSource implements ContainsFields, LocalReferenceScope { + private List iterations = null; + + public AbstractLogicalSource logicalSource; + + public List expressionFields = new ArrayList<>(); + public List iterableFields = new ArrayList<>(); + + public List joins = new ArrayList<>(); + + @Override + public Iterable children() { + List list = new ArrayList<>(); + list.add(logicalSource); + for (ExpressionField e : expressionFields) { + if (e.fieldExpressionMap != null) list.add(e.fieldExpressionMap); + } + list.addAll(joins); + return list; + } + + @Override + public Iterable dependencies() { + return children(); + } + + @Override + public Iterable iterator() throws BurpException { + if (iterations == null) { + iterations = new ArrayList<>(); + + List viewOnIterations = new ArrayList<>(); + int index = 0; + for (Iteration iteration : logicalSource.iterator()) { + LogicalIteration li = new LogicalIteration(logicalSource.nulls); + li.put("#", index++); + li.put("", iteration); + viewOnIterations.add(li); + } + + iterations = Field.expand(viewOnIterations, expressionFields, iterableFields); + + for (ViewJoin join : joins) { + iterations = join.expand(iterations); + } + } + + return (List) (List) iterations; + } + + @Override + public List getExpressionFields() { + return expressionFields; + } + + @Override + public List getIterableFields() { + return iterableFields; + } + + public void addField(Field field) { + field.parent = this.logicalSource; + + if (field instanceof IterableField) { + iterableFields.add((IterableField) field); + } else if (field instanceof ExpressionField) { + expressionFields.add((ExpressionField) field); + } else { + throw new RuntimeException("Unknown field type."); + } + } + + public void addJoin(ViewJoin join) { + joins.add(join); + } + + @Override + public Resource getReferenceFormulation() { + return BURP.LogicalView; + } + + @Override + public void setReferenceFormulation(Resource referenceFormulation) { + } + + @Override + public Reference buildExportedReference(String reference, Origin origin) { + return new LogicalReference(reference, origin); + } + + @Override + public Reference buildLocalReference(String reference, Origin origin) { + return logicalSource.buildExportedReference(reference, origin); + } +} + +class LogicalReference extends Reference { + public LogicalReference(String reference, Origin origin) { + super(reference, origin); + } + + @Override + public List getValues(Iteration i) { + if (!(i instanceof LogicalIteration)) { + throw new IllegalArgumentException("LogicalReference " + reference + " can only be used with LogicalIteration."); + } + + LogicalIteration li = (LogicalIteration) i; + + if (!li.map.containsKey(reference)) { + throw new BurpException(new RmlError( + "Attribute " + reference + " does not exist.", + origin, + RER.ReferenceFormulationExecutionError, + null, + Collections.singletonMap(RER.reference, reference) + )); + } + + Object o = li.map.get(reference); + + if (o instanceof Iteration) { + throw new BurpException(new RmlError( + "Attribute " + reference + " refers to a record key.", + origin, + RER.ReferenceFormulationExecutionError, + null, + Collections.singletonMap(RER.reference, reference) + )); + } + + if (li.nulls != null && li.nulls.contains(o)) { + return Collections.emptyList(); + } + return Collections.singletonList(o); + } +} + + diff --git a/src/main/java/burp/model/lv/ViewJoin.java b/src/main/java/burp/model/lv/ViewJoin.java new file mode 100644 index 0000000..71acfbc --- /dev/null +++ b/src/main/java/burp/model/lv/ViewJoin.java @@ -0,0 +1,165 @@ +package burp.model.lv; + +import burp.model.*; +import burp.model.rdf.Datardf; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +public class ViewJoin implements PlanNode, ParentJoinReferenceScope, LocalReferenceScope, ReferenceHolder { + + public LogicalView parentLogicalView; + public List joinConditions = new ArrayList<>(); + public List expressionFields = new ArrayList<>(); + public JoinType joinType; + + private List iterations = null; + + private PlanNode parent = null; + + @Override + public PlanNode getParent() { + return parent; + } + + @Override + public void setParent(PlanNode parent) { + this.parent = parent; + } + + @Override + public Iterable children() { + List list = new ArrayList<>(); + list.add(parentLogicalView); + list.addAll(joinConditions); + for (ExpressionField e : expressionFields) { + if (e.fieldExpressionMap != null) { + list.add(e.fieldExpressionMap); + } + } + return list; + } + + @Override + public Iterable dependencies() { + return children(); + } + + public List expand(List childIterations) { + try { + if (iterations == null) { + iterations = StreamSupport + .stream(parentLogicalView.iterator().spliterator(), false) + .filter(a -> a instanceof LogicalIteration) + .map(a -> (LogicalIteration) a) + .collect(Collectors.toList()); + } + + List newList = new ArrayList<>(); + + for (LogicalIteration childIteration : childIterations) { + boolean hasACorrespondence = false; + + int count = -1; + + for (LogicalIteration parentIteration : iterations) { + if (matches(childIteration, parentIteration)) { + hasACorrespondence = true; + + count++; + + List result = new ArrayList<>(); + result.add(childIteration); + for (ExpressionField e : expressionFields) { + result = enrichForJoin(e, count, result, parentIteration); + } + + newList.addAll(result); + } + } + + if (!hasACorrespondence && joinType == JoinType.LEFT) { + LogicalIteration newIteration = childIteration.copy(); + for (ExpressionField e : expressionFields) { + newIteration.put(e.fieldName, null); + newIteration.put(e.fieldName + ".#", null); + } + newList.add(newIteration); + } + } + + return newList; + } catch (BurpException e) { + throw e; + } catch (Throwable e) { + throw new BurpException(new RmlError("Error while expanding ViewJoin: " + e.getMessage(), null, RER.ExecutionError)); + } + } + + private List enrichForJoin(ExpressionField e, int index, List result, LogicalIteration parentIteration) { + List nList = new ArrayList<>(); + + for (LogicalIteration li : result) { + for (Object o : e.fieldExpressionMap.generateValues(parentIteration, TemplateReferenceSafety.SAFE_IRI)) { + LogicalIteration newLogicalIteration = li.copy(); + newLogicalIteration.put(e.fieldName, o); + newLogicalIteration.put(e.fieldName + ".#", index); + nList.add(newLogicalIteration); + } + } + + return nList; + } + + private boolean matches(LogicalIteration childIteration, LogicalIteration parentIteration) { + for (JoinCondition jc : joinConditions) { + Set values1 = jc.childMap.generateValues(childIteration, TemplateReferenceSafety.UNSAFE).stream().collect(Collectors.toSet()); + Set values2 = jc.parentMap.generateValues(parentIteration, TemplateReferenceSafety.UNSAFE).stream().collect(Collectors.toSet()); + + boolean match = values1.stream().anyMatch(v1 -> values2.stream().anyMatch(v2 -> Datardf.semanticEquals(v1, v2))); + if (!match) { + return false; + } + } + return true; + } + + public void addField(Field field) { + field.parent = parentLogicalView; + if (field instanceof ExpressionField) { + this.expressionFields.add((ExpressionField) field); + } else { + throw new RuntimeException("Unknown field type for ViewJoin."); + } + } + + @Override + public Reference buildLocalReference(String reference, Origin origin) { + return ((LogicalView) parent).buildExportedReference(reference, origin); + } + + @Override + public Reference buildParentJoinReference(String reference, Origin origin) { + return parentLogicalView.buildExportedReference(reference, origin); + } + + @Override + public void compileReferences() { + for (ExpressionField field : expressionFields) { + if (field.fieldExpressionMap != null) { + for (RawReference ref : field.fieldExpressionMap.descendants(RawReference.class).toList()) { + if (ref.getReference() != null && ref.getCompiledReference() == null) { + ref.setCompiledReference(this.buildParentJoinReference(ref.getReference(), ref.getOrigin())); + } + } + } + } + } +} diff --git a/src/main/java/burp/model/rdf/BlankNodeOrIRI.java b/src/main/java/burp/model/rdf/BlankNodeOrIRI.java new file mode 100644 index 0000000..0b21631 --- /dev/null +++ b/src/main/java/burp/model/rdf/BlankNodeOrIRI.java @@ -0,0 +1,4 @@ +package burp.model.rdf; + +public sealed interface BlankNodeOrIRI extends Term permits BlankNodeTerm, IRITerm, CollectionOrContainerTerm { +} diff --git a/src/main/java/burp/model/rdf/BlankNodeTerm.java b/src/main/java/burp/model/rdf/BlankNodeTerm.java new file mode 100644 index 0000000..3c43bb9 --- /dev/null +++ b/src/main/java/burp/model/rdf/BlankNodeTerm.java @@ -0,0 +1,17 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; +import org.jspecify.annotations.NonNull; + +import java.util.Set; + +public record BlankNodeTerm(String id, Set targets) implements BlankNodeOrIRI { + public BlankNodeTerm(String id) { + this(id, Set.of()); + } + + @Override + public @NonNull String toString() { + return "_:" + id; + } +} diff --git a/src/main/java/burp/model/rdf/CollectionOrContainerTerm.java b/src/main/java/burp/model/rdf/CollectionOrContainerTerm.java new file mode 100644 index 0000000..6e0ffcf --- /dev/null +++ b/src/main/java/burp/model/rdf/CollectionOrContainerTerm.java @@ -0,0 +1,45 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; + +import java.util.List; +import java.util.Objects; +import java.util.Set; + +public abstract sealed class CollectionOrContainerTerm implements BlankNodeOrIRI permits RdfListTerm, RdfBagTerm, RdfSeqTerm, RdfAltTerm { + private final List elements; + private BlankNodeOrIRI id; + private final boolean idGenerated; + private final Set targets; + + protected CollectionOrContainerTerm(List elements, BlankNodeOrIRI id, boolean idGenerated, Set targets) { + this.elements = elements; + this.id = id; + this.idGenerated = idGenerated; + this.targets = targets != null ? targets : Set.of(); + } + + public List getElements() { return elements; } + public BlankNodeOrIRI getId() { return id; } + public void setId(BlankNodeOrIRI id) { this.id = id; } + public boolean isIdGenerated() { return idGenerated; } + + @Override + public Set targets() { return targets; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CollectionOrContainerTerm that = (CollectionOrContainerTerm) o; + return idGenerated == that.idGenerated && + Objects.equals(elements, that.elements) && + Objects.equals(id, that.id) && + Objects.equals(targets, that.targets); + } + + @Override + public int hashCode() { + return Objects.hash(elements, id, idGenerated, targets); + } +} diff --git a/src/main/java/burp/model/rdf/Datardf.java b/src/main/java/burp/model/rdf/Datardf.java new file mode 100644 index 0000000..742f771 --- /dev/null +++ b/src/main/java/burp/model/rdf/Datardf.java @@ -0,0 +1,93 @@ +package burp.model.rdf; + +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; + +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.Timestamp; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.Locale; +import java.util.Objects; + +public final class Datardf { + + private Datardf() {} + + public static IRITerm iriTerm(Resource resource) { + return new IRITerm(resource.getURI()); + } + + public static IRITerm rdfUnderscore(int idx) { + return new IRITerm(RDF.uri + "_" + idx); + } + + /** + * Compares two values for semantic equality, particularly useful for Join Conditions. + * It natively compares objects of the same class (for performance) and otherwise + * falls back to converting native types to RDF LiteralTerms to ensure semantic + * equality (e.g., matching a raw String with a LiteralTerm of xsd:string). + */ + public static boolean semanticEquals(Object a, Object b) { + if (Objects.equals(a, b)) return true; + + if (a != null && b != null) { + if (a.getClass().equals(b.getClass()) && !(a instanceof Term)) { + return false; + } + } + + Term termA = toTerm(a); + Term termB = toTerm(b); + + if (termA instanceof LiteralTerm litA && termB instanceof LiteralTerm litB) { + return Objects.equals(litA.value(), litB.value()); + } + if (termA instanceof IRITerm iriA && termB instanceof IRITerm iriB) { + return Objects.equals(iriA.uri(), iriB.uri()); + } + if (termA instanceof BlankNodeTerm bnA && termB instanceof BlankNodeTerm bnB) { + return Objects.equals(bnA.id(), bnB.id()); + } + + return Objects.equals(termA, termB); + } + + static final IRITerm XSDinteger = new IRITerm("http://www.w3.org/2001/XMLSchema#integer"); + static final IRITerm XSDdouble = new IRITerm("http://www.w3.org/2001/XMLSchema#double"); + static final IRITerm XSDdate = new IRITerm("http://www.w3.org/2001/XMLSchema#date"); + static final IRITerm XSDdateTime = new IRITerm("http://www.w3.org/2001/XMLSchema#dateTime"); + static final IRITerm XSDstring = new IRITerm("http://www.w3.org/2001/XMLSchema#string"); + + public static Term toTerm(Object o) { + if (o instanceof Term t) return t; + if (o == null) return null; + + if (o instanceof Integer || o instanceof Long) { + return new LiteralTerm(o.toString(), XSDinteger, null); + } else if (o instanceof Float f) { + return new LiteralTerm(doubleCanonicalMap(f.doubleValue()), XSDdouble, null); + } else if (o instanceof Double d) { + return new LiteralTerm(doubleCanonicalMap(d), XSDdouble, null); + } else if (o instanceof Date) { + return new LiteralTerm(o.toString(), XSDdate, null); + } else if (o instanceof Timestamp ts) { + String s = ts.toString().replace(" ", "T"); + if (ts.getNanos() == 0) s = s.replace(".0", ""); + return new LiteralTerm(s, XSDdateTime, null); + } else { + return new LiteralTerm(o.toString(), XSDstring, null); + } + } + + static String doubleCanonicalMap(double d) { + BigDecimal f = BigDecimal.valueOf(d); + int p = f.precision(); + String x = "0.0" + "#".repeat(Math.max(0, p - 2)) + "E0"; + NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US); + DecimalFormat formatter = (DecimalFormat) numberFormat; + formatter.applyPattern(x); + return formatter.format(d); + } +} diff --git a/src/main/java/burp/model/rdf/IRITerm.java b/src/main/java/burp/model/rdf/IRITerm.java new file mode 100644 index 0000000..e3e2f70 --- /dev/null +++ b/src/main/java/burp/model/rdf/IRITerm.java @@ -0,0 +1,17 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; +import org.jspecify.annotations.NonNull; + +import java.util.Set; + +public record IRITerm(String uri, Set targets) implements BlankNodeOrIRI { + public IRITerm(String uri) { + this(uri, Set.of()); + } + + @Override + public @NonNull String toString() { + return "<" + uri + ">"; + } +} diff --git a/src/main/java/burp/model/rdf/LiteralTerm.java b/src/main/java/burp/model/rdf/LiteralTerm.java new file mode 100644 index 0000000..0343344 --- /dev/null +++ b/src/main/java/burp/model/rdf/LiteralTerm.java @@ -0,0 +1,55 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; +import org.jspecify.annotations.NonNull; + +import java.util.Set; + +public record LiteralTerm(String value, IRITerm datatype, String language, Set targets) implements Term { + + public LiteralTerm(String value, IRITerm datatype, String language) { + this(value, datatype, language, Set.of()); + } + + public LiteralTerm(String value, IRITerm datatype) { + this(value, datatype, null, Set.of()); + } + + public LiteralTerm(String value) { + this(value, null, null, Set.of()); + } + + @Override + public @NonNull String toString() { + if (language != null) { + return "\"" + value + "\"@" + language; + } else if (datatype != null) { + return "\"" + value + "\"^^" + datatype.uri(); + } else { + return "\"" + value + "\""; + } + } + + public Integer intOrNull() { + try { + return Integer.valueOf(value); + } catch (NumberFormatException e) { + return null; + } + } + + public Double doubleOrNull() { + try { + return Double.valueOf(value); + } catch (NumberFormatException e) { + return null; + } + } + + public Boolean booleanOrNull() { + String lower = value.toLowerCase(); + if ("true".equals(lower) || "1".equals(lower)) return true; + if ("false".equals(lower) || "0".equals(lower)) return false; + return null; + } +} diff --git a/src/main/java/burp/model/rdf/RdfAltTerm.java b/src/main/java/burp/model/rdf/RdfAltTerm.java new file mode 100644 index 0000000..7602343 --- /dev/null +++ b/src/main/java/burp/model/rdf/RdfAltTerm.java @@ -0,0 +1,21 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; + +import java.util.List; +import java.util.Set; + +public final class RdfAltTerm extends CollectionOrContainerTerm { + public RdfAltTerm(List elements, BlankNodeOrIRI id, boolean idGenerated, Set targets) { + super(elements, id, idGenerated, targets); + } + + public RdfAltTerm(List elements, BlankNodeOrIRI id, boolean idGenerated) { + super(elements, id, idGenerated, Set.of()); + } + + @Override + public String toString() { + return "RdfAltTerm(elements=" + getElements() + ", id=" + getId() + ", idGenerated=" + isIdGenerated() + ", targets=" + targets() + ")"; + } +} diff --git a/src/main/java/burp/model/rdf/RdfBagTerm.java b/src/main/java/burp/model/rdf/RdfBagTerm.java new file mode 100644 index 0000000..9beab72 --- /dev/null +++ b/src/main/java/burp/model/rdf/RdfBagTerm.java @@ -0,0 +1,21 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; + +import java.util.List; +import java.util.Set; + +public final class RdfBagTerm extends CollectionOrContainerTerm { + public RdfBagTerm(List elements, BlankNodeOrIRI id, boolean idGenerated, Set targets) { + super(elements, id, idGenerated, targets); + } + + public RdfBagTerm(List elements, BlankNodeOrIRI id, boolean idGenerated) { + super(elements, id, idGenerated, Set.of()); + } + + @Override + public String toString() { + return "RdfBagTerm(elements=" + getElements() + ", id=" + getId() + ", idGenerated=" + isIdGenerated() + ", targets=" + targets() + ")"; + } +} diff --git a/src/main/java/burp/model/rdf/RdfListTerm.java b/src/main/java/burp/model/rdf/RdfListTerm.java new file mode 100644 index 0000000..7c1fa2f --- /dev/null +++ b/src/main/java/burp/model/rdf/RdfListTerm.java @@ -0,0 +1,21 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; + +import java.util.List; +import java.util.Set; + +public final class RdfListTerm extends CollectionOrContainerTerm { + public RdfListTerm(List elements, BlankNodeOrIRI id, boolean idGenerated, Set targets) { + super(elements, id, idGenerated, targets); + } + + public RdfListTerm(List elements, BlankNodeOrIRI id, boolean idGenerated) { + super(elements, id, idGenerated, Set.of()); + } + + @Override + public String toString() { + return "RdfListTerm(elements=" + getElements() + ", id=" + getId() + ", idGenerated=" + isIdGenerated() + ", targets=" + targets() + ")"; + } +} diff --git a/src/main/java/burp/model/rdf/RdfSeqTerm.java b/src/main/java/burp/model/rdf/RdfSeqTerm.java new file mode 100644 index 0000000..0626350 --- /dev/null +++ b/src/main/java/burp/model/rdf/RdfSeqTerm.java @@ -0,0 +1,21 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; + +import java.util.List; +import java.util.Set; + +public final class RdfSeqTerm extends CollectionOrContainerTerm { + public RdfSeqTerm(List elements, BlankNodeOrIRI id, boolean idGenerated, Set targets) { + super(elements, id, idGenerated, targets); + } + + public RdfSeqTerm(List elements, BlankNodeOrIRI id, boolean idGenerated) { + super(elements, id, idGenerated, Set.of()); + } + + @Override + public String toString() { + return "RdfSeqTerm(elements=" + getElements() + ", id=" + getId() + ", idGenerated=" + isIdGenerated() + ", targets=" + targets() + ")"; + } +} diff --git a/src/main/java/burp/model/rdf/Term.java b/src/main/java/burp/model/rdf/Term.java new file mode 100644 index 0000000..dc5345f --- /dev/null +++ b/src/main/java/burp/model/rdf/Term.java @@ -0,0 +1,9 @@ +package burp.model.rdf; + +import burp.model.LogicalTarget; + +import java.util.Set; + +public sealed interface Term permits BlankNodeOrIRI, LiteralTerm { + Set targets(); +} diff --git a/src/main/java/burp/parse/BurpParserError.java b/src/main/java/burp/parse/BurpParserError.java new file mode 100644 index 0000000..c28322d --- /dev/null +++ b/src/main/java/burp/parse/BurpParserError.java @@ -0,0 +1,41 @@ +package burp.parse; + +import burp.reporting.TextFilePointer; +import org.antlr.v4.runtime.ANTLRErrorListener; +import org.antlr.v4.runtime.Parser; +import org.antlr.v4.runtime.RecognitionException; +import org.antlr.v4.runtime.Recognizer; +import org.antlr.v4.runtime.atn.ATNConfigSet; +import org.antlr.v4.runtime.dfa.DFA; + +import java.util.ArrayList; +import java.util.BitSet; +import java.util.List; + +public class BurpParserError implements ANTLRErrorListener { + public record TurtleProvParserError(int line, int column, String message) { + } + + public List errors = new ArrayList<>(); + + @Override + public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { + errors.add(new TurtleProvParserError(line, charPositionInLine, msg)); + } + + @Override + public void reportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, boolean exact, BitSet ambigAlts, ATNConfigSet configs) { + } + + @Override + public void reportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, ATNConfigSet configs) { + } + + @Override + public void reportContextSensitivity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, ATNConfigSet configs) { + } + + public List getPointers(){ + return new ArrayList<>(); + } +} diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index 31ea5cd..4f2a882 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -1,231 +1,323 @@ package burp.parse; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import burp.Main; +import burp.ls.LogicalSourceFactory; import burp.model.*; -import org.apache.jena.query.QueryExecutionFactory; +import burp.model.gathermap.GatherMap; +import burp.model.lv.JoinType; +import burp.model.lv.LogicalView; +import burp.model.lv.ViewJoin; +import burp.model.rdf.BlankNodeTerm; +import burp.model.rdf.IRITerm; +import burp.model.rdf.LiteralTerm; +import burp.model.rdf.Term; +import burp.parse.turtleprov.ProvStore; +import burp.parse.turtleprov.ProvTurtleVisitor; +import burp.parse.turtleprov.RDF12Converter; +import burp.parse.turtleprov.generated.TurtleLexer; +import burp.parse.turtleprov.generated.TurtleParser; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.reporting.StatementParts; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.CommonTokenStream; +import org.apache.jena.graph.Node; +import org.apache.jena.query.Dataset; +import org.apache.jena.query.DatasetFactory; +import org.apache.jena.query.ParameterizedSparqlString; +import org.apache.jena.query.QueryParseException; import org.apache.jena.rdf.model.*; +import org.apache.jena.riot.Lang; import org.apache.jena.riot.RDFDataMgr; import org.apache.jena.shacl.ShaclValidator; import org.apache.jena.shacl.ValidationReport; -import org.apache.jena.shacl.lib.ShLib; +import org.apache.jena.shacl.validation.ReportEntry; +import org.apache.jena.sparql.path.*; +import org.apache.jena.update.UpdateAction; +import org.apache.jena.update.UpdateFactory; +import org.apache.jena.update.UpdateRequest; import org.apache.jena.util.FileUtils; -import org.apache.jena.util.iterator.ExtendedIterator; -import org.apache.jena.vocabulary.RDF; - -import burp.ls.LogicalSourceFactory; -import burp.model.gathermaputil.GatherMapMixin; -import burp.vocabularies.RML; -import burp.vocabularies.YS; -import org.apache.jena.vocabulary.XSD; - -public class Parse { - static Map triplesmaps = null; - static Map logicalviews = null; +import java.nio.file.Path; +import java.util.*; - private static String mappingPath = null; - private static String currentDirectory = null; +import static burp.reporting.StatementPart.*; - public static List parseMappingFile(String mappingFile) throws Exception { - mappingPath = Paths.get(mappingFile).toAbsolutePath().getParent().toString(); - currentDirectory = Paths.get("").toAbsolutePath().toString(); - - triplesmaps = new HashMap<>(); - logicalviews = new HashMap<>(); +public class Parse { - Model mapping = RDFDataMgr.loadModel(mappingFile); + public final Map triplesMaps = new HashMap<>(); + public final Map logicalViews = new HashMap<>(); + public final Map logicalTargets = new HashMap<>(); + + private Path mappingDirectory = null; + private Path mappingFile = null; + private Path currentDirectory = null; + private Model mapping = null; + private BurpParserError parserError = null; + + private Dataset parseTurtleFromFile(Path turtleFile) throws Exception { + CharStream input = CharStreams.fromPath(turtleFile); + TurtleLexer lexer = new TurtleLexer(input); + CommonTokenStream tokens = new CommonTokenStream(lexer); + TurtleParser parser = new TurtleParser(tokens); + var errorListeners = parser.getErrorListeners(); + var parserListeners = parser.getParseListeners(); + parserError = new BurpParserError(); + parser.addErrorListener(parserError); + ProvTurtleVisitor visitor = new ProvTurtleVisitor(); + ProvStore store = visitor.visitTurtleDoc(parser.turtleDoc()); + Model m = RDF12Converter.toModel(store); + return DatasetFactory.create(m); + } - if(!isValid(mapping)) - throw new RuntimeException("Mapping did not satisfy shapes."); + public List parseMappingFile(Path mappingPath, Path currentDirectory) throws Exception { + this.mappingFile = mappingPath.toAbsolutePath().normalize(); + this.mappingDirectory = this.mappingFile.getParent(); + this.currentDirectory = currentDirectory; - // Replace rml:subject, rml:object, ... with constant expression maps - normalizeConstants(mapping); + Lang guessType = RDFDataMgr.determineLang(mappingPath.toString(), null, null); - // Look for the triples maps - List list = mapping.listSubjectsWithProperty(RML.logicalSource).toList(); + if (guessType == Lang.TURTLE) { + Dataset dataset = parseTurtleFromFile(mappingPath); + if (parserError!=null&& !parserError.errors.isEmpty()) { - // Process each triples map - for (Resource r : list) { - TriplesMap tm = triplesmaps.computeIfAbsent(r, (x) -> new TriplesMap()); + } + mapping = dataset.getDefaultModel(); + } else { + mapping = RDFDataMgr.loadModel(mappingPath.toString()); + } - Resource ls = r.getPropertyResourceValue(RML.logicalSource); - tm.logicalSource = prepareLogicalSource(ls); + if (!isValid(mapping)) { + throw new BurpException(new RmlError("Mapping did not satisfy shapes.", null, RER.MappingError, null)); + } - Resource sm = r.getPropertyResourceValue(RML.subjectMap); - tm.subjectMap = prepareSubjectMap(sm); + // Replace rml:subject, rml:object, ... with constant getExpression() maps + normalizeConstantsUpdate(mapping); - if(r.hasProperty(RML.baseIRI)) - tm.baseIRI = r.getPropertyResourceValue(RML.baseIRI).getURI(); + // Look for the triples maps + List list = mapping.listSubjectsWithProperty(RML.logicalSource).toList(); - r.listProperties(RML.predicateObjectMap).forEach((s) -> { - PredicateObjectMap pom = preparePredicateObjectMap(s.getObject().asResource()); - tm.predicateObjectMaps.add(pom); - }); - } + // Process each triples map + for (Resource r : list) { + TriplesMap tm = triplesMaps.computeIfAbsent(r, TriplesMap::new); - return new ArrayList<>(triplesmaps.values()); - } + Resource ls = r.getPropertyResourceValue(RML.logicalSource); + Statement lsStmt = r.getProperty(RML.logicalSource); + AbstractLogicalSource source = prepareLogicalSource(ls); + tm.logicalSource = source; - private static boolean isValid(Model mapping) { - Model core = ModelFactory.createDefaultModel(); - core.read(Parse.class.getResourceAsStream("/shapes/rml-core/core.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/rml-cc/cc.ttl"), "urn:dummy", FileUtils.langTurtle); - //core.read(Parse.class.getResourceAsStream("/shapes/rml-io/io.ttl"), "urn:dummy", FileUtils.langTurtle); - //core.read(Parse.class.getResourceAsStream("/shapes/rml-fnml/fnml.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/rml-lv/lv.ttl"), "urn:dummy", FileUtils.langTurtle); - //core.read(Parse.class.getResourceAsStream("/shapes/rml-star/star.ttl"), "urn:dummy", FileUtils.langTurtle); + ls.listProperties(RML.logicalTarget).forEachRemaining(s -> { + tm.getLogicalTargets().add(prepareLogicalTarget(s.getResource())); + }); - ValidationReport report = ShaclValidator.get().validate(core.getGraph(), mapping.getGraph()); - if(!report.conforms()) { - ShLib.printReport(report); - System.err.println(report); - return false; - } + r.listProperties(RML.logicalTarget).forEachRemaining(s -> { + tm.getLogicalTargets().add(prepareLogicalTarget(s.getResource())); + }); - return true; - } + List subjectMapList = r.listProperties(RML.subjectMap).toList(); + if (subjectMapList.isEmpty()) { + Main.report.getErrors().add( + new RmlError( + "No subject maps in " + tm, + new Origin(lsStmt, Subject, null), + RER.MappingError, + null + ) + ); + continue; + } + if (subjectMapList.size() > 1) { + List originStatements = subjectMapList.stream() + .map(StatementParts::fromPredicateObject) + .toList(); + Main.report.getErrors().add( + new RmlError( + "Multiple subject maps in " + tm, + new Origin((PlanNode) null, originStatements), + RER.MappingError, + null + ) + ); + } + Resource sm = r.getPropertyResourceValue(RML.subjectMap); + tm.subjectMap = prepareSubjectMap(sm); - private static void normalizeConstants(Model mapping) { - String CONSTRUCTSMAPS = "PREFIX r: CONSTRUCT { ?x r:subjectMap [ r:constant ?y ]. } WHERE { ?x r:subject ?y. }"; - String CONSTRUCTOMAPS = "PREFIX r: CONSTRUCT { ?x r:objectMap [ r:constant ?y ]. } WHERE { ?x r:object ?y. }"; - String CONSTRUCTPMAPS = "PREFIX r: CONSTRUCT { ?x r:predicateMap [ r:constant ?y ]. } WHERE { ?x r:predicate ?y. }"; - String CONSTRUCTGMAPS = "PREFIX r: CONSTRUCT { ?x r:graphMap [ r:constant ?y ]. } WHERE { ?x r:graph ?y. }"; + if (r.hasProperty(RML.baseIRI)) { + tm.baseIRI = r.getPropertyResourceValue(RML.baseIRI).getURI(); + } - mapping.add(QueryExecutionFactory.create(CONSTRUCTSMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(CONSTRUCTOMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(CONSTRUCTPMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(CONSTRUCTGMAPS, mapping).execConstruct()); + r.listProperties(RML.predicateObjectMap).forEachRemaining(s -> { + PredicateObjectMap pom = preparePredicateObjectMap(s.getObject().asResource()); + tm.predicateObjectMaps.add(pom); + }); + } - String CONSTRUCTLMAPS = "PREFIX r: CONSTRUCT { ?x r:languageMap [ r:constant ?y ]. } WHERE { ?x r:language ?y. }"; - String CONSTRUCTDMAPS = "PREFIX r: CONSTRUCT { ?x r:datatypeMap [ r:constant ?y ]. } WHERE { ?x r:datatype ?y. }"; + return new ArrayList<>(triplesMaps.values()); + } - mapping.add(QueryExecutionFactory.create(CONSTRUCTLMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(CONSTRUCTDMAPS, mapping).execConstruct()); + private boolean isValid(Model mapping) { + Model core = ModelFactory.createDefaultModel(); + core.read(Parse.class.getResourceAsStream("/shapes/rml-core/core.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/rml-cc/cc.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/rml-lv/lv.ttl"), "urn:dummy", FileUtils.langTurtle); + + ValidationReport report = ShaclValidator.get().validate(core.getGraph(), mapping.getGraph()); + if (!report.conforms()) { + report.getEntries().forEach(vr -> { + List focusOrigins = extractStatementsFromShaclViolation(vr, mapping); + Main.report.getErrors().add( + new RmlError( + vr.message() + " \nNode=" + vr.focusNode() + "\nPath=" + vr.resultPath() + "\nValue: " + vr.value() + "\n", + new Origin(null, focusOrigins.isEmpty() ? null : focusOrigins), + RER.MappingError, + null + ) + ); + }); + return false; + } - String CONSTRUCTChMAPS = "PREFIX r: CONSTRUCT { ?x r:childMap [ r:reference ?y ]. } WHERE { ?x r:child ?y. }"; - String CONSTRUCTPaMAPS = "PREFIX r: CONSTRUCT { ?x r:parentMap [ r:reference ?y ]. } WHERE { ?x r:parent ?y. }"; + return true; + } - mapping.add(QueryExecutionFactory.create(CONSTRUCTChMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(CONSTRUCTPaMAPS, mapping).execConstruct()); + private void normalizeConstantsUpdate(Model mapping) { + String conditionShortcutExpand = """ + PREFIX rml: + PREFIX idlab-fn: + + DELETE { + ?map rml:condition ?condition . + ?map ?prop ?value . + } + INSERT { + ?map rml:functionExecution [ + rml:function idlab-fn:IF ; + rml:input [ + rml:parameter idlab-fn:boolParameter ; + rml:inputValueMap ?condition + ] , [ + rml:parameter idlab-fn:parameter ; + rml:inputValueMap [ + ?prop ?value + ] + ] + ] . + } + WHERE { + ?map rml:condition ?condition . + ?map ?prop ?value . + VALUES ?prop { rml:constant rml:reference rml:template rml:functionExecution } + } + """; + + String constructTermTypes = """ + PREFIX r: + INSERT { ?x r:constant ?y ; r:termType ?z . } + WHERE { + ?x r:constant ?y. + BIND(IF(ISLITERAL(?y), r:Literal, IF(ISIRI(?y), r:IRI, r:BlankNode)) AS ?z) + } + """; + + List updateQueries = Arrays.asList( + conditionShortcutExpand, + expandShortcut(RML.subjectMap, RML.constant, ResourceFactory.createProperty(RML.NS + "subject")), + expandShortcut(RML.objectMap, RML.constant, ResourceFactory.createProperty(RML.NS + "object")), + expandShortcut(RML.predicateMap, RML.constant, ResourceFactory.createProperty(RML.NS + "predicate")), + expandShortcut(RML.graphMap, RML.constant, ResourceFactory.createProperty(RML.NS + "graph")), + + expandShortcut(RML.languageMap, RML.constant, ResourceFactory.createProperty(RML.NS + "language")), + expandShortcut(RML.datatypeMap, RML.constant, ResourceFactory.createProperty(RML.NS + "datatype")), + + expandShortcut(RML.childMap, RML.reference, ResourceFactory.createProperty(RML.NS + "child")), + expandShortcut(RML.parentMap, RML.reference, ResourceFactory.createProperty(RML.NS + "parent")), + + expandShortcut(RML.returnMap, RML.constant, ResourceFactory.createProperty(RML.NS + "return")), + expandShortcut(RML.functionMap, RML.constant, ResourceFactory.createProperty(RML.NS + "function")), + expandShortcut(RML.parameterMap, RML.constant, ResourceFactory.createProperty(RML.NS + "parameter")), + expandShortcut(RML.inputValueMap, RML.constant, ResourceFactory.createProperty(RML.NS + "inputValue")), + constructTermTypes, + constructImplicitTermTypeQuery(RML.subjectMap), + constructImplicitTermTypeQuery(RML.graphMap), + constructImplicitTermTypeQuery(RML.objectMap) + ); + + for (String query : updateQueries) { + try { + UpdateRequest update = UpdateFactory.create(query); + UpdateAction.execute(update, mapping); + } catch (QueryParseException e) { + throw new BurpException( + new RmlError( + "Normalize mapping failed: " + query, + null, + RER.UnexpectedError, + e + ) + ); + } + } + } - String CONSTRUCTRETURNMAPS = "PREFIX r: CONSTRUCT { ?x r:returnMap [ r:constant ?y ]. } WHERE { ?x r:return ?y. }"; - String CONSTRUCTFUNCTIONMAPS = "PREFIX r: CONSTRUCT { ?x r:functionMap [ r:constant ?y ]. } WHERE { ?x r:function ?y. }"; - String CONSTRUCTPARAMETERMAPS = "PREFIX r: CONSTRUCT { ?x r:parameterMap [ r:constant ?y ]. } WHERE { ?x r:parameter ?y. }"; - String INPUTVALUEMAPS = "PREFIX r: CONSTRUCT { ?x r:inputValueMap [ r:constant ?y ]. } WHERE { ?x r:inputValue ?y. }"; + public String expandShortcut(Property mapType, Property expressionType, Property mapTypeShort) { + ParameterizedSparqlString pss = new ParameterizedSparqlString( + """ + INSERT { ?x ?mapType [ ?expressionType ?y ]. } + WHERE { ?x ?mapTypeShort ?y . } + """ + ); + pss.setIri("mapType", mapType.getURI()); + pss.setIri("expressionType", expressionType.getURI()); + pss.setIri("mapTypeShort", mapTypeShort.getURI()); + return pss.toString(); + } - mapping.add(QueryExecutionFactory.create(CONSTRUCTRETURNMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(CONSTRUCTFUNCTIONMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(CONSTRUCTPARAMETERMAPS, mapping).execConstruct()); - mapping.add(QueryExecutionFactory.create(INPUTVALUEMAPS, mapping).execConstruct()); + public String constructImplicitTermTypeQuery(Property mapType) { + ParameterizedSparqlString pss = new ParameterizedSparqlString( + """ + PREFIX rml: + INSERT { ?x rml:termType rml:BlankNode } + WHERE { + [] ?mapType ?x . + OPTIONAL { ?x rml:template ?a } + OPTIONAL { ?x rml:reference ?b } + OPTIONAL { ?x rml:constant ?c } + OPTIONAL { ?x rml:functionExecution ?d } + FILTER(!BOUND(?a) && !BOUND(?b) && !BOUND(?c) && !BOUND(?d)) + } + """ + ); + pss.setIri("mapType", mapType.getURI()); + return pss.toString(); + } - String TERMTYPESTOCONSTANTS = "PREFIX r: CONSTRUCT { ?x r:constant ?y ; r:termType ?z . } WHERE { ?x r:constant ?y. BIND(IF(ISLITERAL(?y), r:Literal, IF(ISIRI(?y), r:IRI, r:BlankNode)) AS ?z)}"; - mapping.add(QueryExecutionFactory.create(TERMTYPESTOCONSTANTS, mapping).execConstruct()); - - // Graph maps, subject maps, and object maps can have no reference - // They will generate blank nodes, thus add term type BN - String IMPLICITTERMTYPE = "PREFIX r: CONSTRUCT { ?x r:termType r:BlankNode } WHERE { [] r:subjectMap ?x . OPTIONAL { ?x r:template ?a } OPTIONAL { ?x r:reference ?b } OPTIONAL { ?x r:constant ?c } OPTIONAL { ?x r:functionExecution ?d } FILTER(!BOUND(?a) && !BOUND(?b) && !BOUND(?c) && !BOUND(?d)) }"; - mapping.add(QueryExecutionFactory.create(IMPLICITTERMTYPE, mapping).execConstruct()); - IMPLICITTERMTYPE = "PREFIX r: CONSTRUCT { ?x r:termType r:BlankNode } WHERE { [] r:graphMap ?x . OPTIONAL { ?x r:template ?a } OPTIONAL { ?x r:reference ?b } OPTIONAL { ?x r:constant ?c } OPTIONAL { ?x r:functionExecution ?d } FILTER(!BOUND(?a) && !BOUND(?b) && !BOUND(?c) && !BOUND(?d)) }"; - mapping.add(QueryExecutionFactory.create(IMPLICITTERMTYPE, mapping).execConstruct()); - IMPLICITTERMTYPE = "PREFIX r: CONSTRUCT { ?x r:termType r:BlankNode } WHERE { [] r:objectMap ?x . OPTIONAL { ?x r:template ?a } OPTIONAL { ?x r:reference ?b } OPTIONAL { ?x r:constant ?c } OPTIONAL { ?x r:functionExecution ?d } FILTER(!BOUND(?a) && !BOUND(?b) && !BOUND(?c) && !BOUND(?d)) }"; - mapping.add(QueryExecutionFactory.create(IMPLICITTERMTYPE, mapping).execConstruct()); - } - - private static AbstractLogicalSource prepareLogicalSource(Resource ls) throws Exception { - // This is RML-LV - if(ls.hasProperty(RML.viewOn)) { + private AbstractLogicalSource prepareLogicalSource(Resource ls) throws Exception { + if (ls.hasProperty(RML.viewOn)) { return prepareLogicalView(ls); } - - // This is RML-CORE - Resource referenceFormulation = ls.getPropertyResourceValue(RML.referenceFormulation); - - // The path is by default the current working directory - String sourcePath = getSourcePath(ls); - - LogicalSource s = null; - if (RML.JSONPath.equals(referenceFormulation)) - s = LogicalSourceFactory.createJSONSource(ls, sourcePath); - // This is RML-IO - else if (RML.CSV.equals(referenceFormulation)) - s = LogicalSourceFactory.createCSVSource(ls, sourcePath); - else if (RML.XPath.equals(referenceFormulation)) - s = LogicalSourceFactory.createXMLSource(ls, sourcePath); - else if (referenceFormulation.hasProperty(RDF.type, RML.XPathReferenceFormulation)) - s = LogicalSourceFactory.createXMLSource(ls, sourcePath); - else if (RML.SQL2008Table.equals(referenceFormulation)) - s = LogicalSourceFactory.createSQL2008TableSource(ls, sourcePath); - else if (RML.SQL2008Query.equals(referenceFormulation)) - s = LogicalSourceFactory.createSQL2008QuerySource(ls, sourcePath); - else if (RML.SPARQL_Results_CSV.equals(referenceFormulation)) - s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, false); - else if (RML.SPARQL_Results_TSV.equals(referenceFormulation)) - s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, true); - else if (RML.SPARQL_Results_XML.equals(referenceFormulation)) - s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, false); - else if (RML.SPARQL_Results_JSON.equals(referenceFormulation)) - s = LogicalSourceFactory.createSPARQLSource(ls, sourcePath, false); - if (referenceFormulation.hasProperty(RDF.type, YS.NetconfQuerySource)) - s = LogicalSourceFactory.createNetconfQuerySource(ls); - - if(s != null) { - s.referenceFormulation = referenceFormulation; - return s; - } - - throw new Exception("Reference formulation not (yet) supported."); - } - - private static String getSourcePath(Resource ls) { - String sourcePath = currentDirectory; - Statement statement = ls.getPropertyResourceValue(RML.source).getProperty(RML.root); - if(statement != null) { - if(statement.getObject().isResource()) { - if(RML.MappingDirectory.equals(statement.getObject())) { - sourcePath = mappingPath; - } else if(RML.CurrentWorkingDirectory.equals(statement.getObject())) { - // ignore, by default sourcePath - } else - throw new RuntimeException("Invalid resource for rml:root " + statement.getObject()); - } else { - Literal l = statement.getLiteral(); - if(l.getLanguage() != null) - throw new RuntimeException("rml:root must be a plain literal or string " + l); - - if(l.getDatatype() != null && XSD.xstring.equals(l.getDatatype())) - throw new RuntimeException("rml:root must be a plain literal or string " + l); - - String path = l.getString(); - if (Paths.get(path).isAbsolute()) - sourcePath = path; - else - throw new RuntimeException("Unsupported path: " + path + ". Is it absolute?"); - } - } - return sourcePath; + return LogicalSourceFactory.create(ls, mappingDirectory, currentDirectory); } - private static LogicalView prepareLogicalView(Resource ls) { + private LogicalView prepareLogicalView(Resource ls) { try { Resource view = ls.getPropertyResourceValue(RML.viewOn); - LogicalView lv = logicalviews.computeIfAbsent(ls, (x) -> new LogicalView()); + LogicalView lv = logicalViews.computeIfAbsent(ls, k -> new LogicalView()); lv.logicalSource = prepareLogicalSource(view); - ls.listProperties(RML.field).forEach(s -> { + ls.listProperties(RML.field).forEachRemaining(s -> { lv.addField(prepareField(s.getObject().asResource())); }); - ls.listProperties(RML.leftJoin).forEach(s -> { + ls.listProperties(RML.leftJoin).forEachRemaining(s -> { lv.addJoin(prepareLeftJoin(s.getObject().asResource())); }); - ls.listProperties(RML.innerJoin).forEach(s -> { + ls.listProperties(RML.innerJoin).forEachRemaining(s -> { lv.addJoin(prepareInnerJoin(s.getObject().asResource())); }); @@ -235,359 +327,458 @@ private static LogicalView prepareLogicalView(Resource ls) { } } - private static ViewJoin prepareLeftJoin(Resource resource) { - return prepareViewJoin(false, resource); + private ViewJoin prepareLeftJoin(Resource resource) { + return prepareViewJoin(JoinType.LEFT, resource); } - private static ViewJoin prepareInnerJoin(Resource resource) { - return prepareViewJoin(true, resource); + private ViewJoin prepareInnerJoin(Resource resource) { + return prepareViewJoin(JoinType.INNER, resource); } - private static ViewJoin prepareViewJoin(boolean isInnerJoin, Resource resource) { + private ViewJoin prepareViewJoin(JoinType joinType, Resource resource) { ViewJoin viewJoin = new ViewJoin(); - viewJoin.isInnerJoin = isInnerJoin; + viewJoin.joinType = joinType; Resource plv = resource.getRequiredProperty(RML.parentLogicalView).getObject().asResource(); viewJoin.parentLogicalView = prepareLogicalView(plv); - resource.listProperties(RML.joinCondition).forEach((s) -> { - JoinCondition jc = new JoinCondition(); + List conditions = new ArrayList<>(); + resource.listProperties(RML.joinCondition).forEachRemaining(s -> conditions.add(prepareJoinCondition(s))); + viewJoin.joinConditions = conditions; - Resource jcr = s.getObject().asResource(); + resource.listProperties(RML.field).forEachRemaining(s -> { + viewJoin.addField(prepareField(s.getObject().asResource())); + }); - Resource r = jcr.getPropertyResourceValue(RML.parentMap); - if(r != null) - jc.parentMap = prepareExpressionMap(r); + return viewJoin; + } - r = jcr.getPropertyResourceValue(RML.childMap); - if(r != null) - jc.childMap = prepareExpressionMap(r); + private SubjectMap prepareSubjectMap(Resource sm) { + SubjectMap subjectMap = new SubjectMap(); + prepareExpression(sm, subjectMap); - viewJoin.joinConditions.add(jc); + sm.listProperties(RML.clazz).forEachRemaining(s -> { + subjectMap.classes.add(s.getObject().asResource()); }); - // We need the fields on the Logical View Join - resource.listProperties(RML.field).forEach(s -> { - viewJoin.addField(prepareField(s.getObject().asResource())); + sm.listProperties(RML.graphMap).forEachRemaining(s -> { + GraphMap gm = prepareGraphMap(s.getObject().asResource()); + subjectMap.graphMaps.add(gm); }); - return viewJoin; + Resource termType = sm.getPropertyResourceValue(RML.termType); + if (termType != null) { + subjectMap.termType = termType; + } else if (hasNoTemplateReferenceConstantOrFunction(sm)) { + subjectMap.termType = RML.BLANKNODE; + } + + Resource gm = sm.getPropertyResourceValue(RML.gather); + if (gm != null) { + subjectMap.gatherMap = prepareGatherMap(sm); + } + + return subjectMap; } - private static SubjectMap prepareSubjectMap(Resource sm) { - SubjectMap subjectMap = new SubjectMap(); - subjectMap.expression = prepareExpression(sm); - - sm.listProperties(RML.clazz).forEach(s -> { - subjectMap.classes.add(s.getObject().asResource()); - }); - - sm.listProperties(RML.graphMap).forEach(s -> { - GraphMap gm = prepareGraphMap(s.getObject().asResource()); - subjectMap.graphMaps.add(gm); - }); - - Resource termType = sm.getPropertyResourceValue(RML.termType); - if(termType != null) - // PROVIDE THE TERM TYPE THAT IS GIVEN - subjectMap.termType = termType; - else if(hasNoTemplateReferenceConstantOrFunction(sm)) { - // IF NO REFERENCE, TEMPLATE, CONSTANT, OR FUNCTION - // THEN WE GENERATE BLANK NODES (BASED ON THE ITERATION) - subjectMap.termType = RML.BLANKNODE; - } - - Resource gm = sm.getPropertyResourceValue(RML.gather); - if(gm != null) { - // This object map has a gather, so we process it as a gather map - subjectMap.gatherMap = prepareGatherMap(sm); - } - - return subjectMap; - } - - private static PredicateObjectMap preparePredicateObjectMap(Resource pom) { - PredicateObjectMap predicateObjectMap = new PredicateObjectMap(); - - pom.listProperties(RML.graphMap).forEach(s -> { - GraphMap gm = prepareGraphMap(s.getObject().asResource()); - predicateObjectMap.graphMaps.add(gm); - }); - - pom.listProperties(RML.predicateMap).forEach((s) -> { - PredicateMap pm = preparePredicateMap(s.getObject().asResource()); - predicateObjectMap.predicateMaps.add(pm); - }); - - pom.listProperties(RML.objectMap).forEach((s) -> { - if(s.getObject().asResource().getProperty(RML.parentTriplesMap) == null) { - ObjectMap om = prepareObjectMap(s.getObject().asResource()); - predicateObjectMap.objectMaps.add(om); - } else { - ReferencingObjectMap rom = prepareReferencingObjectMap(s.getObject().asResource()); - predicateObjectMap.refObjectMaps.add(rom); - } - }); - - return predicateObjectMap; - } - - private static GraphMap prepareGraphMap(Resource r) { - GraphMap gm = new GraphMap(); - - gm.expression = prepareExpression(r); - - Resource termType = r.getPropertyResourceValue(RML.termType); - if(termType != null) - // PROVIDE THE TERM TYPE THAT IS GIVEN - gm.termType = termType; - else if(hasNoTemplateReferenceConstantOrFunction(r)) { - // IF NO REFERENCE, TEMPLATE, CONSTANT, OR FUNCTION - // THEN WE GENERATE BLANK NODES (BASED ON THE ITERATION) - gm.termType = RML.BLANKNODE; - } - - return gm; - } - - private static PredicateMap preparePredicateMap(Resource pm) { - PredicateMap predicateMap = new PredicateMap(); - predicateMap.expression = prepareExpression(pm); - return predicateMap; - } - - private static ObjectMap prepareObjectMap(Resource om) { - ObjectMap objectMap = new ObjectMap(); - objectMap.expression = prepareExpression(om); - - Resource termType = om.getPropertyResourceValue(RML.termType); - if(termType != null) - // PROVIDE THE TERM TYPE THAT IS GIVEN - objectMap.termType = termType; - else if(hasNoTemplateReferenceConstantOrFunction(om)) { - // IF NO REFERENCE, TEMPLATE, CONSTANT, - // OR FUNCTION THEN WE GENERATE BLANK NODES (BASED ON THE ITERATION) - objectMap.termType = RML.BLANKNODE; - } - - Resource lam = om.getPropertyResourceValue(RML.languageMap); - if(lam != null) - objectMap.languageMap = prepareLanguageMap(lam); - - Resource dtm = om.getPropertyResourceValue(RML.datatypeMap); - if(dtm != null) - objectMap.datatypeMap = prepareDatatypeMap(dtm); - - if(termType == null && (lam != null || dtm != null || objectMap.expression instanceof Reference || objectMap.expression instanceof FunctionExecution)) - objectMap.termType = RML.LITERAL; - - Resource gm = om.getPropertyResourceValue(RML.gather); - if(gm != null) { - // This object map has a gather, so we process it as a gather map - objectMap.gatherMap = prepareGatherMap(om); - } - - return objectMap; - } - - private static GatherMapMixin prepareGatherMap(Resource gm) { - GatherMapMixin gatherMap = new GatherMapMixin(); - - if(gm.hasProperty(RML.allowEmptyListAndContainer)) { + private PredicateObjectMap preparePredicateObjectMap(Resource pom) { + PredicateObjectMap predicateObjectMap = new PredicateObjectMap(); + + pom.listProperties(RML.graphMap).forEachRemaining(s -> { + GraphMap gm = prepareGraphMap(s.getObject().asResource()); + predicateObjectMap.graphMaps.add(gm); + }); + + pom.listProperties(RML.predicateMap).forEachRemaining(s -> { + PredicateMap pm = preparePredicateMap(s.getObject().asResource()); + predicateObjectMap.predicateMaps.add(pm); + }); + + pom.listProperties(RML.objectMap).forEachRemaining(s -> { + if (s.getObject().asResource().getProperty(RML.parentTriplesMap) == null) { + ObjectMap om = prepareObjectMap(s.getObject().asResource()); + predicateObjectMap.objectMaps.add(om); + } else { + ReferencingObjectMap rom = prepareReferencingObjectMap(s.getObject().asResource()); + predicateObjectMap.objectMaps.add(rom); + } + }); + + return predicateObjectMap; + } + + private GraphMap prepareGraphMap(Resource r) { + return prepareTermMapMinimal(r, new GraphMap()); + } + + private PredicateMap preparePredicateMap(Resource pm) { + return prepareExpression(pm, new PredicateMap()); + } + + private TM prepareTermMapMinimal(Resource tmRdf, TM tm) { + prepareExpression(tmRdf, tm); + + Resource termType = tmRdf.getPropertyResourceValue(RML.termType); + if (termType != null) { + tm.termType = termType; + } else if (hasNoTemplateReferenceConstantOrFunction(tmRdf)) { + tm.termType = RML.BLANKNODE; + } + + return tm; + } + + private ObjectMap prepareObjectMap(Resource om) { + return prepareTermMapFull(om, new ObjectMap()); + } + + private TM prepareTermMapFull(Resource om, TM termMap) { + TM objectMap = prepareTermMapMinimal(om, termMap); + + Resource lam = om.getPropertyResourceValue(RML.languageMap); + if (lam != null) { + objectMap.languageMap = prepareLanguageMap(lam); + } + + Resource dtm = om.getPropertyResourceValue(RML.datatypeMap); + if (dtm != null) { + objectMap.datatypeMap = prepareDatatypeMap(dtm); + } + + Resource termType = om.getPropertyResourceValue(RML.termType); + if (termType == null && (lam != null || dtm != null || objectMap.getExpression() instanceof Reference || objectMap.getExpression() instanceof FunctionExecution)) { + objectMap.termType = RML.LITERAL; + } + + Resource gm = om.getPropertyResourceValue(RML.gather); + if (gm != null) { + objectMap.gatherMap = prepareGatherMap(om); + } + + return objectMap; + } + + private GatherMap prepareGatherMap(Resource gm) { + GatherMap gatherMap = new GatherMap(); + + if (gm.hasProperty(RML.allowEmptyListAndContainer)) { gatherMap.allowEmptyListAndContainer = gm.getProperty(RML.allowEmptyListAndContainer).getObject().asLiteral().getBoolean(); - } + } - if(gm.hasProperty(RML.gatherAs)) { + if (gm.hasProperty(RML.gatherAs)) { gatherMap.gatherAs = gm.getPropertyResourceValue(RML.gatherAs); - } + } - if(gm.hasProperty(RML.strategy)) { + if (gm.hasProperty(RML.strategy)) { gatherMap.strategy = gm.getPropertyResourceValue(RML.strategy); - } - - RDFList list = gm.getPropertyResourceValue(RML.gather).as(RDFList.class); - ExtendedIterator iter = list.iterator(); - while(iter.hasNext()) { - Resource r = iter.next().asResource(); - - if(r.hasProperty(RML.parentTriplesMap)) { - ReferencingObjectMap rom = prepareReferencingObjectMap(r); - gatherMap.gatherMaps.add(rom); - } else { - ObjectMap om = prepareObjectMap(r); - gatherMap.gatherMaps.add(om); - } - } - - return gatherMap; - } - - private static DatatypeMap prepareDatatypeMap(Resource dtm) { - DatatypeMap x = new DatatypeMap(); - x.expression = prepareExpression(dtm); - return x; - } - - private static LanguageMap prepareLanguageMap(Resource lam) { - LanguageMap x = new LanguageMap(); - x.expression = prepareExpression(lam); - return x; - } - - private static Field prepareField(Resource p) { - Expression e = prepareExpression(p); - Field field = null; - if(e == null) { - // Create IterableField + } + + RDFList list = gm.getPropertyResourceValue(RML.gather).as(RDFList.class); + Iterator iter = list.iterator(); + while (iter.hasNext()) { + Resource r = iter.next().asResource(); + + if (r.hasProperty(RML.parentTriplesMap)) { + ReferencingObjectMap rom = prepareReferencingObjectMap(r); + gatherMap.gatherMaps.add(rom); + } else { + ObjectMap om = prepareObjectMap(r); + gatherMap.gatherMaps.add(om); + } + } + + return gatherMap; + } + + private DatatypeMap prepareDatatypeMap(Resource dtm) { + return prepareExpression(dtm, new DatatypeMap()); + } + + private LanguageMap prepareLanguageMap(Resource lam) { + return prepareExpression(lam, new LanguageMap()); + } + + private Field prepareField(Resource p) { + ExpressionAndOrigin exprAndOrigin = prepareExpression(p); + Field field; + if (exprAndOrigin.expression == null) { IterableField f = new IterableField(); - if(p.hasProperty(RML.iterator)) + if (p.hasProperty(RML.iterator)) { f.iterator = p.getProperty(RML.iterator).getObject().asLiteral().getString(); + } - if(p.hasProperty(RML.referenceFormulation)) - f.referenceFormulation = p.getProperty(RML.referenceFormulation).getObject().asResource(); + if (p.hasProperty(RML.referenceFormulation)) { + Statement stmt = p.getProperty(RML.referenceFormulation); + f.declaredReferenceFormulation = stmt.getObject().asResource(); + f.declaredReferenceFormulationOrigin = new Origin(stmt, Object, null); + } field = f; } else { ExpressionField f = new ExpressionField(); ConcreteExpressionMap fem = new ConcreteExpressionMap(); - fem.expression = prepareExpression(p); + prepareExpression(p, fem); f.fieldExpressionMap = fem; field = f; } field.fieldName = p.getRequiredProperty(RML.fieldName).getObject().asLiteral().getString(); - // Add the subfields Field finalField = field; - p.listProperties(RML.field).forEach(s -> { + p.listProperties(RML.field).forEachRemaining(s -> { finalField.addField(prepareField(s.getObject().asResource())); }); return finalField; } - private static ReferencingObjectMap prepareReferencingObjectMap(Resource rom) { - ReferencingObjectMap referencingObjectMap = new ReferencingObjectMap(); + private JoinCondition prepareJoinCondition(Statement joinConditionStmt) { + JoinCondition jc = new JoinCondition(); + Resource jcr = joinConditionStmt.getObject().asResource(); - Resource p = rom.getPropertyResourceValue(RML.parentTriplesMap); - referencingObjectMap.parent = triplesmaps.computeIfAbsent(p, (x) -> new TriplesMap()); + Resource r = jcr.getPropertyResourceValue(RML.parentMap); + if (r != null) { + jc.parentMap = prepareExpressionMap(r); + } - rom.listProperties(RML.joinCondition).forEach((s) -> { - JoinCondition jc = new JoinCondition(); + r = jcr.getPropertyResourceValue(RML.childMap); + if (r != null) { + jc.childMap = prepareExpressionMap(r); + } + return jc; + } - Resource jcr = s.getObject().asResource(); + private ReferencingObjectMap prepareReferencingObjectMap(Resource rom) { + ReferencingObjectMap referencingObjectMap = new ReferencingObjectMap(); - Resource r = jcr.getPropertyResourceValue(RML.parentMap); - if(r != null) - jc.parentMap = prepareExpressionMap(r); + Resource p = rom.getPropertyResourceValue(RML.parentTriplesMap); + referencingObjectMap.parentTriplesMap = triplesMaps.computeIfAbsent(p, TriplesMap::new); - r = jcr.getPropertyResourceValue(RML.childMap); - if(r != null) - jc.childMap = prepareExpressionMap(r); + List conditions = new ArrayList<>(); + rom.listProperties(RML.joinCondition).forEachRemaining(s -> conditions.add(prepareJoinCondition(s))); + referencingObjectMap.joinConditions = conditions; - referencingObjectMap.joinConditions.add(jc); + rom.listProperties(RML.logicalTarget).forEachRemaining(s -> { + referencingObjectMap.logicalTargets.add(prepareLogicalTarget(s.getResource())); + }); - }); + return referencingObjectMap; + } - return referencingObjectMap; - } + private ConcreteExpressionMap prepareExpressionMap(Resource em) { + return prepareExpression(em, new ConcreteExpressionMap()); + } - private static ConcreteExpressionMap prepareExpressionMap(Resource em) { - ConcreteExpressionMap e = new ConcreteExpressionMap(); - e.expression = prepareExpression(em); - return e; - } + private EM prepareExpression(Resource r, EM em) { + ExpressionAndOrigin exprAndOrigin = prepareExpression(r); + em.setExpression(exprAndOrigin.expression); + em.setExpressionOrigin(exprAndOrigin.origin); - private static Expression prepareExpression(Resource r) { - if (r.hasProperty(RML.constant)) { - RDFNode constant = r.getProperty(RML.constant).getObject(); - return new RDFNodeConstant(constant); - } + r.listProperties(RML.logicalTarget).forEachRemaining(s -> { + em.getLogicalTargets().add(prepareLogicalTarget(s.getResource())); + }); - if (r.hasProperty(RML.reference)) { - String reference = r.getProperty(RML.reference).getObject().asLiteral().getString(); - return new Reference(reference); - } + return em; + } - if (r.hasProperty(RML.template)) { - String template = r.getProperty(RML.template).getObject().asLiteral().getString(); - return new Template(template); - } + private static class ExpressionAndOrigin { + Expression expression; + Origin origin; - if (r.hasProperty(RML.functionExecution)) { - Resource fer = r.getPropertyResourceValue(RML.functionExecution); + ExpressionAndOrigin(Expression e, Origin o) { + this.expression = e; + this.origin = o; + } + } - FunctionExecution fe = new FunctionExecution(); - fe.functionMap = prepareFunctionMap(fer.getPropertyResourceValue(RML.functionMap)); + private ExpressionAndOrigin prepareExpression(Resource r) { + if (r.hasProperty(RML.constant)) { + Statement stmt = r.getProperty(RML.constant); + RDFNode constant = stmt.getObject(); + Term term; + if (constant.isURIResource()) { + term = new IRITerm(constant.asResource().getURI()); + } else if (constant.isLiteral()) { + Literal lit = constant.asLiteral(); + IRITerm dt = lit.getDatatypeURI() != null ? new IRITerm(lit.getDatatypeURI()) : null; + String lang = (lit.getLanguage() != null && !lit.getLanguage().isEmpty()) ? lit.getLanguage() : null; + term = new LiteralTerm(lit.getLexicalForm(), dt, lang); + } else { + term = new BlankNodeTerm(constant.asResource().getId().getLabelString()); + } + Origin origin = new Origin((PlanNode) null, List.of(StatementParts.fromPredicateObject(stmt))); + return new ExpressionAndOrigin(new RDFNodeConstant(term), origin); + } - // Return Maps are siblings of Function Execution Maps - if(r.hasProperty(RML.returnMap)) - fe.returnMap = prepareReturnMap(r.getPropertyResourceValue(RML.returnMap)); + if (r.hasProperty(RML.reference)) { + String reference = r.getProperty(RML.reference).getObject().asLiteral().getString(); + Origin origin = new Origin(r.getProperty(RML.reference), Object, null); + return new ExpressionAndOrigin(new RawReference(reference, origin), origin); + } - StmtIterator iter = fer.listProperties(RML.input); - while(iter.hasNext()) { - Statement x = iter.next(); - fe.inputs.add(prepareInput(x.getObject().asResource())); - } + if (r.hasProperty(RML.template)) { + String template = r.getProperty(RML.template).getObject().asLiteral().getString(); + Origin origin = new Origin(r.getProperty(RML.template), Object, null); + return new ExpressionAndOrigin(new Template(template, r.getProperty(RML.template)), origin); + } - return fe; - } + if (r.hasProperty(RML.functionExecution)) { + FunctionExecution fe = new FunctionExecution(); - return null; - } + Statement feStmt = r.getProperty(RML.functionExecution); + Resource fer = feStmt.getResource(); + fe.callStmt = StatementParts.from(feStmt, Object); - private static Input prepareInput(Resource r) { - Input input = new Input(); + fe.functionMap = prepareFunctionMap(fer.getPropertyResourceValue(RML.functionMap)); + fe.functionMapStmt = StatementParts.fromPredicateObject(fer.getProperty(RML.functionMap)); - ParameterMap pm = new ParameterMap(); - pm.expression = prepareExpression(r.getPropertyResourceValue(RML.parameterMap)); - input.parameterMap = pm; + if (r.hasProperty(RML.returnMap)) { + fe.returnMap = prepareReturnMap(r.getPropertyResourceValue(RML.returnMap)); + fe.returnMapStmt = StatementParts.fromPredicateObject(r.getProperty(RML.returnMap)); + } - input.inputValueMap = prepareInputValueMap(r.getPropertyResourceValue(RML.inputValueMap)); + List inputStmts = fer.listProperties(RML.input).toList(); + for (Statement it : inputStmts) { + fe.inputs.add(prepareInput(it.getResource())); + } + fe.inputsStmt = inputStmts.stream().map(it -> StatementParts.from(it, Object)).toList(); - return input; - } + return new ExpressionAndOrigin(fe, new Origin(feStmt, Object, null)); + } - private static FunctionMap prepareFunctionMap(Resource r) { - FunctionMap fm = new FunctionMap(); - fm.expression = prepareExpression(r); - return fm; - } + return new ExpressionAndOrigin(null, null); + } - private static ReturnMap prepareReturnMap(Resource r) { - ReturnMap rm = new ReturnMap(); - rm.expression = prepareExpression(r); - return rm; - } + private Input prepareInput(Resource r) { + Input input = new Input(); - private static InputValueMap prepareInputValueMap(Resource om) { - InputValueMap im = new InputValueMap(); - im.expression = prepareExpression(om); + ParameterMap pm = prepareExpression(r.getPropertyResourceValue(RML.parameterMap), new ParameterMap()); + input.parameterMap = pm; - Resource termType = om.getPropertyResourceValue(RML.termType); - if(termType != null) - im.termType = termType; + input.inputValueMap = prepareInputValueMap(r.getPropertyResourceValue(RML.inputValueMap)); - Resource lam = om.getPropertyResourceValue(RML.languageMap); - if(lam != null) - im.languageMap = prepareLanguageMap(lam); + return input; + } - Resource dtm = om.getPropertyResourceValue(RML.datatypeMap); - if(dtm != null) - im.datatypeMap = prepareDatatypeMap(dtm); + private FunctionMap prepareFunctionMap(Resource r) { + return prepareExpression(r, new FunctionMap()); + } - if(termType == null && (lam != null || dtm != null || im.expression instanceof Reference || im.expression instanceof FunctionExecution)) - im.termType = RML.LITERAL; + private ReturnMap prepareReturnMap(Resource r) { + ReturnMap rm = new ReturnMap(); + prepareExpression(r, rm); + return rm; + } - return im; - } + private InputValueMap prepareInputValueMap(Resource om) { + return prepareTermMapFull(om, new InputValueMap()); + } - private static boolean hasNoTemplateReferenceConstantOrFunction(Resource r) { - if (r.hasProperty(RML.constant)) return false; - if (r.hasProperty(RML.reference)) return false; - if (r.hasProperty(RML.template)) return false; + private boolean hasNoTemplateReferenceConstantOrFunction(Resource r) { + if (r.hasProperty(RML.constant)) return false; + if (r.hasProperty(RML.reference)) return false; + if (r.hasProperty(RML.template)) return false; return !r.hasProperty(RML.functionExecution); } + public List extractStatementsFromShaclViolation(ReportEntry vr, Model mapping) { + List results = new ArrayList<>(); + + Node focusNode = vr.focusNode(); + org.apache.jena.sparql.path.Path resultPath = vr.resultPath(); + Node value = vr.value(); + + if (focusNode == null) return results; + + boolean isURI = focusNode.isURI(); + boolean isBlank = focusNode.isBlank(); + + if (!isURI && !isBlank) return results; + + Resource focusResource = isURI ? mapping.getResource(focusNode.toString()) : null; + + RDFNode valueNode = null; + if (value != null && value.isConcrete()) { + if (value.isURI()) { + valueNode = mapping.getResource(value.toString()); + } else if (value.isBlank()) { + valueNode = mapping.getResource(value.toString()); + } else if (value.isLiteral()) { + valueNode = mapping.createTypedLiteral(value.getLiteralLexicalForm(), value.getLiteralDatatype()); + } + } + + if (resultPath != null) { + if (resultPath instanceof P_Path0 p0) { + Property predicate = mapping.getProperty(p0.getNode().getURI()); + if (valueNode != null) { + mapping.listStatements(focusResource, predicate, valueNode).forEachRemaining(stmt -> { + results.add(StatementParts.from(stmt, Subject, Predicate, Object)); + }); + } else { + mapping.listStatements(focusResource, predicate, (RDFNode) null).forEachRemaining(stmt -> { + results.add(StatementParts.from(stmt, Subject, Predicate, Object)); + }); + } + } else if (resultPath instanceof P_Path1 p1) { + if (resultPath instanceof P_Inverse pInv) { + org.apache.jena.sparql.path.Path subPath = pInv.getSubPath(); + if (subPath instanceof P_Path0 p0) { + Property predicate = mapping.getProperty(p0.getNode().getURI()); + Resource s = (valueNode != null && valueNode.isResource()) ? valueNode.asResource() : null; + mapping.listStatements(s, predicate, focusResource).forEachRemaining(stmt -> { + results.add(StatementParts.from(stmt, Subject, Predicate, Object)); + }); + } + } + } else if (resultPath instanceof P_Path2) { + // Not handled + } else if (resultPath instanceof P_NegPropSet) { + // Not handled + } + } + + if (results.isEmpty()) { + mapping.listStatements(focusResource, null, valueNode).forEachRemaining(stmt -> { + results.add(StatementParts.from(stmt, Subject)); + }); + + mapping.listStatements(null, null, focusResource).forEachRemaining(stmt -> { + boolean contains = results.stream().anyMatch(it -> it.getStmt().equals(stmt)); + if (!contains) { + results.add(StatementParts.from(stmt, Object)); + } + }); + } + + return results; + } + + private LogicalTarget prepareLogicalTarget(Resource r) { + if (logicalTargets.containsKey(r)) return logicalTargets.get(r); + + Statement targetStmt = r.getProperty(RML.target); + if (targetStmt == null) + throw new BurpException(new RmlError("LogicalTarget has no target", null, RER.MappingError, null)); + + Resource targetRes = targetStmt.getResource(); + RMLTarget target; + if (targetRes.hasProperty(RML.path)) { + String path = targetRes.getProperty(RML.path).getObject().asLiteral().getString(); + Resource root = targetRes.getPropertyResourceValue(RML.root); + if (root == null) root = RML.CurrentWorkingDirectory; + target = new FilePathTarget(path, root); + } else { + throw new BurpException(new RmlError("Unsupported target type", new Origin(targetStmt, Predicate, Object), RER.MappingError, null)); + } + + Resource serialization = r.getPropertyResourceValue(RML.serialization); + Resource compression = r.getPropertyResourceValue(RML.compression); + Resource encoding = r.getPropertyResourceValue(RML.encoding); + + LogicalTarget lt = new LogicalTarget(target, serialization, compression, encoding); + logicalTargets.put(r, lt); + return lt; + } } diff --git a/src/main/java/burp/parse/PlanWiring.java b/src/main/java/burp/parse/PlanWiring.java new file mode 100644 index 0000000..9ca5e8d --- /dev/null +++ b/src/main/java/burp/parse/PlanWiring.java @@ -0,0 +1,63 @@ +package burp.parse; + +import burp.model.*; + +import java.util.List; +import java.util.stream.Collectors; + +public class PlanWiring { + public static void wire(MappingDocument document) { + // 1. Wire parent-children tree + wireParentChildren(document); + + // 2. Optimize mapping order + // TODO: merge the optimization from dev-mode branch + + // 3. Rewire parent-children tree + wireParentChildren(document); + + // 4. Wire dependencies + // wireDependencies(document); + + // 5. Compile References + compileReferences(document); + } + + private static void wireParentChildren(PlanNode node) { + node.children().forEach(child -> { + child.setParent(node); + wireParentChildren(child); + }); + } + + private static void wireDependencies(PlanNode node) { + node.getDependents().clear(); + + node.descendants(PlanNode.class).forEach(descendant -> descendant.getDependents().clear()); + + wireDependenciesRecursive(node); + } + + private static void wireDependenciesRecursive(PlanNode node) { + node.dependencies().forEach(dependency -> dependency.getDependents().add(node)); + + if (node instanceof Expression) { + TriplesMap triplesMap = node.ancestor(TriplesMap.class); + if (triplesMap != null) { + AbstractLogicalSource logicalSource = triplesMap.logicalSource; + if (logicalSource != null) { + logicalSource.getDependents().add(node); + } + } + } + + node.children().forEach(PlanWiring::wireDependenciesRecursive); + } + + private static void compileReferences(PlanNode node) { + List holders = node.descendants(ReferenceHolder.class).collect(Collectors.toList()); + for (ReferenceHolder holder : holders) { + holder.compileReferences(); + } + } +} diff --git a/src/main/java/burp/parse/turtleprov/NodeInfo.java b/src/main/java/burp/parse/turtleprov/NodeInfo.java new file mode 100644 index 0000000..8464590 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/NodeInfo.java @@ -0,0 +1,70 @@ +package burp.parse.turtleprov; + +import org.antlr.v4.runtime.Token; +import java.util.Objects; + +public final class NodeInfo { + public final TurtleNodeKind kind; + public final Point start; + public final Point end; + public final Point rdfLiteralStringStart; + public final Point rdfLiteralStringEnd; + public final String blankNodeId; + + public NodeInfo(TurtleNodeKind kind, Point start, Point end, Point rdfLiteralStringStart, Point rdfLiteralStringEnd, String blankNodeId) { + this.kind = kind; + this.start = start; + this.end = end; + this.rdfLiteralStringStart = rdfLiteralStringStart; + this.rdfLiteralStringEnd = rdfLiteralStringEnd; + this.blankNodeId = blankNodeId; + } + + public NodeInfo(TurtleNodeKind kind, Point start, Point end, String blankNodeId) { + this(kind, start, end, null, null, blankNodeId); + } + + public NodeInfo(TurtleNodeKind kind, Token start, Token end, String blankNodeId) { + this(kind, + start != null ? new Point(start.getLine() - 1, start.getCharPositionInLine()) : null, + end != null ? new Point(end.getLine() - 1, end.getCharPositionInLine()) : null, + blankNodeId); + } + + public TurtleNodeKind kind() { return kind; } + public Point start() { return start; } + public Point end() { return end; } + public Point rdfLiteralStringStart() { return rdfLiteralStringStart; } + public Point rdfLiteralStringEnd() { return rdfLiteralStringEnd; } + public String blankNodeId() { return blankNodeId; } + + public int[] lineIndexRange() { + return new int[]{start.line, end.line}; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof NodeInfo)) return false; + NodeInfo nodeInfo = (NodeInfo) o; + return kind == nodeInfo.kind && + Objects.equals(start, nodeInfo.start) && + Objects.equals(end, nodeInfo.end) && + Objects.equals(rdfLiteralStringStart, nodeInfo.rdfLiteralStringStart) && + Objects.equals(rdfLiteralStringEnd, nodeInfo.rdfLiteralStringEnd) && + Objects.equals(blankNodeId, nodeInfo.blankNodeId); + } + + @Override + public int hashCode() { + return Objects.hash(kind, start, end, rdfLiteralStringStart, rdfLiteralStringEnd, blankNodeId); + } + + @Override + public String toString() { + return "NodeInfo[kind=" + kind + ", start=" + start + ", end=" + end + + ", rdfLiteralStringStart=" + rdfLiteralStringStart + + ", rdfLiteralStringEnd=" + rdfLiteralStringEnd + + ", blankNodeId=" + blankNodeId + "]"; + } +} diff --git a/src/main/java/burp/parse/turtleprov/Point.java b/src/main/java/burp/parse/turtleprov/Point.java new file mode 100644 index 0000000..e719797 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/Point.java @@ -0,0 +1,71 @@ +package burp.parse.turtleprov; + +import java.util.Objects; + +public final class Point implements Comparable { + public final int line; + public final int column; + + public Point(int line, int column) { + this.line = line; + this.column = column; + } + + public int line() { return line; } + public int column() { return column; } + + public int getDisplayLine() { return line + 1; } + public int getDisplayColumn() { return column + 1; } + + @Override + public int compareTo(Point other) { + int lineCompare = Integer.compare(this.line, other.line); + return lineCompare != 0 ? lineCompare : Integer.compare(this.column, other.column); + } + + public Point plus(Point other) { + return new Point(this.line + other.line, this.column + other.column); + } + + public Point minus(Point point) { + int newLine = this.line - point.line; + int newColumn = this.column - point.column; + return (newLine >= 0 && newColumn >= 0) ? new Point(newLine, newColumn) : null; + } + + public static Point zero() { + return new Point(0, 0); + } + + public static Point fromOffset(String text, int offset) { + int l = 0; + int c = 0; + for (int i = 0; i < offset; i++) { + if (text.charAt(i) == '\n') { + l++; + c = 0; + } else { + c++; + } + } + return new Point(l, c); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Point)) return false; + Point point = (Point) o; + return line == point.line && column == point.column; + } + + @Override + public int hashCode() { + return Objects.hash(line, column); + } + + @Override + public String toString() { + return "Point[line=" + line + ", column=" + column + "]"; + } +} diff --git a/src/main/java/burp/parse/turtleprov/ProvStore.java b/src/main/java/burp/parse/turtleprov/ProvStore.java new file mode 100644 index 0000000..6b7d89d --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/ProvStore.java @@ -0,0 +1,40 @@ +package burp.parse.turtleprov; + +import java.util.*; + +public class ProvStore { + public final Set triples = new HashSet<>(); + public final Map prefixes = new HashMap<>(); + public final List syntaxErrors = new ArrayList<>(); + + public Set getTriples() { + return triples; + } + + public Map getPrefixes() { + return prefixes; + } + + public List getSyntaxErrors() { + return syntaxErrors; + } + + public static class SyntaxError { + public final int line; + public final int charPositionInLine; + public final String message; + public final String offendingSymbol; + + public SyntaxError(int line, int charPositionInLine, String message, String offendingSymbol) { + this.line = line; + this.charPositionInLine = charPositionInLine; + this.message = message; + this.offendingSymbol = offendingSymbol; + } + + @Override + public String toString() { + return "line " + line + ":" + charPositionInLine + " " + message; + } + } +} diff --git a/src/main/java/burp/parse/turtleprov/ProvTriple.java b/src/main/java/burp/parse/turtleprov/ProvTriple.java new file mode 100644 index 0000000..a10878b --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/ProvTriple.java @@ -0,0 +1,49 @@ +package burp.parse.turtleprov; + +import org.apache.jena.rdf.model.Statement; +import java.util.Objects; + +public final class ProvTriple { + public final Statement statement; + public final NodeInfo subjectInfo; + public final NodeInfo predicateInfo; + public final NodeInfo objectInfo; + + public ProvTriple(Statement statement, NodeInfo subjectInfo, NodeInfo predicateInfo, NodeInfo objectInfo) { + this.statement = statement; + this.subjectInfo = subjectInfo; + this.predicateInfo = predicateInfo; + this.objectInfo = objectInfo; + } + + public ProvTriple(Statement statement) { + this(statement, null, null, null); + } + + public Statement statement() { return statement; } + public NodeInfo subjectInfo() { return subjectInfo; } + public NodeInfo predicateInfo() { return predicateInfo; } + public NodeInfo objectInfo() { return objectInfo; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof ProvTriple)) return false; + ProvTriple that = (ProvTriple) o; + return Objects.equals(statement, that.statement) && + Objects.equals(subjectInfo, that.subjectInfo) && + Objects.equals(predicateInfo, that.predicateInfo) && + Objects.equals(objectInfo, that.objectInfo); + } + + @Override + public int hashCode() { + return Objects.hash(statement, subjectInfo, predicateInfo, objectInfo); + } + + @Override + public String toString() { + return "ProvTriple[statement=" + statement + ", subjectInfo=" + subjectInfo + + ", predicateInfo=" + predicateInfo + ", objectInfo=" + objectInfo + "]"; + } +} diff --git a/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java new file mode 100644 index 0000000..0bc9843 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java @@ -0,0 +1,441 @@ +package burp.parse.turtleprov; + +import burp.parse.turtleprov.generated.TurtleBaseVisitor; +import burp.parse.turtleprov.generated.TurtleParser; +import burp.reporting.PointRange; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.tree.TerminalNode; +import org.apache.jena.rdf.model.*; +import org.apache.jena.vocabulary.RDF; + +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ProvTurtleVisitor extends TurtleBaseVisitor { + public static List retrieveTurtleLocation(Object o) { return Collections.emptyList(); } + private final ProvStore store = new ProvStore(); + + public ProvStore getStore() { + return store; + } + private final Model model = ModelFactory.createDefaultModel(); + private final Map blankNodeMap = new HashMap<>(); + + private Resource createBlankNode() { + return createBlankNode(null); + } + + private Resource createBlankNode(String id) { + return model.createResource(id != null ? new AnonId(id) : new AnonId()); + } + + private static final Pattern prefixedNamePattern = Pattern.compile("^(.*?):(.*)$"); + private static final Pattern blankNodeLabelPattern = Pattern.compile("^_:(.+)$"); + + private Point getStartPoint(Token token) { + if (token == null) return null; + return new Point(token.getLine() - 1, token.getCharPositionInLine()); + } + + private Point getEndPoint(Token token) { + if (token == null) return null; + String text = token.getText(); + if (text == null) return getStartPoint(token); + int newLines = 0; + int lastLineIdx = -1; + for (int i = 0; i < text.length(); i++) { + if (text.charAt(i) == '\n') { + newLines++; + lastLineIdx = i; + } + } + int endLine = token.getLine() - 1 + newLines; + int endCol = newLines == 0 ? token.getCharPositionInLine() + text.length() : text.length() - lastLineIdx - 1; + return new Point(endLine, endCol); + } + + @Override + protected Object defaultResult() { + return null; + } + + @Override + public ProvStore visitTurtleDoc(TurtleParser.TurtleDocContext ctx) { + for (TurtleParser.StatementContext stmt : ctx.statement()) { + visit(stmt); + } + return store; + } + + @Override + public Object visitStatement(TurtleParser.StatementContext ctx) { + TurtleParser.DirectiveContext directive = ctx.directive(); + if (directive != null) { + return visitDirective(directive); + } + TurtleParser.TriplesContext triples = ctx.triples(); + if (triples != null) { + return visit(triples); + } + return null; + } + + public Object makeRegisterPrefix(TerminalNode prefix, TerminalNode iriref, boolean isSparql) { + String prefixText = prefix.getText(); + String prefixNs = prefixText.substring(0, prefixText.length() - 1); + String iriText = iriref.getText(); + String iri = iriText.substring(1, iriText.length() - 1); + store.getPrefixes().put(prefixNs, iri); + return null; + } + + @Override + public Object visitPrefixID(TurtleParser.PrefixIDContext ctx) { + return makeRegisterPrefix(ctx.PNAME_NS(), ctx.IRIREF(), false); + } + + @Override + public Object visitSparqlPrefix(TurtleParser.SparqlPrefixContext ctx) { + return makeRegisterPrefix(ctx.PNAME_NS(), ctx.IRIREF(), false); + } + + @Override + public Object visitBase(TurtleParser.BaseContext ctx) { + return null; + } + + @Override + public Object visitSparqlBase(TurtleParser.SparqlBaseContext ctx) { + return null; + } + + @Override + @SuppressWarnings("unchecked") + public Object visitTriples(TurtleParser.TriplesContext ctx) { + TurtleParser.SubjectContext subjectCtx = ctx.subject(); + TurtleParser.PredicateObjectListContext predicateObjectListCtx = ctx.predicateObjectList(); + TurtleParser.BlankNodePropertyListContext blankNodePropertyListCtx = ctx.blankNodePropertyList(); + + if (subjectCtx != null && predicateObjectListCtx != null) { + Pair subject = (Pair) visitSubject(subjectCtx); + visitPredicateObjectList(predicateObjectListCtx, subject); + } else if (blankNodePropertyListCtx != null) { + Pair blankNode = (Pair) visitBlankNodePropertyList(blankNodePropertyListCtx); + if (predicateObjectListCtx != null) { + visitPredicateObjectList(predicateObjectListCtx, blankNode); + } + } + return null; + } + + @Override + public Object visitSubject(TurtleParser.SubjectContext ctx) { + if (ctx.iri() != null) return visitIri(ctx.iri()); + if (ctx.BlankNode() != null) return visitBlankNodeTerminal(ctx.BlankNode()); + if (ctx.collection() != null) return visitCollection(ctx.collection()); + throw new IllegalArgumentException("Unknown subject type"); + } + + @Override + public Object visitIri(TurtleParser.IriContext ctx) { + TerminalNode irirefCtx = ctx.IRIREF(); + TerminalNode prefixedNameCtx = ctx.PrefixedName(); + + if (irirefCtx != null) { + Token token = irirefCtx.getSymbol(); + String iriText = token.getText(); + String iri = iriText.substring(1, iriText.length() - 1); + Resource resource = ResourceFactory.createResource(iri); + NodeInfo nodeInfo = new NodeInfo( + TurtleNodeKind.IRIREF, + getStartPoint(token), + getEndPoint(token), + null + ); + return new Pair<>(resource, nodeInfo); + } else if (prefixedNameCtx != null) { + Token token = prefixedNameCtx.getSymbol(); + String prefixedName = token.getText() != null ? token.getText() : ""; + Matcher match = prefixedNamePattern.matcher(prefixedName); + + if (match.matches()) { + String prefix = match.group(1) != null ? match.group(1) : ""; + String localName = match.group(2); + String namespace = store.getPrefixes().get(prefix); + if (namespace == null) throw new IllegalArgumentException("Unknown prefix: " + prefix); + Resource resource = ResourceFactory.createResource(namespace + localName); + NodeInfo nodeInfo = new NodeInfo(TurtleNodeKind.PREFIXED_NAME, getStartPoint(token), getEndPoint(token), null); + return new Pair<>(resource, nodeInfo); + } else { + throw new IllegalArgumentException("Invalid prefixed name: " + prefixedName); + } + } else { + throw new IllegalArgumentException("Unknown IRI type"); + } + } + + private Pair visitBlankNodeTerminal(TerminalNode terminalNode) { + Token token = terminalNode.getSymbol(); + String text = token.getText() != null ? token.getText() : ""; + + if (text.startsWith("_:")) { + Matcher matcher = blankNodeLabelPattern.matcher(text); + if (matcher.matches()) { + String label = matcher.group(1); + Resource resource = blankNodeMap.computeIfAbsent(label, this::createBlankNode); + NodeInfo nodeInfo = new NodeInfo( + TurtleNodeKind.BLANK_NODE_LABEL, + getStartPoint(token), getEndPoint(token), label + ); + return new Pair<>(resource, nodeInfo); + } else { + throw new IllegalArgumentException("Invalid blank node label: " + text); + } + } else if (text.startsWith("[") && text.endsWith("]")) { + Resource resource = createBlankNode(); + NodeInfo nodeInfo = new NodeInfo( + TurtleNodeKind.ANONYMOUS_BLANK_NODE, + getStartPoint(token), getEndPoint(token), null + ); + return new Pair<>(resource, nodeInfo); + } else { + throw new IllegalArgumentException("Unknown blank node format: " + text); + } + } + + public Resource assembleList(List list) { + if (list.isEmpty()) { + return (Resource) RDF.nil; + } else { + List blankNodes = new ArrayList<>(list.size()); + for (int i = 0; i < list.size(); i++) { + blankNodes.add(createBlankNode()); + } + for (int i = 0; i < list.size(); i++) { + Resource node = blankNodes.get(i); + RDFNode value = list.get(i); + store.getTriples().add(new ProvTriple(model.createStatement(node, RDF.first, value))); + store.getTriples().add(new ProvTriple(model.createStatement(node, RDF.type, RDF.List))); + } + for (int i = 0; i < blankNodes.size() - 1; i++) { + Resource current = blankNodes.get(i); + Resource next = blankNodes.get(i + 1); + store.getTriples().add(new ProvTriple(model.createStatement(current, RDF.rest, next))); + } + store.getTriples().add(new ProvTriple(model.createStatement(blankNodes.get(blankNodes.size() - 1), RDF.rest, (Resource) RDF.nil))); + return blankNodes.get(0); + } + } + + @Override + @SuppressWarnings("unchecked") + public Object visitCollection(TurtleParser.CollectionContext ctx) { + List items = new ArrayList<>(); + for (TurtleParser.Object_Context objCtx : ctx.object_()) { + Pair p = (Pair) visitObject_(objCtx); + items.add(p.first()); + } + Resource collectionStart = assembleList(items); + NodeInfo nodeInfo = new NodeInfo( + TurtleNodeKind.COLLECTION, + getStartPoint(ctx.start), getEndPoint(ctx.stop), null + ); + + return new Pair<>(collectionStart, nodeInfo); + } + + @Override + public Object visitBlankNodePropertyList(TurtleParser.BlankNodePropertyListContext ctx) { + Resource resource = createBlankNode(); + NodeInfo nodeInfo = new NodeInfo( + TurtleNodeKind.BLANK_NODE_PROPERTY_LIST, + getStartPoint(ctx.start), getEndPoint(ctx.stop), null + ); + + Pair subject = new Pair<>(resource, nodeInfo); + if (ctx.predicateObjectList() != null) { + visitPredicateObjectList(ctx.predicateObjectList(), subject); + } + + return subject; + } + + @SuppressWarnings("unchecked") + private void visitPredicateObjectList( + TurtleParser.PredicateObjectListContext ctx, + Pair subject + ) { + List verbs = ctx.verb(); + List objectLists = ctx.objectList(); + + for (int i = 0; i < verbs.size(); i++) { + Pair predicate = (Pair) visitVerb(verbs.get(i)); + List> objects = (List>) visitObjectList(objectLists.get(i)); + + for (Pair obj : objects) { + Statement stmt = model.createStatement(subject.first(), predicate.first(), obj.first()); + store.getTriples().add(new ProvTriple(stmt, subject.second(), predicate.second(), obj.second())); + } + } + } + + @Override + @SuppressWarnings("unchecked") + public Object visitVerb(TurtleParser.VerbContext ctx) { + if (ctx.iri() != null) { + Pair iriPair = (Pair) visitIri(ctx.iri()); + Property property = model.createProperty(iriPair.first().getURI()); + return new Pair<>(property, iriPair.second()); + } else if ("a".equals(ctx.getText())) { + NodeInfo nodeInfo = new NodeInfo( + TurtleNodeKind.TYPE_VERB, + getStartPoint(ctx.start), getEndPoint(ctx.stop), null + ); + return new Pair<>(RDF.type, nodeInfo); + } else { + throw new IllegalArgumentException("Unknown verb type: " + ctx.getText()); + } + } + + @Override + @SuppressWarnings("unchecked") + public Object visitObjectList(TurtleParser.ObjectListContext ctx) { + List> result = new ArrayList<>(); + for (TurtleParser.Object_Context objCtx : ctx.object_()) { + result.add((Pair) visitObject_(objCtx)); + } + return result; + } + + @Override + @SuppressWarnings("unchecked") + public Object visitObject_(TurtleParser.Object_Context ctx) { + if (ctx.iri() != null) return visitIri(ctx.iri()); + if (ctx.BlankNode() != null) return visitBlankNodeTerminal(ctx.BlankNode()); + if (ctx.collection() != null) return visitCollection(ctx.collection()); + if (ctx.blankNodePropertyList() != null) return visitBlankNodePropertyList(ctx.blankNodePropertyList()); + if (ctx.literal() != null) return visitLiteral(ctx.literal()); + if (ctx.tripleTerm() != null) throw new UnsupportedOperationException("RDF-star / RDF 1.2 triple terms are not supported"); + if (ctx.reifiedTriple() != null) throw new UnsupportedOperationException("RDF-star / RDF 1.2 reified triples are not supported"); + throw new IllegalArgumentException("Unknown object type: " + ctx.getText()); + } + + @Override + public Object visitLiteral(TurtleParser.LiteralContext ctx) { + if (ctx.rdfLiteral() != null) return visitRdfLiteral(ctx.rdfLiteral()); + if (ctx.NumericLiteral() != null) return visitNumericLiteral(ctx.NumericLiteral()); + if (ctx.BooleanLiteral() != null) return visitBooleanLiteral(ctx.BooleanLiteral()); + throw new IllegalArgumentException("Unknown literal type"); + } + + @Override + @SuppressWarnings("unchecked") + public Object visitRdfLiteral(TurtleParser.RdfLiteralContext ctx) { + Pair stringInfo = (Pair) visitString(ctx.string()); + String stringValue = stringInfo.first(); + int quoteSize = stringInfo.second(); + + TerminalNode langDirCtx = ctx.LANG_DIR(); + TurtleParser.IriContext iriCtx = ctx.iri(); + Literal literal; + + if (langDirCtx != null) { + String langTag = langDirCtx.getText().substring(1); // Remove @ + literal = model.createLiteral(stringValue, langTag); + } else if (iriCtx != null) { + Resource datatype = ((Pair) visitIri(iriCtx)).first(); + literal = model.createTypedLiteral(stringValue, datatype.getURI()); + } else { + literal = model.createTypedLiteral(stringValue); + } + + TurtleNodeKind kind; + TerminalNode firstChild = (TerminalNode) ctx.string().getChild(0); + int symbolType = firstChild.getSymbol().getType(); + + if (symbolType == TurtleParser.STRING_LITERAL_QUOTE) { + kind = TurtleNodeKind.STRING_LITERAL_QUOTE; + } else if (symbolType == TurtleParser.STRING_LITERAL_SINGLE_QUOTE) { + kind = TurtleNodeKind.STRING_LITERAL_SINGLE_QUOTE; + } else if (symbolType == TurtleParser.STRING_LITERAL_LONG_QUOTE) { + kind = TurtleNodeKind.STRING_LITERAL_LONG_QUOTE; + } else if (symbolType == TurtleParser.STRING_LITERAL_LONG_SINGLE_QUOTE) { + kind = TurtleNodeKind.STRING_LITERAL_LONG_SINGLE_QUOTE; + } else { + kind = TurtleNodeKind.STRING_LITERAL_QUOTE; + } + + Point startPoint = getStartPoint(ctx.start); + Point endPoint = getEndPoint(ctx.stop); + + Point rdfStart = null; + if (ctx.string().start != null) { + rdfStart = getStartPoint(ctx.string().start).plus(new Point(0, quoteSize)); + } + Point rdfEnd = null; + if (ctx.string().stop != null) { + Point stopEnd = getEndPoint(ctx.string().stop); + if (stopEnd != null) { + rdfEnd = stopEnd.minus(new Point(0, quoteSize)); + } + } + + NodeInfo nodeInfo = new NodeInfo( + kind, + startPoint, + endPoint, + rdfStart, + rdfEnd, + null + ); + return new Pair<>(literal, nodeInfo); + } + + @Override + public Object visitString(TurtleParser.StringContext ctx) { + String text = ctx.getText(); + if (text.startsWith("\"\"\"") && text.endsWith("\"\"\"")) { + return new Pair<>(text.substring(3, text.length() - 3), 3); + } else if (text.startsWith("'''") && text.endsWith("'''")) { + return new Pair<>(text.substring(3, text.length() - 3), 3); + } else if (text.startsWith("\"") && text.endsWith("\"")) { + return new Pair<>(text.substring(1, text.length() - 1), 1); + } else if (text.startsWith("'") && text.endsWith("'")) { + return new Pair<>(text.substring(1, text.length() - 1), 1); + } else { + return new Pair<>(text, 0); + } + } + + private Pair visitNumericLiteral(TerminalNode terminalNode) { + Token token = terminalNode.getSymbol(); + String text = token.getText() != null ? token.getText() : ""; + + Literal literal; + TurtleNodeKind kind; + + if (text.contains("e") || text.contains("E")) { + literal = model.createTypedLiteral(Double.parseDouble(text)); + kind = TurtleNodeKind.DOUBLE_LITERAL; + } else if (text.contains(".")) { + literal = model.createTypedLiteral(Double.parseDouble(text)); // TODO add decimal + kind = TurtleNodeKind.DECIMAL_LITERAL; + } else { + literal = model.createTypedLiteral(Integer.parseInt(text)); + kind = TurtleNodeKind.INTEGER_LITERAL; + } + + return new Pair<>(literal, new NodeInfo(kind, getStartPoint(token), getEndPoint(token), null)); + } + + private Pair visitBooleanLiteral(TerminalNode terminalNode) { + Token token = terminalNode.getSymbol(); + String text = token.getText(); + Literal literal = model.createTypedLiteral(Boolean.parseBoolean(text)); + NodeInfo nodeInfo = new NodeInfo(TurtleNodeKind.BOOLEAN_LITERAL, getStartPoint(token), getEndPoint(token), null); + return new Pair<>(literal, nodeInfo); + } + + public record Pair(A first, B second) {} +} diff --git a/src/main/java/burp/parse/turtleprov/RDF12Converter.java b/src/main/java/burp/parse/turtleprov/RDF12Converter.java new file mode 100644 index 0000000..0c82876 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/RDF12Converter.java @@ -0,0 +1,168 @@ +package burp.parse.turtleprov; + +import burp.vocabularies.BURP; +import org.apache.jena.rdf.model.*; +import org.apache.jena.vocabulary.RDF; + +import java.util.Arrays; +import java.util.List; + +public class RDF12Converter { + + private static int nextBlankId = 0; + + private static Resource nextReifierId(Model model) { + return model.createResource(new AnonId("reifier_" + (nextBlankId++))); + } + + public static Model toModel(ProvStore store) { + return toModel(store, true); + } + + public static Model toModel(ProvStore store, boolean withAnnotations) { + Model model = ModelFactory.createDefaultModel(); + + for (ProvTriple provQuad : store.getTriples()) { + Statement quad = provQuad.statement(); + model.add(quad); + + if (withAnnotations) { + if (provQuad.subjectInfo() != null) { + addNodeAnnotations(model, quad, BURP.SUBJECT, provQuad.subjectInfo()); + } + if (provQuad.predicateInfo() != null) { + addNodeAnnotations(model, quad, BURP.PREDICATE, provQuad.predicateInfo()); + } + if (provQuad.objectInfo() != null) { + addNodeAnnotations(model, quad, BURP.OBJECT, provQuad.objectInfo()); + } + } + } + + return model; + } + + private static void addNodeAnnotations(Model model, Statement mainQuad, Resource kindProperty, NodeInfo nodeInfo) { + Resource reifier = nextReifierId(model); + model.add(reifier, RDF.reifies, model.createStatementTerm(mainQuad)); + model.add(reifier, RDF.type, kindProperty); + + if (nodeInfo.kind() != null) { + model.add(reifier, BURP.TOKEN, model.createResource(nodeInfo.kind().getUri())); + } + + addPoint(model, reifier, BURP.START_LINE, BURP.START_COLUMN, nodeInfo.start()); + addPoint(model, reifier, BURP.END_LINE, BURP.END_COLUMN, nodeInfo.end()); + + addPoint(model, reifier, BURP.STRING_START_LINE, BURP.STRING_START_COLUMN, nodeInfo.rdfLiteralStringStart()); + addPoint(model, reifier, BURP.STRING_END_LINE, BURP.STRING_END_COLUMN, nodeInfo.rdfLiteralStringEnd()); + + if (nodeInfo.blankNodeId() != null) { + model.add(reifier, BURP.BLANK_NODE_ID, nodeInfo.blankNodeId()); + } + } + + private static void addPoint(Model model, Resource reifier, Property lineProp, Property colProp, Point pt) { + if (pt != null) { + model.add(reifier, lineProp, model.createTypedLiteral(pt.line())); + model.add(reifier, colProp, model.createTypedLiteral(pt.column())); + } + } + + public static class TripleInfo { + public final NodeInfo subjectInfo; + public final NodeInfo predicateInfo; + public final NodeInfo objectInfo; + + public TripleInfo(NodeInfo subjectInfo, NodeInfo predicateInfo, NodeInfo objectInfo) { + this.subjectInfo = subjectInfo; + this.predicateInfo = predicateInfo; + this.objectInfo = objectInfo; + } + + public List toList() { + return Arrays.asList(subjectInfo, predicateInfo, objectInfo); + } + } + + public static TripleInfo fromAnnotations(Statement targetTriple, Model model) { + RDFNode stmtTerm = model.createStatementTerm(targetTriple); + ResIterator reifiers = model.listSubjectsWithProperty(RDF.reifies, stmtTerm); + + NodeInfo subjInfo = null; + NodeInfo predInfo = null; + NodeInfo objInfo = null; + + while (reifiers.hasNext()) { + Resource reifier = reifiers.nextResource(); + Resource typeRes = reifier.getPropertyResourceValue(RDF.type); + NodeInfo info = extractNodeInfo(reifier); + + if (typeRes != null) { + String uri = typeRes.getURI(); + if (BURP.SUBJECT.getURI().equals(uri)) { + subjInfo = info; + } else if (BURP.PREDICATE.getURI().equals(uri)) { + predInfo = info; + } else if (BURP.OBJECT.getURI().equals(uri)) { + objInfo = info; + } + } + } + return new TripleInfo(subjInfo, predInfo, objInfo); + } + + private static NodeInfo extractNodeInfo(Resource reifier) { + String tokenUri = uriProp(reifier, BURP.TOKEN); + + TurtleNodeKind kind = null; + for (TurtleNodeKind k : TurtleNodeKind.values()) { + if (k.getUri().equals(tokenUri)) { + kind = k; + break; + } + } + + return new NodeInfo( + kind, + point(reifier, BURP.START_LINE, BURP.START_COLUMN), + point(reifier, BURP.END_LINE, BURP.END_COLUMN), + point(reifier, BURP.STRING_START_LINE, BURP.STRING_START_COLUMN), + point(reifier, BURP.STRING_END_LINE, BURP.STRING_END_COLUMN), + stringProp(reifier, BURP.BLANK_NODE_ID) + ); + } + + private static Integer intProp(Resource reifier, Property p) { + Statement stmt = reifier.getProperty(p); + if (stmt != null && stmt.getObject().isLiteral()) { + return stmt.getObject().asLiteral().getInt(); + } + return null; + } + + private static String stringProp(Resource reifier, Property p) { + Statement stmt = reifier.getProperty(p); + if (stmt != null && stmt.getObject().isLiteral()) { + return stmt.getObject().asLiteral().getString(); + } + return null; + } + + private static String uriProp(Resource reifier, Property p) { + Statement stmt = reifier.getProperty(p); + if (stmt != null && stmt.getObject().isResource()) { + return stmt.getObject().asResource().getURI(); + } + return null; + } + + private static Point point(Resource reifier, Property lineProp, Property colProp) { + Integer lineVal = intProp(reifier, lineProp); + Integer colVal = intProp(reifier, colProp); + if (lineVal != null && colVal != null) { + return new Point(lineVal, colVal); + } + return null; + } +} diff --git a/src/main/java/burp/parse/turtleprov/TurtleNodeKind.java b/src/main/java/burp/parse/turtleprov/TurtleNodeKind.java new file mode 100644 index 0000000..67bb5ae --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/TurtleNodeKind.java @@ -0,0 +1,33 @@ +package burp.parse.turtleprov; + +import burp.vocabularies.BURP; + +public enum TurtleNodeKind { + IRIREF(BURP.base_uri + "IRIREF"), + PREFIXED_NAME(BURP.base_uri + "PrefixedName"), + BLANK_NODE_LABEL(BURP.base_uri + "BlankNodeLabel"), + ANONYMOUS_BLANK_NODE(BURP.base_uri + "AnonymousBlankNode"), + BLANK_NODE_PROPERTY_LIST(BURP.base_uri + "BlankNodePropertyList"), + COLLECTION(BURP.base_uri + "Collection"), + STRING_LITERAL_QUOTE(BURP.base_uri + "StringLiteralQuote"), + STRING_LITERAL_SINGLE_QUOTE(BURP.base_uri + "StringLiteralSingleQuote"), + STRING_LITERAL_LONG_QUOTE(BURP.base_uri + "StringLiteralLongQuote"), + STRING_LITERAL_LONG_SINGLE_QUOTE(BURP.base_uri + "StringLiteralLongSingleQuote"), + INTEGER_LITERAL(BURP.base_uri + "IntegerLiteral"), + DECIMAL_LITERAL(BURP.base_uri + "DecimalLiteral"), + DOUBLE_LITERAL(BURP.base_uri + "DoubleLiteral"), + BOOLEAN_LITERAL(BURP.base_uri + "BooleanLiteral"), + TYPE_VERB(BURP.base_uri + "TypeVerb"), + REIFIED_TRIPLE(BURP.base_uri + "ReifiedTriple"), + TRIPLE_TERM(BURP.base_uri + "TripleTerm"); + + private final String uri; + + TurtleNodeKind(String uri) { + this.uri = uri; + } + + public String getUri() { + return uri; + } +} diff --git a/src/main/java/burp/reporting/BurpException.java b/src/main/java/burp/reporting/BurpException.java new file mode 100644 index 0000000..bbcd859 --- /dev/null +++ b/src/main/java/burp/reporting/BurpException.java @@ -0,0 +1,14 @@ +package burp.reporting; + +public class BurpException extends RuntimeException { + private final RmlError error; + + public BurpException(RmlError error) { + super(error.getMessage()); + this.error = error; + } + + public RmlError getError() { + return error; + } +} diff --git a/src/main/java/burp/reporting/Errors.java b/src/main/java/burp/reporting/Errors.java new file mode 100644 index 0000000..d4c0a53 --- /dev/null +++ b/src/main/java/burp/reporting/Errors.java @@ -0,0 +1,64 @@ +package burp.reporting; + +import burp.model.PlanNode; +import burp.vocabularies.RER; +import org.apache.jena.ontology.OntClass; + +import java.nio.file.Path; +import java.util.function.Consumer; + +public class Errors { + + public static String fileLocationString(Path file, PointRange location) { + String locationStr = ""; + if (location != null) { + String start = location.getStart().getDisplayLine() + ":" + location.getStart().getDisplayColumn(); + String end = null; + if (location.getEnd() != null) { + end = location.getEnd().getDisplayLine() + ":" + location.getEnd().getDisplayColumn(); + } + locationStr = (end != null) ? start + "-" + end : start; + } + + return !locationStr.isEmpty() ? file.toString() + ":" + locationStr : file.toString(); + } + + public static RmlError rmlError(OntClass errorType, Consumer init) { + RmlErrorBuilder builder = new RmlErrorBuilder(errorType); + init.accept(builder); + return builder.build(); + } + + public static RmlError SourceAccessError(String message, Origin info, Exception ex) { + return new RmlError(message, info, RER.SourceAccessError, ex); + } + + public static RmlError InvalidRDF(String message, Origin info, OntClass type) { + return new RmlError(message, info, type); + } + + public static RmlError ReferenceFormulationSyntaxError(String message, Origin info) { + return new RmlError(message, info, RER.ReferenceFormulationSyntaxError); + } + + public static RmlError ReferenceFormulationExecutionError(String message, PlanNode planNode) { + return new RmlError(message, new Origin(planNode, null), RER.ReferenceFormulationExecutionError); + } + + public static RmlError RDFMappingSyntaxError(String message, Origin info) { + return new RmlError(message, info, RER.RDFMappingSyntaxError); + } + + public static RmlError UnsupportedMapping(String message, Origin info) { + return new RmlError(message, info, RER.UnsupportedMapping); + } + + public static RmlError NoTriplesMap() { + return new RmlError("No triples map (with rml:logicalSource) found in mapping.", new Origin(), RER.NoTriplesMap); + } + + public static RmlError UnexpectedError(Exception ex) { + String msg = ex.getMessage() != null ? ex.getMessage() : "Unexpected error look at stack trace."; + return new RmlError(msg, null, RER.Error, ex); + } +} diff --git a/src/main/java/burp/reporting/LiteralPart.java b/src/main/java/burp/reporting/LiteralPart.java new file mode 100644 index 0000000..d153a77 --- /dev/null +++ b/src/main/java/burp/reporting/LiteralPart.java @@ -0,0 +1,25 @@ +package burp.reporting; + +import org.apache.jena.rdf.model.Statement; + +public class LiteralPart implements RDFGraphPointer { + private final Statement stmt; + private final PointRange objectRange; + + public LiteralPart(Statement stmt, PointRange objectRange) { + if (!stmt.getObject().isLiteral()) { + throw new IllegalArgumentException("Statement object is not a literal: " + stmt); + } + this.stmt = stmt; + this.objectRange = objectRange; + } + + @Override + public Statement getStmt() { + return stmt; + } + + public PointRange getObjectRange() { + return objectRange; + } +} diff --git a/src/main/java/burp/reporting/Origin.java b/src/main/java/burp/reporting/Origin.java new file mode 100644 index 0000000..80c1567 --- /dev/null +++ b/src/main/java/burp/reporting/Origin.java @@ -0,0 +1,22 @@ +package burp.reporting; + +import burp.model.PlanNode; +import org.apache.jena.rdf.model.Statement; + +import java.util.Collections; +import java.util.List; + +public record Origin(PlanNode planNode, List sourceStatements) { + + public Origin() { + this((PlanNode) null, null); + } + + public Origin(Statement stmt, StatementPart... stmtParts) { + this(null, Collections.singletonList(StatementParts.from(stmt, stmtParts))); + } + + public Origin(PlanNode planNode, Statement stmt, StatementPart... stmtParts) { + this(planNode, Collections.singletonList(StatementParts.from(stmt, stmtParts))); + } +} diff --git a/src/main/java/burp/reporting/PointRange.java b/src/main/java/burp/reporting/PointRange.java new file mode 100644 index 0000000..d876122 --- /dev/null +++ b/src/main/java/burp/reporting/PointRange.java @@ -0,0 +1,35 @@ +package burp.reporting; + + + +import burp.parse.turtleprov.Point; +public class PointRange { + private final Point start; + private final Point end; + + public PointRange(Point start, Point end) { + this.start = start; + this.end = end; + } + + public PointRange(Point start) { + this(start, null); + } + + public Point getStart() { + return start; + } + + public Point getEnd() { + return end; + } + + public PointRange plus(PointRange other) { + Point end1 = this.end != null ? this.end : Point.zero(); + Point end2 = other.end != null ? other.end : Point.zero(); + return new PointRange( + this.start.plus(other.start), + end1.plus(end2) + ); + } +} diff --git a/src/main/java/burp/reporting/RDFGraphPointer.java b/src/main/java/burp/reporting/RDFGraphPointer.java new file mode 100644 index 0000000..96c1042 --- /dev/null +++ b/src/main/java/burp/reporting/RDFGraphPointer.java @@ -0,0 +1,7 @@ +package burp.reporting; + +import org.apache.jena.rdf.model.Statement; + +public interface RDFGraphPointer extends RDFPointer { + Statement getStmt(); +} diff --git a/src/main/java/burp/reporting/RDFPointer.java b/src/main/java/burp/reporting/RDFPointer.java new file mode 100644 index 0000000..26f3946 --- /dev/null +++ b/src/main/java/burp/reporting/RDFPointer.java @@ -0,0 +1,4 @@ +package burp.reporting; + +public interface RDFPointer { +} diff --git a/src/main/java/burp/reporting/RmlError.java b/src/main/java/burp/reporting/RmlError.java new file mode 100644 index 0000000..17d352f --- /dev/null +++ b/src/main/java/burp/reporting/RmlError.java @@ -0,0 +1,56 @@ +package burp.reporting; + +import org.apache.jena.ontology.OntClass; +import org.apache.jena.rdf.model.Property; + +import java.util.Collections; +import java.util.Map; + +public class RmlError { + private final String message; + private final Origin origin; + private final OntClass errorType; + private final Exception exception; + private final Map context; + + public RmlError(String message, Origin origin, OntClass errorType, Exception exception, Map context) { + this.message = message; + this.origin = origin; + this.errorType = errorType; + this.exception = exception; + this.context = context != null ? context : Collections.emptyMap(); + } + + public RmlError(String message, Origin origin, OntClass errorType) { + this(message, origin, errorType, null, Collections.emptyMap()); + } + + public RmlError(String message, Origin origin, OntClass errorType, Exception exception) { + this(message, origin, errorType, exception, Collections.emptyMap()); + } + + public String getMessage() { + return message; + } + + public Origin getOrigin() { + return origin; + } + + public OntClass getErrorType() { + return errorType; + } + + public Exception getException() { + return exception; + } + + public Map getContext() { + return context; + } + + @Override + public String toString() { + return "RmlError(message=\"" + message + "\", origin=" + origin + ", errorType=" + errorType + ", exception=" + exception + ")"; + } +} diff --git a/src/main/java/burp/reporting/RmlErrorBuilder.java b/src/main/java/burp/reporting/RmlErrorBuilder.java new file mode 100644 index 0000000..2291c54 --- /dev/null +++ b/src/main/java/burp/reporting/RmlErrorBuilder.java @@ -0,0 +1,55 @@ +package burp.reporting; + +import burp.vocabularies.RER; +import org.apache.jena.ontology.OntClass; +import org.apache.jena.ontology.OntProperty; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RmlErrorBuilder { + private final OntClass errorType; + private String message = ""; + private Origin origin = null; + private Exception exception = null; + private final Map context = new HashMap<>(); + + public RmlErrorBuilder(OntClass errorType) { + this.errorType = errorType; + } + + public void setMessage(String message) { + this.message = message; + } + + public void setOrigin(Origin origin) { + this.origin = origin; + } + + public void setException(Exception exception) { + this.exception = exception; + } + + public void reference(String ref) { + context.put(RER.reference, ref); + } + + public void referenceFormulation(Resource refForm) { + context.put(RER.referenceFormulation, refForm); + } + + public void allowedTermTypes(List termTypes) { + context.put(RER.allowedTermTypes, termTypes); + } + + public void withContext(OntProperty property, Object value) { + context.put(property, value); + } + + public RmlError build() { + return new RmlError(message, origin, errorType, exception, context); + } +} diff --git a/src/main/java/burp/reporting/RmlExecutionReport.java b/src/main/java/burp/reporting/RmlExecutionReport.java new file mode 100644 index 0000000..d68b739 --- /dev/null +++ b/src/main/java/burp/reporting/RmlExecutionReport.java @@ -0,0 +1,42 @@ +package burp.reporting; + +import burp.model.MappingDocument; +import java.util.ArrayList; +import java.util.List; + +public class RmlExecutionReport { + private final List errors; + private MappingDocument executionPlan; + private final Statistics statistics; + + public RmlExecutionReport(List errors, MappingDocument executionPlan, Statistics statistics) { + this.errors = errors != null ? errors : new ArrayList<>(); + this.executionPlan = executionPlan; + this.statistics = statistics != null ? statistics : new Statistics(); + } + + public RmlExecutionReport() { + this(new ArrayList<>(), null, new Statistics()); + } + + public List getErrors() { + return errors; + } + + public MappingDocument getExecutionPlan() { + return executionPlan; + } + + public void setExecutionPlan(MappingDocument executionPlan) { + this.executionPlan = executionPlan; + } + + public Statistics getStatistics() { + return statistics; + } + + @Override + public String toString() { + return "RmlExecutionReport(errors=" + errors + ", executionPlan=" + (executionPlan != null ? "MappingDocument" : "null") + ", statistics=" + statistics + ")"; + } +} diff --git a/src/main/java/burp/reporting/StatementPart.java b/src/main/java/burp/reporting/StatementPart.java new file mode 100644 index 0000000..587a15b --- /dev/null +++ b/src/main/java/burp/reporting/StatementPart.java @@ -0,0 +1,5 @@ +package burp.reporting; + +public enum StatementPart { + Subject, Predicate, Object +} diff --git a/src/main/java/burp/reporting/StatementParts.java b/src/main/java/burp/reporting/StatementParts.java new file mode 100644 index 0000000..9b5af54 --- /dev/null +++ b/src/main/java/burp/reporting/StatementParts.java @@ -0,0 +1,50 @@ +package burp.reporting; + +import org.apache.jena.rdf.model.Statement; + +public class StatementParts implements RDFGraphPointer { + private final Statement stmt; + private final boolean subject; + private final boolean predicate; + private final boolean object; + + public StatementParts(Statement stmt, boolean subject, boolean predicate, boolean object) { + this.stmt = stmt; + this.subject = subject; + this.predicate = predicate; + this.object = object; + } + + @Override + public Statement getStmt() { + return stmt; + } + + public boolean isSubject() { + return subject; + } + + public boolean isPredicate() { + return predicate; + } + + public boolean isObject() { + return object; + } + + public static StatementParts from(Statement stmt, StatementPart... parts) { + boolean subj = false; + boolean pred = false; + boolean obj = false; + for (StatementPart part : parts) { + if (part == StatementPart.Subject) subj = true; + if (part == StatementPart.Predicate) pred = true; + if (part == StatementPart.Object) obj = true; + } + return new StatementParts(stmt, subj, pred, obj); + } + + public static StatementParts fromPredicateObject(Statement stmt) { + return new StatementParts(stmt, false, true, true); + } +} diff --git a/src/main/java/burp/reporting/Statistics.java b/src/main/java/burp/reporting/Statistics.java new file mode 100644 index 0000000..d773d4b --- /dev/null +++ b/src/main/java/burp/reporting/Statistics.java @@ -0,0 +1,40 @@ +package burp.reporting; + +import burp.model.TriplesMap; +import java.util.Collections; +import java.util.Map; + +public class Statistics { + private Map generatedStatementPerTriplesMap; + private long generatedStatements; + + public Statistics(Map generatedStatementPerTriplesMap, long generatedStatements) { + this.generatedStatementPerTriplesMap = generatedStatementPerTriplesMap != null ? generatedStatementPerTriplesMap : Collections.emptyMap(); + this.generatedStatements = generatedStatements; + } + + public Statistics() { + this(Collections.emptyMap(), 0); + } + + public Map getGeneratedStatementPerTriplesMap() { + return generatedStatementPerTriplesMap; + } + + public void setGeneratedStatementPerTriplesMap(Map generatedStatementPerTriplesMap) { + this.generatedStatementPerTriplesMap = generatedStatementPerTriplesMap; + } + + public long getGeneratedStatements() { + return generatedStatements; + } + + public void setGeneratedStatements(long generatedStatements) { + this.generatedStatements = generatedStatements; + } + + @Override + public String toString() { + return "Statistics(generatedStatementPerTriplesMap=" + generatedStatementPerTriplesMap + ", generatedStatements=" + generatedStatements + ")"; + } +} diff --git a/src/main/java/burp/reporting/TextFilePointer.java b/src/main/java/burp/reporting/TextFilePointer.java new file mode 100644 index 0000000..6974dad --- /dev/null +++ b/src/main/java/burp/reporting/TextFilePointer.java @@ -0,0 +1,5 @@ +package burp.reporting; + +public class TextFilePointer implements RDFPointer { + +} diff --git a/src/main/java/burp/util/BURPConfiguration.java b/src/main/java/burp/util/BURPConfiguration.java index de82616..7708b21 100644 --- a/src/main/java/burp/util/BURPConfiguration.java +++ b/src/main/java/burp/util/BURPConfiguration.java @@ -1,39 +1,49 @@ package burp.util; -import picocli.CommandLine; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFLanguages; +import org.jspecify.annotations.NonNull; import picocli.CommandLine.Command; import picocli.CommandLine.Option; -@Command(name = "burp") +import java.util.Arrays; +import java.util.Iterator; + +@Command(name = "burp", mixinStandardHelpOptions = true, description = "A Basic and Unassuming RML Processor (BURP)") public class BURPConfiguration { - @Option(names = {"-h", "--help" }, usageHelp = true, description = "Display a help message") - public boolean help = false; - - @Option(names= {"-m", "--mappingFile"}, description = "The RML mapping file", required = true) - public String mappingFile = null; - - @Option(names= {"-o", "--outputFile"}, description = "The output file", required = false) - public String outputFile = null; - - @Option(names = {"-b", "--baseIRI"}, description = "Used in resolving relative IRIs produced by the RML mapping" ) - public String baseIRI = null; - - public BURPConfiguration(String[] args) throws Exception { - try { - BURPConfiguration conf = CommandLine.populateCommand(this, args); - if(conf.help) { - new CommandLine(this).usage(System.out); - System.exit(0); - } - - if(conf.mappingFile == null) { - throw new Exception("An RML mapping file is mandatory."); - } - } catch (CommandLine.ParameterException pe) { - System.out.println(pe.getMessage()); - new CommandLine(this).usage(System.out); - throw pe; - } - } + @Option(names = {"-m", "--mappingFile"}, required = true, description = "The RML mapping file") + public String mappingFile; + + @Option(names = {"-o", "--outputFile"}, description = "The output file") + public String outputFile; + + @Option(names = {"-f", "--outputFormat"}, + description = "The format of the output file (default: deduced from output file)", + completionCandidates = FormatCandidates.class) + public String outputFormatString; + + public Lang getOutputFormat() { + if (outputFormatString == null) return null; + Lang lang = RDFLanguages.nameToLang(outputFormatString); + if (lang == null) throw new IllegalArgumentException("Unknown output format: " + outputFormatString); + return lang; + } + + @Option(names = {"-b", "--baseIRI"}, description = "Used in resolving relative IRIs produced by the RML mapping", + defaultValue = "http://example.org/") + public String baseIRI = "http://example.org/"; + + @Option(names = {"-r", "--reportFile"}, description = "The report file") + public String reportFile; + + static class FormatCandidates implements Iterable { + @Override + public @NonNull Iterator iterator() { + return Arrays.asList( + RDFLanguages.strLangNQuads, RDFLanguages.strLangTurtle, RDFLanguages.strLangTriG, + RDFLanguages.strLangJSONLD, RDFLanguages.strLangRDFXML + ).iterator(); + } + } } \ No newline at end of file diff --git a/src/main/java/burp/util/Util.java b/src/main/java/burp/util/Util.java index 4dae658..8210a9e 100644 --- a/src/main/java/burp/util/Util.java +++ b/src/main/java/burp/util/Util.java @@ -1,194 +1,231 @@ package burp.util; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; +import burp.reporting.BurpException; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; +import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; +import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; +import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; +import org.apache.commons.compress.compressors.xz.XZCompressorInputStream; +import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream; +import org.apache.commons.io.IOUtils; +import org.apache.jena.atlas.io.OutputUtils; +import org.apache.jena.iri.IRI; +import org.apache.jena.iri.IRIFactory; +import org.apache.jena.iri.Violation; +import org.apache.jena.iri.ViolationCodes; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rfc3986.Chars3986; + +import java.io.*; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.Iterator; +import java.util.Locale; +import java.util.Map; +import java.util.function.Consumer; +import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; -import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; -import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; -import org.apache.commons.compress.compressors.xz.XZCompressorInputStream; -import org.apache.commons.io.IOUtils; -import org.apache.jena.iri.IRIFactory; -import org.apache.jena.iri.Violation; -import org.apache.jena.rdf.model.Resource; +public final class Util { -import burp.vocabularies.RML; + public static String toIRISafe(String string) { + StringBuilder sb = new StringBuilder(); + for (char c : string.toCharArray()) { + if (Chars3986.iunreserved(c)) sb.append(c); + else sb.append('%').append(Integer.toHexString(c).toUpperCase(Locale.getDefault())); + } + return sb.toString(); + } + + public static String toURISafe(String string) { + StringBuilder sb = new StringBuilder(); + byte[] bytes = string.getBytes(StandardCharsets.UTF_8); + for (byte b : bytes) { + char c = (char) (b & 0xFF); + if (Chars3986.unreserved(c)) { + sb.append(c); + } else { + sb.append("%"); + OutputUtils.printHex(sb, b & 0xFF, 2); + } + } + return sb.toString(); + } -public class Util { - - /** - * Translate a string into its IRI safe value as per R2RML's steps - * - * @param string - * @return - */ - public static String toIRISafe(String string) { - // The IRI-safe version of a string is obtained by applying the following - // transformation to any character that is not in the iunreserved - // production in [RFC3987]. - StringBuffer sb = new StringBuffer(); - for(char c : string.toCharArray()) { - if(inIUNRESERVED(c)) sb.append(c); - else sb.append('%' + Integer.toHexString((int) c).toUpperCase()); - } - return sb.toString(); - } - - /** - * Check whether the characters are part of iunreserved as per - * https://tools.ietf.org/html/rfc3987#section-2.2 - */ - private static boolean inIUNRESERVED(char c) { - if("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".indexOf(c) != -1) return true; - else if (c >= 160 && c <= 55295) return true; - else if (c >= 63744 && c <= 64975) return true; - else if (c >= 65008 && c <= 65519) return true; - else if (c >= 65536 && c <= 131069) return true; - else if (c >= 131072 && c <= 196605) return true; - else if (c >= 196608 && c <= 262141) return true; - else if (c >= 262144 && c <= 327677) return true; - else if (c >= 327680 && c <= 393213) return true; - else if (c >= 393216 && c <= 458749) return true; - else if (c >= 458752 && c <= 524285) return true; - else if (c >= 524288 && c <= 589821) return true; - else if (c >= 589824 && c <= 655357) return true; - else if (c >= 655360 && c <= 720893) return true; - else if (c >= 720896 && c <= 786429) return true; - else if (c >= 786432 && c <= 851965) return true; - else if (c >= 851968 && c <= 917501) return true; - else if (c >= 921600 && c <= 983037) return true; - return false; - } - - /** - * Converts a byte array into a Hex string - * Code based on https://www.programiz.com/java-programming/examples/convert-byte-array-hexadecimal - */ private final static char[] hexArray = "0123456789ABCDEF".toCharArray(); - public static String bytesToHexString(byte[] o) { - byte[] bytes = (byte[]) o; - char[] hexChars = new char[bytes.length * 2]; + + public static String bytesToHexString(byte[] bytes) { + if (bytes == null) return null; + char[] hexChars = new char[bytes.length * 2]; for (int j = 0; j < bytes.length; j++) { int v = bytes[j] & 0xFF; hexChars[j * 2] = hexArray[v >>> 4]; hexChars[j * 2 + 1] = hexArray[v & 0x0F]; } return new String(hexChars); - } + } - public static boolean isAbsoluteAndValidIRI(String string) { - //return isAbsolute(string) && !IRIFactory.iriImplementation().create(string).hasViolation(false); - if(isAbsolute(string)) { - Iterator iter = IRIFactory.iriImplementation().create(string).violations(false); - while(iter.hasNext()) { - Violation v = iter.next(); - // TODO: We ignore CAPS in HOST for test cases, but we shouldn't - if(v.getViolationCode() == 11); - else - return false; + public static boolean isValidAndAbsoluteIRI(String string) { + return isValidAndAbsolute(string, IRIFactory.iriImplementation()); + } + + public static boolean isValidAndAbsoluteURI(String string) { + return isValidAndAbsolute(string, IRIFactory.uriImplementation()); + } + + private static boolean isValidAndAbsolute(String string, IRIFactory factory) { + IRI iri = factory.create(string); + Iterator violations = iri.violations(false); + boolean hasViolations = false; + while (violations.hasNext()) { + Violation violation = violations.next(); + if (violation.getViolationCode() != ViolationCodes.LOWERCASE_PREFERRED) { + hasViolations = true; + break; } - return true; } - return false; + return !hasViolations && iri.getScheme() != null && !iri.getScheme().trim().isEmpty(); + } + + public static boolean isAbsoluteAndValidIRI(String string) { + return isValidAndAbsoluteIRI(string); } public static boolean isAbsoluteAndValidURI(String string) { - //return isAbsolute(string) && !IRIFactory.iriImplementation().create(string).hasViolation(false); - if(isAbsolute(string)) { - Iterator iter = IRIFactory.iriImplementation().create(string).violations(false); - while(iter.hasNext()) { - Violation v = iter.next(); - // TODO: We ignore CAPS in HOST for test cases, but we shouldn't - if(v.getViolationCode() == 11); - else - return false; - } + return isValidAndAbsoluteURI(string); + } - try { - URI uri = new URI(string); - } catch (Exception e) { - return false; - } + public static boolean isAbsolute(String string) { + return URI.create(string.toLowerCase()).isAbsolute(); + } - return true; + public static String downloadFile(String url) { + try { + String temp = Files.createTempFile(null, ".download.tmp").toString(); + + HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url)).GET().build(); + HttpResponse response = HttpClient + .newBuilder() + .followRedirects(HttpClient.Redirect.ALWAYS) + .build() + .send(request, HttpResponse.BodyHandlers.ofInputStream()); + FileOutputStream output = new FileOutputStream(temp); + output.write(response.body().readAllBytes()); + output.close(); + + return temp; + } catch (Exception e) { + throw new RuntimeException("Problem downloading " + url); } - return false; } - - public static boolean isAbsolute(String string) { - return URI.create(string.toLowerCase()).isAbsolute(); - } - - public static String downloadFile(String url) { - try { - String temp = Files.createTempFile(null, ".download.tmp").toString(); - - HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url)).GET().build(); - HttpResponse response = HttpClient - .newBuilder() - .followRedirects(HttpClient.Redirect.ALWAYS) - .build() - .send(request, HttpResponse.BodyHandlers.ofInputStream()); - FileOutputStream output = new FileOutputStream(temp); - output.write(response.body().readAllBytes()); - output.close(); - - return temp; - } catch(Exception e) { - throw new RuntimeException("Problem downloading " + url); - } - } - - public static String getDecompressedFile(String file, Resource compression) { - try { - if(RML.none.equals(compression)) - return file; - - String temp = Files.createTempFile(null, ".extracted.tmp").toString(); - - OutputStream out = new FileOutputStream(temp); - FileInputStream fin = new FileInputStream(file); - InputStream in = null; - - if(RML.zip.equals(compression)) { - ZipInputStream a = new ZipInputStream(fin); - a.getNextEntry(); - in = a; - } else if(RML.gzip.equals(compression)) { - in = new GzipCompressorInputStream(fin); - } else if(RML.targz.equals(compression)) { - // Suppress warning because we do close it - @SuppressWarnings("resource") - TarArchiveInputStream a = new TarArchiveInputStream(new GzipCompressorInputStream(fin)); - a.getNextEntry(); - in = a; - } else if(RML.tarxz.equals(compression)) { - // Suppress warning because we do close it - @SuppressWarnings("resource") - TarArchiveInputStream a = new TarArchiveInputStream(new XZCompressorInputStream(fin)); - a.getNextEntry(); - in = a; - } - - IOUtils.copy(in, out); - in.close(); - out.close(); - + + public static String getDecompressedFile(String file, Resource compression) { + try { + if (RML.none.equals(compression)) + return file; + + String temp = Files.createTempFile(null, ".extracted.tmp").toString(); + + OutputStream out = new FileOutputStream(temp); + FileInputStream fin = new FileInputStream(file); + InputStream in = null; + + if (RML.zip.equals(compression)) { + ZipInputStream a = new ZipInputStream(fin); + a.getNextEntry(); + in = a; + } else if (RML.gzip.equals(compression)) { + in = new GzipCompressorInputStream(fin); + } else if (RML.targz.equals(compression)) { // FIXME Ontology specifies targzip not targz. + TarArchiveInputStream a = new TarArchiveInputStream(new GzipCompressorInputStream(fin)); + a.getNextEntry(); + in = a; + } else if (RML.tarxz.equals(compression)) { + TarArchiveInputStream a = new TarArchiveInputStream(new XZCompressorInputStream(fin)); + a.getNextEntry(); + in = a; + } else { + throw new BurpException(new RmlError("Compression format not supported " + compression, null, RER.SourceAccessError, null, Map.of(RML.compression, compression, RML.path, file))); + } + + IOUtils.copy(in, out); + in.close(); + out.close(); + return temp; - } catch (Exception e) { - System.err.println(compression); - throw new RuntimeException("Error decompressing file"); - } - - } - + } catch (Exception e) { + System.err.println(compression); + throw new RuntimeException("Error decompressing file"); + } + } + + private static void writeTarEntry(File file, TarArchiveOutputStream tos, String[] suffixes, Consumer writeAction) throws IOException { + String entryName = file.getName(); + for (String suffix : suffixes) { + if (entryName.endsWith(suffix)) { + entryName = entryName.substring(0, entryName.length() - suffix.length()); + } + } + TarArchiveEntry entry = new TarArchiveEntry(entryName); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + writeAction.accept(baos); + byte[] bytes = baos.toByteArray(); + + entry.setSize(bytes.length); + tos.putArchiveEntry(entry); + tos.write(bytes); + tos.closeArchiveEntry(); + } + + public static void writeCompressedFile(File file, Resource compression, Consumer writeAction) { + try { + if (compression == null || RML.none.equals(compression)) { + try (FileOutputStream out = new FileOutputStream(file)) { + writeAction.accept(out); + } + return; + } + + try (FileOutputStream fos = new FileOutputStream(file)) { + if (RML.zip.equals(compression)) { + try (ZipOutputStream zos = new ZipOutputStream(fos)) { + String entryName = file.getName(); + if (entryName.endsWith(".zip")) entryName = entryName.substring(0, entryName.length() - 4); + zos.putNextEntry(new ZipEntry(entryName)); + writeAction.accept(zos); + zos.closeEntry(); + } + } else if (RML.gzip.equals(compression)) { + try (GzipCompressorOutputStream gos = new GzipCompressorOutputStream(fos)) { + writeAction.accept(gos); + } + } else if (RML.targz.equals(compression)) { + try (GzipCompressorOutputStream gos = new GzipCompressorOutputStream(fos); + TarArchiveOutputStream tos = new TarArchiveOutputStream(gos)) { + writeTarEntry(file, tos, new String[]{".tar.gz", ".tgz"}, writeAction); + } + } else if (RML.tarxz.equals(compression)) { + try (XZCompressorOutputStream xos = new XZCompressorOutputStream(fos); + TarArchiveOutputStream tos = new TarArchiveOutputStream(xos)) { + writeTarEntry(file, tos, new String[]{".tar.xz"}, writeAction); + } + } else { + throw new RuntimeException("Provided compression " + compression + " not supported."); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } } \ No newline at end of file diff --git a/src/main/java/burp/vocabularies/BURP.java b/src/main/java/burp/vocabularies/BURP.java new file mode 100644 index 0000000..898b5d5 --- /dev/null +++ b/src/main/java/burp/vocabularies/BURP.java @@ -0,0 +1,43 @@ +package burp.vocabularies; + +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.ResourceFactory; + +public class BURP { + public static final String NS = "http://BURP.noname/"; + public static final String base_uri = NS; + + private static Property property(String local) { + return ResourceFactory.createProperty(NS + local); + } + private static Resource resource(String local) { + return ResourceFactory.createResource(NS + local); + } + + public static final Property list = property("list"); + public static final Property noEmpty = property("noEmpty"); + + public static final Resource LogicalView = resource("LogicalView"); + public static final Resource CollectionOrContainer = resource("CollectionOrContainer"); + + public static final Property TOKEN = property("token"); + public static final Property FILE_ID = property("file"); + public static final Property START_LINE = property("startLine"); + public static final Property START_COLUMN = property("startColumn"); + public static final Property END_LINE = property("endLine"); + public static final Property END_COLUMN = property("endColumn"); + + public static final Property STRING_START_LINE = property("startLine"); + public static final Property STRING_START_COLUMN = property("startColumn"); + public static final Property STRING_END_LINE = property("endLine"); + public static final Property STRING_END_COLUMN = property("endColumn"); + + public static final Property BLANK_NODE_ID = property("blankNodeId"); + + public static final Resource SUBJECT = resource("SubjectProv"); + public static final Resource PREDICATE = resource("PredicateProv"); + public static final Resource OBJECT = resource("ObjectProv"); + + public static final Resource TestTurtleAnnotation = resource("TestTurtleAnnotation"); +} diff --git a/src/main/java/burp/vocabularies/RML.java b/src/main/java/burp/vocabularies/RML.java index c4d77e6..5295b37 100644 --- a/src/main/java/burp/vocabularies/RML.java +++ b/src/main/java/burp/vocabularies/RML.java @@ -12,6 +12,7 @@ public final class RML { public static final Resource BLANKNODE = ResourceFactory.createResource(NS + "BlankNode"); public static final Resource IRI = ResourceFactory.createResource(NS + "IRI"); public static final Resource URI = ResourceFactory.createResource(NS + "URI"); + public static final Resource UnsafeIRI = ResourceFactory.createResource(NS + "UnsafeIRI"); public static final Resource LITERAL = ResourceFactory.createResource(NS + "Literal"); // RML Constants @@ -22,6 +23,7 @@ public final class RML { public static final Resource CurrentWorkingDirectory = ResourceFactory.createResource(NS + "CurrentWorkingDirectory"); public static final Resource Namespace = ResourceFactory.createResource(NS + "Namespace"); public static final Resource RelativePathSource = ResourceFactory.createResource(NS + "RelativePathSource"); + public static final Resource FilePath = ResourceFactory.createResource(NS + "FilePath"); public static final Resource SQL2008Table = ResourceFactory.createResource(NS + "SQL2008Table"); public static final Resource SQL2008Query = ResourceFactory.createResource(NS + "SQL2008Query"); public static final Resource XPath = ResourceFactory.createResource(NS + "XPath"); @@ -45,7 +47,7 @@ public final class RML { public static final Resource SPARQL_Results_XML = ResourceFactory.createResource(FORMATSNS + "SPARQL_Results_XML"); // Classes - // We currently have no need for classes and that limits the memory footprint + // We currently have no need for classes // Properties public static final Property allowEmptyListAndContainer = ResourceFactory.createProperty(NS + "allowEmptyListAndContainer"); @@ -67,10 +69,13 @@ public final class RML { public static final Property input = ResourceFactory.createProperty(NS + "input"); public static final Property inputValueMap = ResourceFactory.createProperty(NS + "inputValueMap"); public static final Property iterator = ResourceFactory.createProperty(NS + "iterator"); + public static final Property logicalSource = ResourceFactory.createProperty(NS + "logicalSource"); + public static final Property logicalTarget = ResourceFactory.createProperty(NS + "logicalTarget"); + public static final Property target = ResourceFactory.createProperty(NS + "target"); public static final Property joinCondition = ResourceFactory.createProperty(NS + "joinCondition"); public static final Property leftJoin = ResourceFactory.createProperty(NS + "leftJoin"); public static final Property languageMap = ResourceFactory.createProperty(NS + "languageMap"); - public static final Property logicalSource = ResourceFactory.createProperty(NS + "logicalSource"); + public static final Property serialization = ResourceFactory.createProperty(NS + "serialization"); public static final Property namespace = ResourceFactory.createProperty(NS + "namespace"); public static final Property namespacePrefix = ResourceFactory.createProperty(NS + "namespacePrefix"); public static final Property namespaceURL = ResourceFactory.createProperty(NS + "namespaceURL"); diff --git a/src/test/java/burp/TestBURP.java b/src/test/java/burp/TestBURP.java new file mode 100644 index 0000000..9a4ae09 --- /dev/null +++ b/src/test/java/burp/TestBURP.java @@ -0,0 +1,8 @@ +package burp; + +public class TestBURP extends TestRMLModule { + @Override + public String getBase() { + return "./src/test/resources/burp/"; + } +} diff --git a/src/test/java/burp/TestData.java b/src/test/java/burp/TestData.java index 78a36c9..eaffc3e 100644 --- a/src/test/java/burp/TestData.java +++ b/src/test/java/burp/TestData.java @@ -1,5 +1,7 @@ package burp; +import java.util.Map; + public class TestData { public String ID; @@ -22,44 +24,26 @@ public class TestData { public String output3; public boolean error; - TestData(String ID, - String title, - String description, - String specification, - String baseIRI, - String mapping, - String input_format1, - String input_format2, - String input_format3, - String output_format1, - String output_format2, - String output_format3, - String input1, - String input2, - String input3, - String output1, - String output2, - String output3, - String error) { - this.ID = ID; - this.title = title; - this.description = description; - this.specification = specification; - this.baseIRI = baseIRI; - this.mapping = mapping; - this.input_format1 = input_format1; - this.input_format2 = input_format2; - this.input_format3 = input_format3; - this.output_format1 = output_format1; - this.output_format2 = output_format2; - this.output_format3 = output_format3; - this.input1 = input1; - this.input2 = input2; - this.input3 = input3; - this.output1 = output1; - this.output2 = output2; - this.output3 = output3; - this.error = "true".equalsIgnoreCase(error); + public TestData(Map data) { + this.ID = data.get("ID"); + this.title = data.get("title"); + this.description = data.get("description"); + this.specification = data.get("specification"); + this.baseIRI = data.getOrDefault("base_iri", "http://example.com/base/"); + this.mapping = data.get("mapping"); + this.input_format1 = data.get("input_format1"); + this.input_format2 = data.get("input_format2"); + this.input_format3 = data.get("input_format3"); + this.output_format1 = data.get("output_format1"); + this.output_format2 = data.get("output_format2"); + this.output_format3 = data.get("output_format3"); + this.input1 = data.get("input1"); + this.input2 = data.get("input2"); + this.input3 = data.get("input3"); + this.output1 = data.get("output1"); + this.output2 = data.get("output2"); + this.output3 = data.get("output3"); + this.error = "true".equalsIgnoreCase(data.get("error")); } public String toString() { diff --git a/src/test/java/burp/TestRMLCC.java b/src/test/java/burp/TestRMLCC.java index 37c5d5c..e335b37 100644 --- a/src/test/java/burp/TestRMLCC.java +++ b/src/test/java/burp/TestRMLCC.java @@ -1,108 +1,8 @@ package burp; -import com.opencsv.CSVReader; -import com.opencsv.exceptions.CsvException; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class TestRMLCC { - - public static String base = "./src/test/resources/rml-cc/"; - - static Stream testDataProvider() throws IOException, CsvException { - - Path testCaseDir = Paths.get(base); - - List testDataList = new ArrayList(); - Path csvFilePath = testCaseDir.resolve("./metadata.csv"); - CSVReader reader = new CSVReader(new FileReader(csvFilePath.toFile())); - List records = reader.readAll(); - //skip the header - for (int i = 1; i < records.size(); i++) { - String[] record = records.get(i); - testDataList.add(new TestData( - record[0], record[1], record[2], record[3], "http://www.example.org/", - record[4], record[5], record[6], record[7], - record[8], record[9], record[10], record[11], - record[12], record[13], record[14], record[15], - record[16], record[17])); - } - return testDataList.stream(); - } - - @ParameterizedTest - @MethodSource("testDataProvider") - void testDirectoryBasedCases(TestData testData) throws IOException { - System.out.println("--------------------------------------------------------------------------------"); - System.out.println(String.format("Processing test %s", testData.ID)); - System.out.println("--------------------------------------------------------------------------------"); - - System.out.println(testData.mapping); - System.out.println(testData.output1); - System.out.println(testData.error); - System.out.println(); - - if(testData.error) - testForNotOK(testData); - else - testForOK(testData); - } - - public void testForOK(TestData testData) throws IOException { - String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + testData.ID, testData.output1).getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "Turtle"); - System.out.println("---"); - actual.write(System.out, "Turtle"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(TestData testData) throws IOException { - String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); +public class TestRMLCC extends TestRMLModule { + @Override + public String getBase() { + return "./src/test/resources/rml-cc/"; } } diff --git a/src/test/java/burp/TestRMLCore.java b/src/test/java/burp/TestRMLCore.java index b40c64c..dca6fa1 100644 --- a/src/test/java/burp/TestRMLCore.java +++ b/src/test/java/burp/TestRMLCore.java @@ -1,109 +1,8 @@ package burp; -import com.opencsv.CSVReader; -import com.opencsv.exceptions.CsvException; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; -import java.util.ArrayList; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class TestRMLCore { - - public static String base = "./src/test/resources/rml-core/"; - - static Stream testDataProvider() throws IOException, CsvException { - - Path testCaseDir = Paths.get(base); - - List testDataList = new ArrayList<>(); - Path csvFilePath = testCaseDir.resolve("./metadata.csv"); - CSVReader reader = new CSVReader(new FileReader(csvFilePath.toFile())); - List records = reader.readAll(); - //skip the header - for (int i = 1; i < records.size(); i++) { - String[] record = records.get(i); - testDataList.add(new TestData( - record[0], record[1], record[2], record[3], - record[4], record[5], record[6], record[7], - record[8], record[9], record[10], record[11], - record[12], record[13], record[14], record[15], - record[16], record[17], record[18])); - } - return testDataList.stream(); - } - - @ParameterizedTest - @MethodSource("testDataProvider") - void testDirectoryBasedCases(TestData testData) throws IOException { - System.out.println("--------------------------------------------------------------------------------"); - System.out.printf("Processing test %s%n", testData.ID); - System.out.println("--------------------------------------------------------------------------------"); - - System.out.println(testData.mapping); - System.out.println(testData.output1); - System.out.println(testData.error); - System.out.println(); - - if(testData.error) - testForNotOK(testData); - else - testForOK(testData); - } - - public void testForOK(TestData testData) throws IOException { - String m = new File(base + testData.ID, testData.mapping).getAbsolutePath(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.printf("Writing output to %s%n", r); - - System.out.println("This test should generate a graph."); - String o = new File(base + testData.ID, testData.output1).getAbsolutePath(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "Turtle"); - System.out.println("---"); - actual.write(System.out, "Turtle"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(TestData testData) throws IOException { - String m = new File(base + testData.ID, testData.mapping).getAbsolutePath(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.printf("Writing output to %s%n", r); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - Path path = Paths.get(r); - System.out.println(Files.size(path) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertEquals(0, Files.size(path)); - - System.out.println(); +public class TestRMLCore extends TestRMLModule { + @Override + public String getBase() { + return "./src/test/resources/rml-core/"; } } diff --git a/src/test/java/burp/TestRMLCoreGM.java.old b/src/test/java/burp/TestRMLCoreGM.java.old deleted file mode 100644 index 7aa5d0d..0000000 --- a/src/test/java/burp/TestRMLCoreGM.java.old +++ /dev/null @@ -1,88 +0,0 @@ -package burp; - -import org.apache.jena.query.Dataset; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFFormat; -import org.junit.jupiter.api.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.Iterator; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class TestRMLCoreGM { - private static String base = "./src/test/resources/rml-core-gm/"; - - // all in default graph - @Test public void RMLTC0001() throws IOException { testForOK("RMLTC0001"); } - - // all in default graph with rml:defaultGraph - @Test public void RMLTC0002() throws IOException { testForOK("RMLTC0002"); } - - // graphMap in subjectMap - @Test public void RMLTC0003() throws IOException { testForOK("RMLTC0003"); } - - // graphMap in subjectMap, default graph in POM - @Test public void RMLTC0004() throws IOException { testForOK("RMLTC0004"); } - - // graphMap in subjectMap, default graph in POM - @Test public void RMLTC0005() throws IOException { testForOK("RMLTC0005"); } - - public void testForOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "output.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Dataset expected = RDFDataMgr.loadDataset(o); - Dataset actual = RDFDataMgr.loadDataset(r); - - assertTrue(expected.getDefaultModel().isIsomorphicWith(actual.getDefaultModel())); - Iterator names = expected.listModelNames(); - while(names.hasNext()) { - Resource name = names.next(); - assertTrue(expected.getNamedModel(r).isIsomorphicWith(actual.getNamedModel(r))); - } - names = actual.listModelNames(); - while(names.hasNext()) { - Resource name = names.next(); - assertTrue(expected.getNamedModel(r).isIsomorphicWith(actual.getNamedModel(r))); - } - - RDFDataMgr.write(System.out, expected, RDFFormat.NQ); - System.out.println("----"); - RDFDataMgr.write(System.out, actual, RDFFormat.NQ); - - assertEquals(0, exit); - } - - public void testForNotOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); - } - -} \ No newline at end of file diff --git a/src/test/java/burp/TestRMLCoreMySQL.java.old b/src/test/java/burp/TestRMLCoreMySQL.java.old deleted file mode 100644 index b307b7e..0000000 --- a/src/test/java/burp/TestRMLCoreMySQL.java.old +++ /dev/null @@ -1,209 +0,0 @@ -package burp; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.commons.io.FileUtils; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.testcontainers.containers.MySQLContainer; -import org.testcontainers.junit.jupiter.Testcontainers; - - -@Testcontainers -public class TestRMLCoreMySQL { - - private static String base = "./src/test/resources/rml-core/"; - - @Test public void RMLTC0000MySQL() throws Exception { testForOK("RMLTC0000-MySQL"); } - @Test public void RMLTC0001aMySQL() throws Exception { testForOK("RMLTC0001a-MySQL"); } - @Test public void RMLTC0001bMySQL() throws Exception { testForOK("RMLTC0001b-MySQL"); } - @Test public void RMLTC0002aMySQL() throws Exception { testForOK("RMLTC0002a-MySQL"); } - @Test public void RMLTC0002bMySQL() throws Exception { testForOK("RMLTC0002b-MySQL"); } - @Test public void RMLTC0002dMySQL() throws Exception { testForOK("RMLTC0002d-MySQL"); } - @Test public void RMLTC0003bMySQL() throws Exception { testForOK("RMLTC0003b-MySQL"); } - @Test public void RMLTC0003cMySQL() throws Exception { testForOK("RMLTC0003c-MySQL"); } - @Test public void RMLTC0004aMySQL() throws Exception { testForOK("RMLTC0004a-MySQL"); } - @Test public void RMLTC0005aMySQL() throws Exception { testForOK("RMLTC0005a-MySQL"); } - @Test public void RMLTC0005bMySQL() throws Exception { testForOK("RMLTC0005b-MySQL"); } - @Test public void RMLTC0006aMySQL() throws Exception { testForOK("RMLTC0006a-MySQL"); } - @Test public void RMLTC0007aMySQL() throws Exception { testForOK("RMLTC0007a-MySQL"); } - @Test public void RMLTC0007bMySQL() throws Exception { testForOK("RMLTC0007b-MySQL"); } - @Test public void RMLTC0007cMySQL() throws Exception { testForOK("RMLTC0007c-MySQL"); } - @Test public void RMLTC0007dMySQL() throws Exception { testForOK("RMLTC0007d-MySQL"); } - @Test public void RMLTC0007eMySQL() throws Exception { testForOK("RMLTC0007e-MySQL"); } - @Test public void RMLTC0007fMySQL() throws Exception { testForOK("RMLTC0007f-MySQL"); } - @Test public void RMLTC0007gMySQL() throws Exception { testForOK("RMLTC0007g-MySQL"); } - @Test public void RMLTC0008aMySQL() throws Exception { testForOK("RMLTC0008a-MySQL"); } - @Test public void RMLTC0008bMySQL() throws Exception { testForOK("RMLTC0008b-MySQL"); } - @Test public void RMLTC0008cMySQL() throws Exception { testForOK("RMLTC0008c-MySQL"); } - @Test public void RMLTC0009aMySQL() throws Exception { testForOK("RMLTC0009a-MySQL"); } - @Test public void RMLTC0009bMySQL() throws Exception { testForOK("RMLTC0009b-MySQL"); } - @Test public void RMLTC0009cMySQL() throws Exception { testForOK("RMLTC0009c-MySQL"); } - @Test public void RMLTC0009dMySQL() throws Exception { testForOK("RMLTC0009d-MySQL"); } - @Test public void RMLTC0010aMySQL() throws Exception { testForOK("RMLTC0010a-MySQL"); } - @Test public void RMLTC0010bMySQL() throws Exception { testForOK("RMLTC0010b-MySQL"); } - @Test public void RMLTC0010cMySQL() throws Exception { testForOK("RMLTC0010c-MySQL"); } - @Test public void RMLTC0011aMySQL() throws Exception { testForOK("RMLTC0011a-MySQL"); } - @Test public void RMLTC0011bMySQL() throws Exception { testForOK("RMLTC0011b-MySQL"); } - @Test public void RMLTC0012aMySQL() throws Exception { testForOK("RMLTC0012a-MySQL"); } - @Test public void RMLTC0012bMySQL() throws Exception { testForOK("RMLTC0012b-MySQL"); } - @Test public void RMLTC0012eMySQL() throws Exception { testForOK("RMLTC0012e-MySQL"); } - @Test public void RMLTC0013aMySQL() throws Exception { testForOK("RMLTC0013a-MySQL"); } - @Test public void RMLTC0014dMySQL() throws Exception { testForOK("RMLTC0014d-MySQL"); } - @Test public void RMLTC0015aMySQL() throws Exception { testForOK("RMLTC0015a-MySQL"); } - @Test public void RMLTC0016aMySQL() throws Exception { testForOK("RMLTC0016a-MySQL"); } - @Test public void RMLTC0016bMySQL() throws Exception { testForOK("RMLTC0016b-MySQL"); } - @Test public void RMLTC0016cMySQL() throws Exception { testForOK("RMLTC0016c-MySQL"); } - @Test public void RMLTC0016dMySQL() throws Exception { testForOK("RMLTC0016d-MySQL"); } - @Test public void RMLTC0016eMySQL() throws Exception { testForOK("RMLTC0016e-MySQL"); } - // TODO: SHOULD BE REMOVED FROM TEST CASES - // public void RMLTC0018aMySQL() throws Exception { testForOK("RMLTC0018a-MySQL"); } - @Test public void RMLTC0019aMySQL() throws Exception { testForOK("RMLTC0019a-MySQL"); } - @Test public void RMLTC0020aMySQL() throws Exception { testForOK("RMLTC0020a-MySQL"); } - @Test public void RMLTC0021aMySQL() throws Exception { testForOK("RMLTC0021a-MySQL"); } - - @Test public void RMLTC0002cMySQL() throws Exception { testForNotOK("RMLTC0002c-MySQL"); } - @Test public void RMLTC0002eMySQL() throws Exception { testForNotOK("RMLTC0002e-MySQL"); } - // TODO: SHOULD BE CORRECT - //public void RMLTC0002fMySQL() throws Exception { testForNotOK("RMLTC0002f-MySQL"); } - @Test public void RMLTC0002gMySQL() throws Exception { testForNotOK("RMLTC0002g-MySQL"); } - @Test public void RMLTC0002hMySQL() throws Exception { testForNotOK("RMLTC0002h-MySQL"); } - @Test public void RMLTC0002iMySQL() throws Exception { testForNotOK("RMLTC0002i-MySQL"); } - @Test public void RMLTC0002jMySQL() throws Exception { testForNotOK("RMLTC0002j-MySQL"); } - @Test public void RMLTC0003aMySQL() throws Exception { testForNotOK("RMLTC0003a-MySQL"); } - @Test public void RMLTC0004bMySQL() throws Exception { testForNotOK("RMLTC0004b-MySQL"); } - @Test public void RMLTC0007hMySQL() throws Exception { testForNotOK("RMLTC0007h-MySQL"); } - @Test public void RMLTC0012cMySQL() throws Exception { testForNotOK("RMLTC0012c-MySQL"); } - @Test public void RMLTC0012dMySQL() throws Exception { testForNotOK("RMLTC0012d-MySQL"); } - @Test public void RMLTC0015bMySQL() throws Exception { testForNotOK("RMLTC0015b-MySQL"); } - @Test public void RMLTC0019bMySQL() throws Exception { testForNotOK("RMLTC0019b-MySQL"); } - - - static MySQLContainer MY_SQL_CONTAINER = new MySQLContainer<>("mysql:8") - .withEnv("MYSQL_ROOT_HOST", "%") - .withCommand("mysqld", "--sql_mode=ANSI_QUOTES"); - - @BeforeAll - static void startContainers() { - MY_SQL_CONTAINER.start(); - } - - @AfterAll - static void stopContainers() { - MY_SQL_CONTAINER.stop(); - } - - @BeforeEach - void setUp() throws SQLException { - String databaseName = MY_SQL_CONTAINER.getDatabaseName(); - // Removing all tables from the database - Statement scriptStmt = MY_SQL_CONTAINER.createConnection("").createStatement(); - String constructScriptQuery = """ - SELECT CONCAT('DROP TABLE IF EXISTS ', GROUP_CONCAT(table_name)) - FROM information_schema.tables - WHERE table_schema = 'database_name'; - """.replace("database_name", databaseName); - scriptStmt.execute(constructScriptQuery); - String script = scriptStmt.getResultSet().next() ? scriptStmt.getResultSet().getString(1) : ""; - if (script != null && !script.isEmpty()) { - Statement dropStmt = MY_SQL_CONTAINER.createConnection("").createStatement(); - dropStmt.execute(script); - dropStmt.close(); - } - } - - public void testForOK(String f) throws Exception { - System.out.println(String.format("Now processing %s", f)); - - System.out.println("Loading the database"); - String jdbcurl = MY_SQL_CONTAINER.getJdbcUrl(); - String ddl = FileUtils.readFileToString(new File(base + f, "resource.sql")); - Statement statement = MY_SQL_CONTAINER.createConnection("?allowMultiQueries=true").createStatement(); - statement.execute(ddl); - System.out.println("Database loaded"); - - String ms = FileUtils.readFileToString(new File(base + f, "mapping.ttl")); - ms = ms.replace("CONNECTIONDSN", jdbcurl); - ms = ms.replace("d2rq:password \"\"", "d2rq:password \"test\""); - File m2 = new File(base + f, "mapping-new.ttl"); - BufferedWriter writer = new BufferedWriter(new FileWriter(m2)); - writer.write(ms); - writer.close(); - - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "output.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m2.getAbsolutePath(), "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "NQ"); - System.out.println(); - actual.write(System.out, "NQ"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - - m2.delete(); - - System.out.println(); - } - - public void testForNotOK(String f) throws Exception { - System.out.println(String.format("Now processing %s", f)); - - System.out.println("Loading the database"); - String jdbcurl = MY_SQL_CONTAINER.getJdbcUrl(); - String ddl = FileUtils.readFileToString(new File(base + f, "resource.sql")); - Statement statement = MY_SQL_CONTAINER.createConnection("?allowMultiQueries=true").createStatement(); - statement.execute(ddl); - System.out.println("Database loaded"); - - String ms = FileUtils.readFileToString(new File(base + f, "mapping.ttl")); - ms = ms.replace("CONNECTIONDSN", jdbcurl); - ms = ms.replace("d2rq:password \"\"", "d2rq:password \"test\""); - File m2 = new File(base + f, "mapping-new.ttl"); - BufferedWriter writer = new BufferedWriter(new FileWriter(m2)); - writer.write(ms); - writer.close(); - - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m2.getAbsolutePath(), "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - m2.delete(); - - System.out.println(); - } - -} diff --git a/src/test/java/burp/TestRMLCorePostgreSQL.java.old b/src/test/java/burp/TestRMLCorePostgreSQL.java.old deleted file mode 100644 index 01e8012..0000000 --- a/src/test/java/burp/TestRMLCorePostgreSQL.java.old +++ /dev/null @@ -1,202 +0,0 @@ -package burp; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.sql.SQLException; -import java.sql.Statement; - -import org.apache.commons.io.FileUtils; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.testcontainers.containers.PostgreSQLContainer; -import org.testcontainers.junit.jupiter.Testcontainers; - - -@Testcontainers -public class TestRMLCorePostgreSQL { - - private static String base = "./src/test/resources/rml-core/"; - - @Test public void RMLTC0000PostgreSQL() throws Exception { testForOK("RMLTC0000-PostgreSQL"); } - @Test public void RMLTC0001aPostgreSQL() throws Exception { testForOK("RMLTC0001a-PostgreSQL"); } - @Test public void RMLTC0001bPostgreSQL() throws Exception { testForOK("RMLTC0001b-PostgreSQL"); } - @Test public void RMLTC0002aPostgreSQL() throws Exception { testForOK("RMLTC0002a-PostgreSQL"); } - @Test public void RMLTC0002bPostgreSQL() throws Exception { testForOK("RMLTC0002b-PostgreSQL"); } - @Test public void RMLTC0002dPostgreSQL() throws Exception { testForOK("RMLTC0002d-PostgreSQL"); } - @Test public void RMLTC0003bPostgreSQL() throws Exception { testForOK("RMLTC0003b-PostgreSQL"); } - @Test public void RMLTC0003cPostgreSQL() throws Exception { testForOK("RMLTC0003c-PostgreSQL"); } - @Test public void RMLTC0004aPostgreSQL() throws Exception { testForOK("RMLTC0004a-PostgreSQL"); } - @Test public void RMLTC0005aPostgreSQL() throws Exception { testForOK("RMLTC0005a-PostgreSQL"); } - @Test public void RMLTC0005bPostgreSQL() throws Exception { testForOK("RMLTC0005b-PostgreSQL"); } - @Test public void RMLTC0006aPostgreSQL() throws Exception { testForOK("RMLTC0006a-PostgreSQL"); } - @Test public void RMLTC0007aPostgreSQL() throws Exception { testForOK("RMLTC0007a-PostgreSQL"); } - @Test public void RMLTC0007bPostgreSQL() throws Exception { testForOK("RMLTC0007b-PostgreSQL"); } - @Test public void RMLTC0007cPostgreSQL() throws Exception { testForOK("RMLTC0007c-PostgreSQL"); } - @Test public void RMLTC0007dPostgreSQL() throws Exception { testForOK("RMLTC0007d-PostgreSQL"); } - @Test public void RMLTC0007ePostgreSQL() throws Exception { testForOK("RMLTC0007e-PostgreSQL"); } - @Test public void RMLTC0007fPostgreSQL() throws Exception { testForOK("RMLTC0007f-PostgreSQL"); } - @Test public void RMLTC0007gPostgreSQL() throws Exception { testForOK("RMLTC0007g-PostgreSQL"); } - @Test public void RMLTC0008aPostgreSQL() throws Exception { testForOK("RMLTC0008a-PostgreSQL"); } - @Test public void RMLTC0008bPostgreSQL() throws Exception { testForOK("RMLTC0008b-PostgreSQL"); } - @Test public void RMLTC0008cPostgreSQL() throws Exception { testForOK("RMLTC0008c-PostgreSQL"); } - @Test public void RMLTC0009aPostgreSQL() throws Exception { testForOK("RMLTC0009a-PostgreSQL"); } - @Test public void RMLTC0009bPostgreSQL() throws Exception { testForOK("RMLTC0009b-PostgreSQL"); } - @Test public void RMLTC0009cPostgreSQL() throws Exception { testForOK("RMLTC0009c-PostgreSQL"); } - @Test public void RMLTC0009dPostgreSQL() throws Exception { testForOK("RMLTC0009d-PostgreSQL"); } - @Test public void RMLTC0010aPostgreSQL() throws Exception { testForOK("RMLTC0010a-PostgreSQL"); } - @Test public void RMLTC0010bPostgreSQL() throws Exception { testForOK("RMLTC0010b-PostgreSQL"); } - @Test public void RMLTC0010cPostgreSQL() throws Exception { testForOK("RMLTC0010c-PostgreSQL"); } - @Test public void RMLTC0011aPostgreSQL() throws Exception { testForOK("RMLTC0011a-PostgreSQL"); } - @Test public void RMLTC0011bPostgreSQL() throws Exception { testForOK("RMLTC0011b-PostgreSQL"); } - @Test public void RMLTC0012aPostgreSQL() throws Exception { testForOK("RMLTC0012a-PostgreSQL"); } - @Test public void RMLTC0012bPostgreSQL() throws Exception { testForOK("RMLTC0012b-PostgreSQL"); } - @Test public void RMLTC0012ePostgreSQL() throws Exception { testForOK("RMLTC0012e-PostgreSQL"); } - @Test public void RMLTC0013aPostgreSQL() throws Exception { testForOK("RMLTC0013a-PostgreSQL"); } - @Test public void RMLTC0014dPostgreSQL() throws Exception { testForOK("RMLTC0014d-PostgreSQL"); } - @Test public void RMLTC0015aPostgreSQL() throws Exception { testForOK("RMLTC0015a-PostgreSQL"); } - @Test public void RMLTC0016aPostgreSQL() throws Exception { testForOK("RMLTC0016a-PostgreSQL"); } - @Test public void RMLTC0016bPostgreSQL() throws Exception { testForOK("RMLTC0016b-PostgreSQL"); } - @Test public void RMLTC0016cPostgreSQL() throws Exception { testForOK("RMLTC0016c-PostgreSQL"); } - @Test public void RMLTC0016dPostgreSQL() throws Exception { testForOK("RMLTC0016d-PostgreSQL"); } - @Test public void RMLTC0016ePostgreSQL() throws Exception { testForOK("RMLTC0016e-PostgreSQL"); } - @Test public void RMLTC0018aPostgreSQL() throws Exception { testForOK("RMLTC0018a-PostgreSQL"); } - @Test public void RMLTC0019aPostgreSQL() throws Exception { testForOK("RMLTC0019a-PostgreSQL"); } - @Test public void RMLTC0020aPostgreSQL() throws Exception { testForOK("RMLTC0020a-PostgreSQL"); } - @Test public void RMLTC0021aPostgreSQL() throws Exception { testForOK("RMLTC0021a-PostgreSQL"); } - - @Test public void RMLTC0002cPostgreSQL() throws Exception { testForNotOK("RMLTC0002c-PostgreSQL"); } - @Test public void RMLTC0002ePostgreSQL() throws Exception { testForNotOK("RMLTC0002e-PostgreSQL"); } - @Test public void RMLTC0002fPostgreSQL() throws Exception { testForNotOK("RMLTC0002f-PostgreSQL"); } - @Test public void RMLTC0002gPostgreSQL() throws Exception { testForNotOK("RMLTC0002g-PostgreSQL"); } - @Test public void RMLTC0002hPostgreSQL() throws Exception { testForNotOK("RMLTC0002h-PostgreSQL"); } - @Test public void RMLTC0002iPostgreSQL() throws Exception { testForNotOK("RMLTC0002i-PostgreSQL"); } - @Test public void RMLTC0002jPostgreSQL() throws Exception { testForNotOK("RMLTC0002j-PostgreSQL"); } - @Test public void RMLTC0003aPostgreSQL() throws Exception { testForNotOK("RMLTC0003a-PostgreSQL"); } - @Test public void RMLTC0004bPostgreSQL() throws Exception { testForNotOK("RMLTC0004b-PostgreSQL"); } - @Test public void RMLTC0007hPostgreSQL() throws Exception { testForNotOK("RMLTC0007h-PostgreSQL"); } - @Test public void RMLTC0012cPostgreSQL() throws Exception { testForNotOK("RMLTC0012c-PostgreSQL"); } - @Test public void RMLTC0012dPostgreSQL() throws Exception { testForNotOK("RMLTC0012d-PostgreSQL"); } - @Test public void RMLTC0015bPostgreSQL() throws Exception { testForNotOK("RMLTC0015b-PostgreSQL"); } - @Test public void RMLTC0019bPostgreSQL() throws Exception { testForNotOK("RMLTC0019b-PostgreSQL"); } - - static PostgreSQLContainer CONTAINER = new PostgreSQLContainer<>("postgres:latest") - .withUsername("postgres") - .withPassword("test"); - - @BeforeAll - static void startContainers() { - CONTAINER.start(); - } - - @AfterAll - static void stopContainers() { - CONTAINER.stop(); - } - - @BeforeEach - void setUp() throws SQLException { - // drop all tables in the database - CONTAINER.createConnection("").createStatement().execute( - """ - DROP SCHEMA public CASCADE; - CREATE SCHEMA public; - GRANT ALL ON SCHEMA public TO postgres; - GRANT ALL ON SCHEMA public TO public; - COMMENT ON SCHEMA public IS 'standard public schema'; - """ - ); - } - - - public void testForOK(String f) throws Exception { - System.out.println(String.format("Now processing %s", f)); - - System.out.println("Loading the database"); - String jdbcurl = CONTAINER.getJdbcUrl(); - String ddl = FileUtils.readFileToString(new File(base + f, "resource.sql")); - Statement statement = CONTAINER.createConnection("?allowMultiQueries=true").createStatement(); - statement.execute(ddl); - System.out.println("Database loaded"); - - String ms = FileUtils.readFileToString(new File(base + f, "mapping.ttl")); - ms = ms.replace("CONNECTIONDSN", jdbcurl); - ms = ms.replace("d2rq:password \"\"", "d2rq:password \"test\""); - File m2 = new File(base + f, "mapping-new.ttl"); - BufferedWriter writer = new BufferedWriter(new FileWriter(m2)); - writer.write(ms); - writer.close(); - - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "output.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m2.getAbsolutePath(), "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "NQ"); - System.out.println(); - actual.write(System.out, "NQ"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - - m2.delete(); - - System.out.println(); - } - - public void testForNotOK(String f) throws Exception { - System.out.println(String.format("Now processing %s", f)); - - System.out.println("Loading the database"); - String jdbcurl = CONTAINER.getJdbcUrl(); - String ddl = FileUtils.readFileToString(new File(base + f, "resource.sql")); - Statement statement = CONTAINER.createConnection("?allowMultiQueries=true").createStatement(); - statement.execute(ddl); - System.out.println("Database loaded"); - - String ms = FileUtils.readFileToString(new File(base + f, "mapping.ttl")); - ms = ms.replace("CONNECTIONDSN", jdbcurl); - ms = ms.replace("d2rq:password \"\"", "d2rq:password \"test\""); - File m2 = new File(base + f, "mapping-new.ttl"); - BufferedWriter writer = new BufferedWriter(new FileWriter(m2)); - writer.write(ms); - writer.close(); - - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m2.getAbsolutePath(), "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - m2.delete(); - - System.out.println(); - } - -} diff --git a/src/test/java/burp/TestRMLFNML.java b/src/test/java/burp/TestRMLFNML.java new file mode 100644 index 0000000..14f303b --- /dev/null +++ b/src/test/java/burp/TestRMLFNML.java @@ -0,0 +1,8 @@ +package burp; + +public class TestRMLFNML extends TestRMLModule { + @Override + public String getBase() { + return "./src/test/resources/rml-fnml/"; + } +} diff --git a/src/test/java/burp/TestRMLFNML.java.old b/src/test/java/burp/TestRMLFNML.java.old deleted file mode 100644 index 7c62362..0000000 --- a/src/test/java/burp/TestRMLFNML.java.old +++ /dev/null @@ -1,81 +0,0 @@ - -package burp; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.api.Test; - -public class TestRMLFNML { - private static String base = "./src/test/resources/rml-fnml-burp/"; - - // UUID test should be removed from the test cases - // @Test public void RMLFNOTC0000CSV() throws IOException { testForOK("RMLFNOTC0000-CSV"); } - @Test public void RMLFNOTC0000CSVb() throws IOException { testForOK("RMLFNOTC0000b-CSV"); } - @Test public void RMLFNOTC0001CSV() throws IOException { testForOK("RMLFNOTC0001-CSV"); } - @Test public void RMLFNOTC0002CSV() throws IOException { testForNotOK("RMLFNOTC0002-CSV"); } - @Test public void RMLFNOTC0003CSV() throws IOException { testForOK("RMLFNOTC0003-CSV"); } - @Test public void RMLFNOTC0004CSV() throws IOException { testForOK("RMLFNOTC0004-CSV"); } - @Test public void RMLFNOTC0004CSVb() throws IOException { testForOK("RMLFNOTC0004b-CSV"); } - @Test public void RMLFNOTC0005CSV() throws IOException { testForOK("RMLFNOTC0005-CSV"); } - @Test public void RMLFNOTC0005CSVb() throws IOException { testForOK("RMLFNOTC0005b-CSV"); } - @Test public void RMLFNOTC0006CSV() throws IOException { testForOK("RMLFNOTC0006-CSV"); } - @Test public void RMLFNOTC0006CSVb() throws IOException { testForOK("RMLFNOTC0006b-CSV"); } - @Test public void RMLFNOTC0008CSV() throws IOException { testForOK("RMLFNOTC0008-CSV"); } - @Test public void RMLFNOTC0009CSV() throws IOException { testForOK("RMLFNOTC0009-CSV"); } - @Test public void RMLFNOTC0010CSV() throws IOException { testForOK("RMLFNOTC0010-CSV"); } - - - - public void testForOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "output.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "Turtle"); - System.out.println("---"); - actual.write(System.out, "Turtle"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); - } - -} \ No newline at end of file diff --git a/src/test/java/burp/TestRMLFNMLGrellFunctions.java.old b/src/test/java/burp/TestRMLFNMLGrellFunctions.java.old deleted file mode 100644 index 0942c36..0000000 --- a/src/test/java/burp/TestRMLFNMLGrellFunctions.java.old +++ /dev/null @@ -1,100 +0,0 @@ - -package burp; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.api.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class TestRMLFNMLGrellFunctions { - private static String base = "./src/test/resources/rml-fnml-grel/"; - - @Test public void RMLFNOTC0001() throws IOException { testForOK("string-length"); } - @Test public void RMLFNOTC0002() throws IOException { testForOK("string-touppercase"); } - @Test public void RMLFNOTC0003() throws IOException { testForOK("string-tolowercase"); } - @Test public void RMLFNOTC0004() throws IOException { testForOK("string-totitlecase-a"); } - @Test public void RMLFNOTC0005() throws IOException { testForOK("string-totitlecase-b"); } - @Test public void RMLFNOTC0006() throws IOException { testForOK("string-replace"); } - @Test public void RMLFNOTC0007() throws IOException { testForOK("string-startswith-true"); } - @Test public void RMLFNOTC0008() throws IOException { testForOK("string-startswith-false"); } - @Test public void RMLFNOTC0009() throws IOException { testForOK("string-endswith-true"); } - @Test public void RMLFNOTC0010() throws IOException { testForOK("string-endswith-false"); } - @Test public void RMLFNOTC0011() throws IOException { testForOK("string-trim"); } - @Test public void RMLFNOTC0012() throws IOException { testForOK("string-strip"); } - @Test public void RMLFNOTC0013() throws IOException { testForOK("string-chomp-a"); } - @Test public void RMLFNOTC0014() throws IOException { testForOK("string-chomp-b"); } - @Test public void RMLFNOTC0015() throws IOException { testForOK("math-abs"); } - @Test public void RMLFNOTC0016() throws IOException { testForOK("math-ceil"); } - @Test public void RMLFNOTC0017() throws IOException { testForOK("math-floor"); } - @Test public void RMLFNOTC0018() throws IOException { testForOK("string-contains-s-true"); } - @Test public void RMLFNOTC0019() throws IOException { testForOK("string-contains-s-false"); } - @Test public void RMLFNOTC0020() throws IOException { testForOK("string-contains-p-true"); } - @Test public void RMLFNOTC0021() throws IOException { testForOK("string-contains-p-false"); } - @Test public void RMLFNOTC0022() throws IOException { testForOK("string-substring-a"); } - @Test public void RMLFNOTC0023() throws IOException { testForOK("string-substring-b"); } - @Test public void RMLFNOTC0024() throws IOException { testForOK("string-substring-c"); } - @Test public void RMLFNOTC0025() throws IOException { testForOK("string-get-a"); } - @Test public void RMLFNOTC0026() throws IOException { testForOK("string-get-b"); } - @Test public void RMLFNOTC0027() throws IOException { testForOK("string-get-c"); } - @Test public void RMLFNOTC0028() throws IOException { testForOK("boolean-and-true"); } - @Test public void RMLFNOTC0029() throws IOException { testForOK("boolean-and-false"); } - @Test public void RMLFNOTC0030() throws IOException { testForOK("boolean-or-true"); } - @Test public void RMLFNOTC0031() throws IOException { testForOK("boolean-or-false"); } - @Test public void RMLFNOTC0032() throws IOException { testForOK("boolean-xor-false"); } - @Test public void RMLFNOTC0033() throws IOException { testForOK("boolean-xor-false"); } - @Test public void RMLFNOTC0034() throws IOException { testForOK("boolean-not-false"); } - @Test public void RMLFNOTC0035() throws IOException { testForOK("boolean-not-false"); } - - public void testForOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + f, "output.nq").getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "Turtle"); - System.out.println("---"); - actual.write(System.out, "Turtle"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(String f) throws IOException { - System.out.println(String.format("Now processing %s", f)); - String m = new File(base + f, "mapping.ttl").getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); - } - -} \ No newline at end of file diff --git a/src/test/java/burp/TestRMLIO.java b/src/test/java/burp/TestRMLIO.java new file mode 100644 index 0000000..b718841 --- /dev/null +++ b/src/test/java/burp/TestRMLIO.java @@ -0,0 +1,8 @@ +package burp; + +public class TestRMLIO extends TestRMLModule { + @Override + public String getBase() { + return "./src/test/resources/rml-io/"; + } +} diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java new file mode 100644 index 0000000..fac3bab --- /dev/null +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -0,0 +1,145 @@ +package burp; + +import burp.vocabularies.D2RQ; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFFormat; +import org.apache.jena.update.UpdateAction; +import org.apache.jena.update.UpdateFactory; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.testcontainers.containers.JdbcDatabaseContainer; +import org.testcontainers.mssqlserver.MSSQLServerContainer; +import org.testcontainers.mysql.MySQLContainer; +import org.testcontainers.postgresql.PostgreSQLContainer; + +import java.io.File; +import java.io.FileOutputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Stream; + +public class TestRMLIORegistry extends TestRMLModule { + + public static String base = "./src/test/resources/rml-io-registry/"; + + @Override + public String getBase() { + return base; + } + + @Override + public void prepareSource(TestData testData) throws Exception { + System.out.printf("Preparing test %s%n", testData.ID); + + String mappingPath = new File(base + testData.ID, testData.mapping).getAbsolutePath(); + String newMappingPath = mappingPath; + + if ("application/sql".equals(testData.input_format1)) { + System.out.println("Preparing mapping for database connection..."); + Model model = RDFDataMgr.loadModel(mappingPath); + String jdbcDriver = model.listObjectsOfProperty(D2RQ.jdbcDriver).next().asLiteral().getString(); + + String queryString = ""; + JdbcDatabaseContainer db; + + switch (jdbcDriver) { + case "com.mysql.cj.jdbc.Driver": + MYSQL_CONTAINER_FUTURE.join(); + queryString = "?allowMultiQueries=true"; + MYSQL_CONTAINER.addParameter("allowMultiQueries", "true"); + db = MYSQL_CONTAINER; + break; + + case "org.postgresql.Driver": + PGSQL_CONTAINER_FUTURE.join(); + db = PGSQL_CONTAINER; + break; + + case "com.microsoft.sqlserver.jdbc.SQLServerDriver": + MSSQL_CONTAINER_FUTURE.join(); + MSSQL_CONTAINER.withUrlParam("databaseName", "master"); + try (var conn = MSSQL_CONTAINER.createConnection("")) { + try (var stmt = conn.createStatement()) { + stmt.executeUpdate("IF EXISTS (SELECT name FROM sys.databases WHERE name = N'TestDB') ALTER DATABASE [TestDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE"); + stmt.executeUpdate("IF EXISTS (SELECT name FROM sys.databases WHERE name = N'TestDB') DROP DATABASE [TestDB]"); + stmt.executeUpdate("CREATE DATABASE [TestDB]"); + } + } + MSSQL_CONTAINER.withUrlParam("databaseName", "TestDB"); + db = MSSQL_CONTAINER; + break; + + default: + throw new IllegalArgumentException("Unsupported JDBC driver: " + jdbcDriver); + } + + String sparql = String.format( + "PREFIX d2rq: \n" + + "DELETE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass }\n" + + "INSERT { ?s d2rq:jdbcDSN \"%s\"; d2rq:username \"%s\"; d2rq:password \"%s\" }\n" + + "WHERE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass }", + db.getJdbcUrl(), db.getUsername(), db.getPassword() + ); + var updateRequest = UpdateFactory.create(sparql); + UpdateAction.execute(updateRequest, model); + + newMappingPath = Paths.get(base + testData.ID, "mapping-new.ttl").toAbsolutePath().toString(); + try (FileOutputStream out = new FileOutputStream(newMappingPath)) { + RDFDataMgr.write(out, model, RDFFormat.TURTLE_PRETTY); + } + + System.out.println("Populating database..."); + String sqlFilePath = new File(base + testData.ID, testData.input1).getAbsolutePath(); + String sql = new String(Files.readAllBytes(Paths.get(sqlFilePath))); + try (var conn = db.createConnection(queryString)) { + try (var stmt = conn.createStatement()) { + int update = stmt.executeUpdate(sql); + if (update > 0) { + System.out.println("SQL update successfully."); + } + } + } + } + + System.out.println(testData.mapping); + System.out.println(testData.output1); + System.out.println(testData.error); + System.out.println(); + + if (testData.error) { + testForNotOK(testData, newMappingPath); + } else { + testForOK(testData); + } + } + + public static PostgreSQLContainer PGSQL_CONTAINER = new PostgreSQLContainer("postgres:latest") + .withUsername("postgres") + .withPassword("test"); + private static CompletableFuture PGSQL_CONTAINER_FUTURE = null; + + public static MySQLContainer MYSQL_CONTAINER = new MySQLContainer("mysql:8") + .withEnv("MYSQL_ROOT_HOST", "%") + .withCommand("mysqld", "--sql_mode=ANSI_QUOTES"); + private static CompletableFuture MYSQL_CONTAINER_FUTURE = null; + + public static MSSQLServerContainer MSSQL_CONTAINER = new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2022-CU20-ubuntu-22.04") + .acceptLicense(); + private static CompletableFuture MSSQL_CONTAINER_FUTURE = null; + + @BeforeAll + public static void startContainers() { + PGSQL_CONTAINER_FUTURE = CompletableFuture.runAsync(PGSQL_CONTAINER::start); + MYSQL_CONTAINER_FUTURE = CompletableFuture.runAsync(MYSQL_CONTAINER::start); + MSSQL_CONTAINER_FUTURE = CompletableFuture.runAsync(MSSQL_CONTAINER::start); + } + + @AfterAll + public static void stopContainers() { + Stream.>of(PGSQL_CONTAINER, MYSQL_CONTAINER, MSSQL_CONTAINER) + .parallel() + .forEach(JdbcDatabaseContainer::stop); + } +} diff --git a/src/test/java/burp/TestRMLLV.java b/src/test/java/burp/TestRMLLV.java index 55f1df3..6cd9cfe 100644 --- a/src/test/java/burp/TestRMLLV.java +++ b/src/test/java/burp/TestRMLLV.java @@ -1,108 +1,8 @@ package burp; -import com.opencsv.CSVReader; -import com.opencsv.exceptions.CsvException; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.RDFDataMgr; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class TestRMLLV { - - public static String base = "./src/test/resources/rml-lv/"; - - static Stream testDataProvider() throws IOException, CsvException { - - Path testCaseDir = Paths.get(base); - - List testDataList = new ArrayList(); - Path csvFilePath = testCaseDir.resolve("./metadata.csv"); - CSVReader reader = new CSVReader(new FileReader(csvFilePath.toFile())); - List records = reader.readAll(); - //skip the header - for (int i = 1; i < records.size(); i++) { - String[] record = records.get(i); - testDataList.add(new TestData( - record[0], record[1], record[2], record[3], "http://www.example.org/", - record[4], record[5], record[6], record[7], - record[8], record[9], record[10], record[11], - record[12], record[13], record[14], record[15], - record[16], record[17])); - } - return testDataList.stream(); - } - - @ParameterizedTest - @MethodSource("testDataProvider") - void testDirectoryBasedCases(TestData testData) throws IOException { - System.out.println("--------------------------------------------------------------------------------"); - System.out.println(String.format("Processing test %s", testData.ID)); - System.out.println("--------------------------------------------------------------------------------"); - - System.out.println(testData.mapping); - System.out.println(testData.output1); - System.out.println(testData.error); - System.out.println(); - - if(testData.error) - testForNotOK(testData); - else - testForOK(testData); - } - - public void testForOK(TestData testData) throws IOException { - String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should generate a graph."); - String o = new File(base + testData.ID, testData.output1).getAbsolutePath().toString(); - - int exit = Main.doMain(new String[] { "-m", m, "-o", r, "-b", "http://example.com/base/" }); - - Model expected = RDFDataMgr.loadModel(o); - Model actual = RDFDataMgr.loadModel(r); - - if (!expected.isIsomorphicWith(actual)) { - expected.write(System.out, "Turtle"); - System.out.println("---"); - actual.write(System.out, "Turtle"); - } - - assertEquals(0, exit); - - System.out.println(expected.isIsomorphicWith(actual) ? "OK" : "NOK"); - - assertTrue(expected.isIsomorphicWith(actual)); - } - - public void testForNotOK(TestData testData) throws IOException { - String m = new File(base + testData.ID, testData.mapping).getAbsolutePath().toString(); - String r = Files.createTempFile(null, ".nq").toString(); - System.out.println(String.format("Writing output to %s", r)); - - System.out.println("This test should NOT generate a graph."); - int exit = Main.doMain(new String[] { "-m", m, "-o", r }); - System.out.println(Files.size(Paths.get(r)) == 0 ? "OK" : "NOK"); - Model actual = RDFDataMgr.loadModel(r); - actual.write(System.out, "NQ"); - - assertTrue(exit > 0); - assertTrue(Files.size(Paths.get(r)) == 0); - - System.out.println(); +public class TestRMLLV extends TestRMLModule { + @Override + public String getBase() { + return "./src/test/resources/rml-lv/"; } } diff --git a/src/test/java/burp/TestRMLModule.java b/src/test/java/burp/TestRMLModule.java new file mode 100644 index 0000000..971535c --- /dev/null +++ b/src/test/java/burp/TestRMLModule.java @@ -0,0 +1,391 @@ +package burp; + +import burp.util.Util; +import burp.vocabularies.RER; +import burp.vocabularies.RML; +import com.google.gson.JsonParser; +import com.opencsv.CSVReaderHeaderAware; +import com.opencsv.CSVWriter; +import com.opencsv.exceptions.CsvException; +import org.apache.jena.query.QueryExecution; +import org.apache.jena.query.QueryExecutionFactory; +import org.apache.jena.query.QuerySolution; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RiotException; +import org.apache.jena.sparql.core.DatasetGraph; +import org.apache.jena.sparql.util.IsoMatcher; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.*; +import java.util.*; +import java.util.stream.Stream; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public abstract class TestRMLModule { + + public abstract String getBase(); + + public Stream loadTestData() throws IOException, CsvException { + Path testCaseDir = Paths.get(getBase()).toAbsolutePath().normalize(); + + List testDataList = new ArrayList<>(); + Path csvFilePath = testCaseDir.resolve("./metadata.csv").normalize(); + + try (CSVReaderHeaderAware reader = new CSVReaderHeaderAware(new FileReader(csvFilePath.toFile()))) { + Map record; + while ((record = reader.readMap()) != null) { + testDataList.add(new TestData(record)); + } + } + + testDataList.sort(Comparator.comparing(td -> td.ID)); + return testDataList.stream(); + } + + protected Stream testDataProviderOK() throws IOException, CsvException { + return loadTestData().filter(t -> !t.error); + } + + protected Stream testDataProviderNotOK() throws IOException, CsvException { + return loadTestData().filter(t -> t.error); + } + + public Path getPath(TestData testData, String path) { + return Paths.get(getBase(), testData.ID, path).toAbsolutePath().normalize(); + } + + public Path getPathOptional(TestData testData, String path) { + if (path == null) return null; + return Paths.get(getBase(), testData.ID, path).toAbsolutePath().normalize(); + } + + + public void printTestHeader(TestData testData) { + System.out.println("--------------------------------------------------------------------------------"); + System.out.printf("Processing test %s: %s%n", testData.ID, testData.title); + System.out.println("--------------------------------------------------------------------------------"); + + System.out.println("Mapping\t" + getPath(testData, testData.mapping)); + System.out.println("First Input\t" + getPathOptional(testData, testData.input1)); + System.out.println("First Output\t" + getPathOptional(testData, testData.output1)); + System.out.println("Expects error?\t" + testData.error); + System.out.println(); + } + + private Resource getCompressionFromFileName(String fileName) { + if (fileName.endsWith(".tar.xz")) return RML.tarxz; + if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) return RML.targz; + if (fileName.endsWith(".gz")) return RML.gzip; + if (fileName.endsWith(".zip")) return RML.zip; + return RML.none; + } + + public void prepareSource(TestData testData) throws Exception { + } + + @ParameterizedTest + @MethodSource("testDataProviderOK") + public void testForOK(TestData testData) throws Exception { + printTestHeader(testData); + prepareSource(testData); + + Path originalCwd = Paths.get(getBase(), testData.ID).toAbsolutePath().normalize(); + Path tempDir = Files.createTempDirectory(testData.ID); + + List outputs = new ArrayList<>(); + if (testData.output1 != null && !testData.output1.isBlank()) outputs.add(testData.output1); + if (testData.output2 != null && !testData.output2.isBlank()) outputs.add(testData.output2); + if (testData.output3 != null && !testData.output3.isBlank()) outputs.add(testData.output3); + + try (Stream stream = Files.walk(originalCwd)) { + stream.forEach(source -> { + try { + Path relative = originalCwd.relativize(source); + Path dest = tempDir.resolve(relative); + if (!Files.isDirectory(source) && !outputs.contains(relative.toString())) { + Files.createDirectories(dest.getParent()); + Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + } + + String resultPath = tempDir.resolve(testData.output1 != null && !testData.output1.isEmpty() ? testData.output1 : "default.nq").toString(); + String reportPath = Files.createTempFile("report_" + testData.ID, ".nq").toString(); + + String tempMappingPath = tempDir.resolve("mapping.ttl").toString(); + + int exit = Main.doMain( + new String[]{ + "-m", tempMappingPath, + "-o", resultPath, + "--baseIRI", testData.baseIRI, + "--reportFile", reportPath + }, + tempDir + ); + System.out.println("Exit code: " + exit); + + for (String out : outputs) { + String expectedOutputPathStr = originalCwd.resolve(out).toString(); + Path expectedOutputPath = Paths.get(expectedOutputPathStr); + String actualOutputPathStr = tempDir.resolve(out).toString(); + Path actualOutputPath = Paths.get(actualOutputPathStr); + + System.out.println("Checking output file: " + out); + System.out.println("Expected: " + expectedOutputPath); + System.out.println("Actual: " + actualOutputPath); + + Resource expectedCompression = getCompressionFromFileName(out); + String decompressedExpectedPath = expectedOutputPathStr; + if (expectedCompression != RML.none && Files.exists(expectedOutputPath)) { + System.out.println("Decompressing expected output: " + expectedOutputPath); + decompressedExpectedPath = Util.getDecompressedFile(expectedOutputPathStr, expectedCompression); + } + + Resource actualCompression = getCompressionFromFileName(out); + String decompressedActualPath = actualOutputPathStr; + if (actualCompression != RML.none && Files.exists(actualOutputPath)) { + System.out.println("Decompressing actual output: " + actualOutputPath); + decompressedActualPath = Util.getDecompressedFile(actualOutputPathStr, actualCompression); + } + + boolean isNFormat = out.endsWith(".nt") || out.endsWith(".nq") + || out.matches(".*\\.(nt|nq)(\\..*)?"); + boolean isJsonFormat = out.endsWith(".json") || out.endsWith(".jsonld") || out.endsWith(".rdfjson"); + + try { + DatasetGraph expected = loadDataset(decompressedExpectedPath); + DatasetGraph actual = loadDataset(decompressedActualPath); + + boolean isIsomorphic = IsoMatcher.isomorphic(expected, actual); + if (!isIsomorphic) { + System.out.println("--- Expected"); + RDFDataMgr.write(System.out, expected, Lang.TRIG); + System.out.println("--- Actual"); + RDFDataMgr.write(System.out, actual, Lang.TRIG); + } + + System.out.println("Isomorphic? " + (isIsomorphic ? "OK" : "NOK")); + Assertions.assertTrue(isIsomorphic, "is not isomorphic"); + } catch (Exception e) { + if (isNFormat) { + System.out.println("RDF parsing failed, falling back to line-by-line comparison: " + e.getMessage()); + + String expectedData = Files.readString(Paths.get(decompressedExpectedPath)); + String actualData = Files.readString(Paths.get(decompressedActualPath)); + + List expectedLines = normalizeAndDeduplicateLines(expectedData); + List actualLines = normalizeAndDeduplicateLines(actualData); + + if (expectedLines.equals(actualLines)) { + System.out.println("Line comparison: OK - Matched by normalized line-by-line comparison"); + } else { + System.out.println("--- Expected (normalized)"); + expectedLines.forEach(System.out::println); + System.out.println("--- Actual (normalized)"); + actualLines.forEach(System.out::println); + System.out.println("--- Actual (raw)"); + System.out.println(actualData); + throw new RuntimeException("Expected and actual do not match in line-by-line comparison for " + out, e); + } + } else if (isJsonFormat) { + System.out.println("JSON parsing failed, falling back to deep JSON comparison: " + e.getMessage()); + + String expectedData = Files.readString(Paths.get(decompressedExpectedPath)); + String actualData = Files.readString(Paths.get(decompressedActualPath)); + + var expectedJson = JsonParser.parseString(expectedData); + var actualJson = JsonParser.parseString(actualData); + + if (expectedJson.equals(actualJson)) { + System.out.println("JSON comparison: OK - Matched by deep JSON comparison"); + } else { + System.out.println("--- Expected (JSON)"); + System.out.println(expectedJson); + System.out.println("--- Actual (JSON)"); + System.out.println(actualJson); + throw new RuntimeException("Expected and actual do not match in deep JSON comparison for " + out, e); + } + } else { + throw e; + } + } + } + + System.out.println("Exit code: " + exit); + + Model report = RDFDataMgr.loadModel(reportPath); + long countErrors = getCountErrors(report); + List errorTypes = getErrorTypes(report); + if (countErrors > 0) { + System.out.println("Error types: " + errorTypes); + } + } + + @ParameterizedTest + @MethodSource("testDataProviderNotOK") + public void testForNotOK(TestData testData) throws Exception { + printTestHeader(testData); + prepareSource(testData); + testForNotOK(testData, getPath(testData, testData.mapping).toAbsolutePath().toString()); + } + + public void testForNotOK(TestData testData, String mappingPath) throws Exception { + String resultPath = Files.createTempFile(null, ".nq").toString(); + String reportPath = Files.createTempFile("report_" + testData.ID, ".nq").toString(); + System.out.printf("Writing output to %s%n", resultPath); + + Path cwd = Paths.get(getBase(), testData.ID).toAbsolutePath().normalize(); + int exit = Main.doMain( + new String[]{ + "-m", mappingPath, + "-o", resultPath, + "--baseIRI", testData.baseIRI, + "--reportFile", reportPath + }, + cwd + ); + + long outputFileSize = Files.size(Paths.get(resultPath)); + System.out.println(outputFileSize == 0L ? "No output file" : "Output file is not empty"); + + if (outputFileSize != 0L) { + Model actual = RDFDataMgr.loadModel(resultPath); + System.out.println("--- Actual"); + actual.write(System.out, "NQ"); + } + + Model report = RDFDataMgr.loadModel(reportPath); + System.out.println("--- Report"); + report.write(System.out, "Turtle"); + + Path errorCsv = Paths.get(getBase(), "error.csv"); + if (!Files.exists(errorCsv)) Files.createFile(errorCsv); + try (CSVWriter writer = new CSVWriter(Files.newBufferedWriter(errorCsv, StandardOpenOption.APPEND))) { + writer.writeNext(new String[]{testData.ID}); + writer.flush(); + } + + Assertions.assertTrue(exit > 0); + Assertions.assertFalse(report.isEmpty()); + + long countErrors = getCountErrors(report); + List errorTypes = getErrorTypes(report); + + System.out.println("Error types: " + errorTypes); + Assertions.assertTrue(countErrors > 0, "Expected at least 1 error, but got " + countErrors); + + checkExpectedErrors(testData, errorTypes); + + System.out.println(); + + try (CSVWriter writer = new CSVWriter(Files.newBufferedWriter(errorCsv, StandardOpenOption.APPEND))) { + List nextLine = new ArrayList<>(); + nextLine.add(testData.ID); + nextLine.add(testData.title); + nextLine.add(String.valueOf(countErrors)); + nextLine.addAll(errorTypes); + writer.writeNext(nextLine.toArray(new String[0])); + writer.flush(); + } + } + + + private DatasetGraph loadDataset(String path) throws RiotException { + if (path.endsWith(".rdfjson")) { + return RDFDataMgr.loadDatasetGraph(path, Lang.RDFJSON); + } + if (path.endsWith(".rdfxml")) { + return RDFDataMgr.loadDatasetGraph(path, Lang.RDFXML); + } + return RDFDataMgr.loadDatasetGraph(path); + } + + private static long getCountErrors(Model report) { + String countQueryString = + "PREFIX rer: <" + RER.NS + ">\n" + + "SELECT (COUNT(?error) AS ?count) WHERE {\n" + + " ?s rer:hasError ?error .\n" + + "}"; + + long countErrors = 0; + try (QueryExecution qexec = QueryExecutionFactory.create(countQueryString, report)) { + ResultSet results = qexec.execSelect(); + if (results.hasNext()) { + QuerySolution soln = results.nextSolution(); + countErrors = soln.getLiteral("count").getLong(); + } + } + return countErrors; + } + + private static List getErrorTypes(Model report) { + String typeQueryString = + "PREFIX rer: <" + RER.NS + ">\n" + + "PREFIX rdf: \n" + + "SELECT ?type WHERE {\n" + + " ?s rer:hasError ?error .\n" + + " ?error rdf:type ?type .\n" + + "}"; + List errorTypes = new ArrayList<>(); + try (QueryExecution qexec = QueryExecutionFactory.create(typeQueryString, report)) { + ResultSet results = qexec.execSelect(); + while (results.hasNext()) { + QuerySolution soln = results.nextSolution(); + Resource typeInfo = soln.getResource("type"); + if (typeInfo != null) { + errorTypes.add(typeInfo.getLocalName()); + } + } + } + return errorTypes; + } + + private void checkExpectedErrors(TestData testData, List errorTypes) throws IOException, CsvException { + Path expectedErrorsCsv = Paths.get("src/test/resources/burp/errors.csv").toAbsolutePath().normalize(); + if (Files.exists(expectedErrorsCsv)) { + try (CSVReaderHeaderAware reader = new CSVReaderHeaderAware(new FileReader(expectedErrorsCsv.toFile()))) { + Map record; + while ((record = reader.readMap()) != null) { + if (testData.ID.equals(record.get("TestCaseId"))) { + String expectedRerError = record.get("RerError"); + if (expectedRerError != null && !expectedRerError.isBlank()) { + boolean match = errorTypes.contains(expectedRerError); + // TODO: In the future, we can expand this to check for subclasses + // by loading the RER ontology and checking rdfs:subClassOf + Assertions.assertTrue(match, + "Expected error type " + expectedRerError + " not found in actual error types: " + errorTypes); + } + } + } + } + } + } + + private static List normalizeAndDeduplicateLines(String data) { + Set normalizedLines = new HashSet<>(); + String[] lines = data.trim().split("\n"); + for (String line : lines) { + String trimmed = line.trim(); + if (!trimmed.isEmpty()) { + String normalized = trimmed.replaceAll("\\s+", " "); + normalizedLines.add(normalized); + } + } + List sorted = new ArrayList<>(normalizedLines); + Collections.sort(sorted); + return sorted; + } +} diff --git a/src/test/java/burp/tools/FetchTestCases.java b/src/test/java/burp/tools/FetchTestCases.java new file mode 100644 index 0000000..b6614bd --- /dev/null +++ b/src/test/java/burp/tools/FetchTestCases.java @@ -0,0 +1,226 @@ +package burp.tools; + +import org.jspecify.annotations.NonNull; + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/** + * Cross-platform fetcher that downloads RML module repositories as ZIP archives + * (no need for Git installed), extracts them, copies test-cases and shapes + * into this project, and cleans up temporary files. + * + * Usage (recommended via Maven): + * mvn -q -DskipTests=true -Dexec.mainClass=burp.tools.FetchTestCases exec:java + */ +public class FetchTestCases { + + public static void main(String[] args) { + Path root = Paths.get("."); + run( + root.resolve("src/test/resources"), + root.resolve("src/main/resources/shapes"), + root.resolve("src/main/resources/vocabularies/rml/") + ); + } + + public static void run(Path testCasesDir, Path shapesDir, Path vocabulariesDir) { + List repos = List.of( + "rml-core", + "rml-cc", + "rml-io", + "rml-fnml", + "rml-lv", + "rml-io-registry" + ); + + for (String repo : repos) { + String base = "https://github.com/kg-construct/" + repo; + String zipMain = base + "/archive/refs/heads/main.zip"; + String zipMaster = base + "/archive/refs/heads/master.zip"; + + try { + System.out.println("Downloading and extracting " + repo + " …"); + Path tempDir = Files.createTempDirectory("burp-fetch-" + repo); + + try { + if (!downloadWithFallback(zipMain, zipMaster, tempDir)) { + System.err.println("• Failed to download " + repo + " (main/master not found). Skipping."); + continue; + } + + // GitHub zip contains a single top-level directory named like - + Path innerRoot; + try (var stream = Files.list(tempDir)) { + innerRoot = stream.filter(Files::isDirectory).findFirst().orElse(tempDir); + } + + // Copy test-cases + Path srcTestCases = innerRoot.resolve("test-cases"); + if (testCasesDir == null) { + System.out.println("• Skipped " + repo + " test-cases (destination not configured)"); + } else if (Files.isDirectory(srcTestCases)) { + Path destTestCases = testCasesDir.resolve(repo); + Files.createDirectories(destTestCases); + copyDir(srcTestCases, destTestCases); + System.out.println("• Copied test-cases: " + srcTestCases + " -> " + destTestCases); + } else { + System.out.println("• Skipped " + repo + " (no test-cases directory found)"); + } + + // Copy shapes + Path srcShapes = innerRoot.resolve("shapes"); + if (shapesDir == null) { + System.out.println("• Skipped " + repo + " shapes (destination not configured)"); + } else if (Files.isDirectory(srcShapes)) { + Path destShapes = shapesDir.resolve(repo); + Files.createDirectories(destShapes); + copyDir(srcShapes, destShapes); + System.out.println("• Copied shapes: " + srcShapes + " -> " + destShapes); + } else { + System.out.println("• Skipped " + repo + " (no shapes directory found)"); + } + + // Copy vocabulary + Path srcVoc = innerRoot.resolve("ontology/" + repo + ".owl"); + if (vocabulariesDir == null) { + System.out.println("• Skipped " + repo + " vocabulary (destination not configured)"); + } else if (Files.exists(srcVoc)) { + Path destVoc = vocabulariesDir.resolve(repo + ".owl"); + Files.createDirectories(vocabulariesDir); + Files.copy(srcVoc, destVoc, StandardCopyOption.REPLACE_EXISTING); + System.out.println("• Copied vocabulary: " + srcVoc + " -> " + destVoc); + } else { + System.out.println("• Skipped " + repo + " (no ontology file found)"); + } + + } finally { + // Cleanup extracted content + safeDeleteRecursively(tempDir); + } + } catch (Exception e) { + System.err.println(); + System.err.println("Error occurred while processing " + repo + "."); + System.err.println("• Check the repository URLs and your internet connection."); + System.err.println("Details: " + e.getMessage()); + } + } + + System.out.println("Done."); + } + + private static boolean downloadWithFallback(String url1, String url2, Path dest) { + try { + return downloadAndExtract(url1, dest); + } catch (IOException e) { + try { + return downloadAndExtract(url2, dest); + } catch (IOException ex) { + return false; + } + } + } + + private static boolean downloadAndExtract(String urlStr, Path destDir) throws IOException { + try { + URI uri = new URI(urlStr); + URL url = uri.toURL(); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setConnectTimeout(20000); + conn.setReadTimeout(60000); + conn.setRequestMethod("GET"); + conn.setRequestProperty("Accept", "application/zip"); + + int code = conn.getResponseCode(); + if (code < 200 || code >= 300) { + try (InputStream is = conn.getErrorStream()) { + if (is != null) is.close(); + } + return false; + } + + Files.createDirectories(destDir); + try (InputStream is = conn.getInputStream(); + BufferedInputStream bis = new BufferedInputStream(is)) { + unzipStream(bis, destDir); + } + return true; + } catch (URISyntaxException e) { + throw new IOException(e); + } + } + + private static void unzipStream(InputStream input, Path destDir) throws IOException { + try (ZipInputStream zis = new ZipInputStream(input)) { + ZipEntry entry = zis.getNextEntry(); + while (entry != null) { + Path outPath = destDir.resolve(entry.getName()).normalize(); + // Prevent Zip Slip + if (!outPath.startsWith(destDir)) { + throw new IOException("Bad zip entry: " + entry.getName()); + } + if (entry.isDirectory()) { + Files.createDirectories(outPath); + } else { + Files.createDirectories(outPath.getParent()); + copyStream(zis, outPath); + } + zis.closeEntry(); + entry = zis.getNextEntry(); + } + } + } + + private static void copyStream(InputStream input, Path dest) throws IOException { + try (OutputStream out = Files.newOutputStream(dest, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) { + input.transferTo(out); + } + } + + private static void copyDir(Path src, Path dest) throws IOException { + Files.walkFileTree(src, new SimpleFileVisitor<>() { + @Override + public @NonNull FileVisitResult preVisitDirectory(@NonNull Path dir, @NonNull BasicFileAttributes attrs) throws IOException { + Path target = dest.resolve(src.relativize(dir)); + Files.createDirectories(target); + return FileVisitResult.CONTINUE; + } + + @Override + public @NonNull FileVisitResult visitFile(@NonNull Path file, @NonNull BasicFileAttributes attrs) throws IOException { + Path target = dest.resolve(src.relativize(file)); + Files.createDirectories(target.getParent()); + Files.copy(file, target, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES); + return FileVisitResult.CONTINUE; + } + }); + } + + private static void safeDeleteRecursively(Path path) throws IOException { + if (!Files.exists(path)) return; + Files.walkFileTree(path, new SimpleFileVisitor<>() { + @Override + public @NonNull FileVisitResult visitFile(@NonNull Path file, @NonNull BasicFileAttributes attrs) throws IOException { + Files.deleteIfExists(file); + return FileVisitResult.CONTINUE; + } + + @Override + public @NonNull FileVisitResult postVisitDirectory(@NonNull Path dir, IOException exc) throws IOException { + Files.deleteIfExists(dir); + return FileVisitResult.CONTINUE; + } + }); + } +} diff --git a/src/test/java/turtleprov/AbstractManifestTest.java b/src/test/java/turtleprov/AbstractManifestTest.java new file mode 100644 index 0000000..5540ce5 --- /dev/null +++ b/src/test/java/turtleprov/AbstractManifestTest.java @@ -0,0 +1,199 @@ +package turtleprov; + +import burp.parse.turtleprov.ProvStore; +import burp.parse.turtleprov.RDF12Converter; +import burp.parse.turtleprov.TurtleProvParser; +import org.apache.jena.query.QueryExecution; +import org.apache.jena.query.QueryExecutionFactory; +import org.apache.jena.query.QueryFactory; +import org.apache.jena.query.ResultSet; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.RDFList; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.vocabulary.RDF; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import turtleprov.manifest.RdfManifest; +import turtleprov.manifest.RdfTest; + +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.stream.Stream; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public abstract class AbstractManifestTest { + + public abstract Path rootManifestFile(); + public abstract boolean filterRdf11(); + + public static class TestInfo { + public final String testUri; + public final String name; + public final Path actionFile; + public final Path resultFile; + + public TestInfo(String testUri, String name, Path actionFile, Path resultFile) { + this.testUri = testUri; + this.name = name; + this.actionFile = actionFile; + this.resultFile = resultFile; + } + + @Override + public String toString() { + return name + " (" + actionFile.getFileName() + ")"; + } + } + + // Recursively find all manifests starting from a root manifest file + private List loadAllManifests(Path manifestFile, Set visited) { + Path canonical = manifestFile.toAbsolutePath().normalize(); + if (!visited.add(canonical)) return Collections.emptyList(); + + // If filterRdf11 is true, skip loading manifest files under rdf11/ + if (filterRdf11() && canonical.toString().contains("rdf11/")) { + return Collections.emptyList(); + } + + List list = new ArrayList<>(); + list.add(canonical); + + Model model; + try { + model = RDFDataMgr.loadModel(canonical.toString()); + } catch (Exception e) { + return list; + } + + Property includeProp = model.createProperty(RdfManifest.include); + Resource manifestType = model.createResource(RdfManifest.Manifest); + var manifests = model.listResourcesWithProperty(RDF.type, manifestType); + + while (manifests.hasNext()) { + Resource m = manifests.next(); + var prop = m.getProperty(includeProp); + if (prop != null && prop.getObject() != null) { + var includeNode = prop.getObject(); + if (includeNode.canAs(RDFList.class)) { + RDFList rdfList = includeNode.as(RDFList.class); + for (var node : rdfList.asJavaList()) { + if (node.isResource()) { + String uri = node.asResource().getURI(); + if (uri != null && uri.startsWith("file:")) { + Path file = Paths.get(URI.create(uri)); + list.addAll(loadAllManifests(file, visited)); + } + } + } + } + } + } + return list; + } + + private List getTestsOfType(String typeUri) { + List manifests = loadAllManifests(rootManifestFile(), new HashSet<>()); + List list = new ArrayList<>(); + + String queryStr = + "PREFIX rdf: \n" + + "PREFIX mf: <" + RdfManifest.NS + ">\n" + + "PREFIX rdft: <" + RdfTest.NS + ">\n" + + "\n" + + "SELECT ?test ?name ?action ?result WHERE {\n" + + " ?manifest rdf:type mf:Manifest .\n" + + " ?manifest mf:entries ?entries .\n" + + " ?entries rdf:rest*/rdf:first ?test .\n" + + " ?test rdf:type <" + typeUri + "> .\n" + + " ?test mf:name ?name .\n" + + " ?test mf:action ?action .\n" + + " OPTIONAL { ?test mf:result ?result }\n" + + "}"; + + var query = QueryFactory.create(queryStr); + + for (Path manifestFile : manifests) { + Model model = RDFDataMgr.loadModel(manifestFile.toString()); + try (QueryExecution qexec = QueryExecutionFactory.create(query, model)) { + ResultSet results = qexec.execSelect(); + while (results.hasNext()) { + var soln = results.nextSolution(); + String testUri = soln.getResource("test").getURI(); + String name = soln.getLiteral("name").getString(); + Resource actionNode = soln.getResource("action"); + Path actionFile = Paths.get(URI.create(actionNode.getURI())); + Resource resultNode = soln.getResource("result"); + Path resultFile = resultNode != null ? Paths.get(URI.create(resultNode.getURI())) : null; + list.add(new TestInfo(testUri, name, actionFile, resultFile)); + } + } + } + return list; + } + + public Stream positiveSyntaxTests() { + return getTestsOfType(RdfTest.TestTurtlePositiveSyntax) + .stream().map(Arguments::of); + } + + public Stream negativeSyntaxTests() { + return getTestsOfType(RdfTest.TestTurtleNegativeSyntax) + .stream().map(Arguments::of); + } + + public Stream evalTests() { + return getTestsOfType(RdfTest.TestTurtleEval) + .stream().map(Arguments::of); + } + + public Stream negativeEvalTests() { + return getTestsOfType(RdfTest.TestTurtleNegativeEval) + .stream().map(Arguments::of); + } + + + + @ParameterizedTest(name = "{0}") + @MethodSource("positiveSyntaxTests") + public void testPositiveSyntax(TestInfo info) throws Exception { + TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("negativeSyntaxTests") + public void testNegativeSyntax(TestInfo info) throws Exception { + ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); + Assertions.assertFalse(store.getSyntaxErrors().isEmpty(), "Expected syntax errors but none were found"); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("evalTests") + public void testEvaluation(TestInfo info) throws Exception { + ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); + Model actionModel = RDF12Converter.toModel(store, false); + Model expectedModel = RDFDataMgr.loadModel(info.resultFile.toString()); + Assertions.assertTrue(expectedModel.isIsomorphicWith(actionModel), () -> + "Expected isomorphic models for test " + info.name + ".\nExpected:\n" + expectedModel + "\nActual:\n" + actionModel + ); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("negativeEvalTests") + public void testNegativeEvaluation(TestInfo info) { + try { + ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); + Assertions.assertTrue(store.triples.isEmpty() || !store.getSyntaxErrors().isEmpty()); + } catch (Exception e) { + // Expected parsing/evaluation failure + return; + } + } +} diff --git a/src/test/java/turtleprov/Rdf11ManifestTest.java b/src/test/java/turtleprov/Rdf11ManifestTest.java new file mode 100644 index 0000000..699da24 --- /dev/null +++ b/src/test/java/turtleprov/Rdf11ManifestTest.java @@ -0,0 +1,16 @@ +package turtleprov; + +import java.nio.file.Path; +import java.nio.file.Paths; + +public class Rdf11ManifestTest extends AbstractManifestTest { + @Override + public Path rootManifestFile() { + return Paths.get("src/test/resources/rdf-tests/rdf/rdf11/rdf-turtle/manifest.ttl"); + } + + @Override + public boolean filterRdf11() { + return false; + } +} diff --git a/src/test/java/turtleprov/Rdf12ManifestTest.java b/src/test/java/turtleprov/Rdf12ManifestTest.java new file mode 100644 index 0000000..30c1f16 --- /dev/null +++ b/src/test/java/turtleprov/Rdf12ManifestTest.java @@ -0,0 +1,16 @@ +package turtleprov; + +import java.nio.file.Path; +import java.nio.file.Paths; + +public class Rdf12ManifestTest extends AbstractManifestTest { + @Override + public Path rootManifestFile() { + return Paths.get("src/test/resources/rdf-tests/rdf/rdf12/rdf-turtle/manifest.ttl"); + } + + @Override + public boolean filterRdf11() { + return true; + } +} diff --git a/src/test/java/turtleprov/TurtleParserTest.java b/src/test/java/turtleprov/TurtleParserTest.java new file mode 100644 index 0000000..2916416 --- /dev/null +++ b/src/test/java/turtleprov/TurtleParserTest.java @@ -0,0 +1,281 @@ +package turtleprov; + +import burp.parse.turtleprov.ProvStore; +import burp.parse.turtleprov.ProvTriple; +import burp.parse.turtleprov.TurtleNodeKind; +import burp.parse.turtleprov.TurtleProvParser; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.vocabulary.XSD; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertFalse; + +public class TurtleParserTest { + + private static ProvStore parseTurtleFromString(String turtleContent) { + return TurtleProvParser.parseTurtleFromString(turtleContent); + } + + @Test + public void testParsesASimpleTurtleTripleWithProvenance() { + String turtle = + """ + @prefix ex: . + ex:alice ex:knows ex:bob . + """; + + ProvStore store = parseTurtleFromString(turtle); + + Assertions.assertEquals(1, store.getTriples().size()); + Assertions.assertEquals("http://example.com/", store.getPrefixes().get("ex")); + + ProvTriple provTriple = store.getTriples().iterator().next(); + Assertions.assertEquals("http://example.com/alice", provTriple.statement().getSubject().getURI()); + Assertions.assertEquals("http://example.com/knows", provTriple.statement().getPredicate().getURI()); + Assertions.assertEquals("http://example.com/bob", provTriple.statement().getObject().asResource().getURI()); + + Assertions.assertNotNull(provTriple.subjectInfo()); + Assertions.assertNotNull(provTriple.predicateInfo()); + Assertions.assertNotNull(provTriple.objectInfo()); + } + + @Test + public void testParsesTypedLiteral() { + String turtle = """ + @prefix ex: . + ex:alice ex:age 42 . + """; + + ProvStore store = parseTurtleFromString(turtle); + + Assertions.assertEquals(1, store.getTriples().size()); + var obj = store.getTriples().iterator().next().statement().getObject(); + Assertions.assertTrue(obj.isLiteral()); + Literal literal = obj.asLiteral(); + Assertions.assertEquals("42", literal.getLexicalForm()); + Assertions.assertEquals("http://www.w3.org/2001/XMLSchema#int", literal.getDatatypeURI()); + } + + @Test + public void testParsesRMLTC0000JSONFixtureInCommonTest() { + String fixture = + """ + @prefix foaf: . + @prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:iterator "$.students[*]"; + rml:referenceFormulation rml:JSONPath; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.json" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.Name" + ]; + rml:predicate foaf:name + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.Name}" + ] . + """; + + ProvStore store = parseTurtleFromString(fixture); + + Assertions.assertEquals("http://xmlns.com/foaf/0.1/", store.getPrefixes().get("foaf")); + Assertions.assertEquals("http://w3id.org/rml/", store.getPrefixes().get("rml")); + Assertions.assertTrue(store.getTriples().size() >= 8); + + boolean found = false; + for (ProvTriple provTriple : store.getTriples()) { + if ("http://example.com/base/TriplesMap1".equals(provTriple.statement().getSubject().getURI()) && + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type".equals(provTriple.statement().getPredicate().getURI()) && + provTriple.statement().getObject().isResource() && + "http://w3id.org/rml/TriplesMap".equals(provTriple.statement().getObject().asResource().getURI())) { + found = true; + break; + } + } + Assertions.assertTrue(found); + } + + private static class ParseResult { + final Literal literal; + final ProvTriple provTriple; + final String line; + + ParseResult(Literal literal, ProvTriple provTriple, String line) { + this.literal = literal; + this.provTriple = provTriple; + this.line = line; + } + } + + private ParseResult parseSingleLiteral(String predicateLocalName, String objectSyntax) { + String turtle = """ + @prefix ex: . + @prefix xsd: . + ex:s ex:%s %s . + """.formatted(predicateLocalName, objectSyntax); + + ProvStore store = parseTurtleFromString(turtle); + ProvTriple matched = null; + for (ProvTriple t : store.getTriples()) { + if (("http://example.com/" + predicateLocalName).equals(t.statement().getPredicate().getURI())) { + matched = t; + break; + } + } + Assertions.assertNotNull(matched); + Literal literal = matched.statement().getObject().asLiteral(); + String targetLine = turtle.split("\n")[2]; + return new ParseResult(literal, matched, targetLine); + } + + private void assertLiteralObjectProvenance( + ProvTriple provTriple, + String line, + TurtleNodeKind expectedKind, + String expectedLiteralToken, + String expectedLiteralContent + ) { + var objectInfo = provTriple.objectInfo(); + Assertions.assertNotNull(objectInfo); + var start = objectInfo.start(); + var end = objectInfo.end(); + Assertions.assertNotNull(start); + Assertions.assertNotNull(end); + + Assertions.assertEquals(expectedKind, objectInfo.kind()); + Assertions.assertEquals(2, start.line()); + Assertions.assertEquals(2, end.line()); + Assertions.assertTrue(start.column() <= end.column()); + Assertions.assertEquals(expectedLiteralToken, line.substring(start.column(), end.column())); + + var stringStart = objectInfo.rdfLiteralStringStart(); + var stringEnd = objectInfo.rdfLiteralStringEnd(); + Assertions.assertNotNull(stringStart); + Assertions.assertNotNull(stringEnd); + Assertions.assertEquals(2, stringStart.line()); + Assertions.assertEquals(2, stringEnd.line()); + Assertions.assertTrue(stringStart.column() <= stringEnd.column()); + Assertions.assertEquals(expectedLiteralContent, line.substring(stringStart.column(), stringEnd.column())); + } + + @Test + public void testParsesRdfLiteralWithDoubleQuotesAndProvenanceSpans() { + ParseResult res = parseSingleLiteral("plain", "\"double\""); + Assertions.assertEquals("double", res.literal.getLexicalForm()); + Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + assertLiteralObjectProvenance( + res.provTriple, + res.line, + TurtleNodeKind.STRING_LITERAL_QUOTE, + "\"double\"", + "double" + ); + } + + @Test + public void testParsesRdfLiteralWithSingleQuotesAndProvenanceSpans() { + ParseResult res = parseSingleLiteral("single", "'single'"); + Assertions.assertEquals("single", res.literal.getLexicalForm()); + Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + assertLiteralObjectProvenance( + res.provTriple, + res.line, + TurtleNodeKind.STRING_LITERAL_SINGLE_QUOTE, + "'single'", + "single" + ); + } + + @Test + public void testParsesRdfLiteralWithLongDoubleQuotesAndProvenanceSpans() { + ParseResult res = parseSingleLiteral("longDouble", "\"\"\"long double\"\"\""); + Assertions.assertEquals("long double", res.literal.getLexicalForm()); + Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + assertLiteralObjectProvenance( + res.provTriple, + res.line, + TurtleNodeKind.STRING_LITERAL_LONG_QUOTE, + "\"\"\"long double\"\"\"", + "long double" + ); + } + + @Test + public void testParsesRdfLiteralWithLongSingleQuotesAndProvenanceSpans() { + ParseResult res = parseSingleLiteral("longSingle", "'''long single'''"); + Assertions.assertEquals("long single", res.literal.getLexicalForm()); + Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + assertLiteralObjectProvenance( + res.provTriple, + res.line, + TurtleNodeKind.STRING_LITERAL_LONG_SINGLE_QUOTE, + "'''long single'''", + "long single" + ); + } + + @Test + public void testParsesRdfLiteralWithLanguageTagAndProvenanceSpans() { + ParseResult res = parseSingleLiteral("lang", "\"Bonjour\"@fr"); + Assertions.assertEquals("Bonjour", res.literal.getLexicalForm()); + Assertions.assertEquals("fr", res.literal.getLanguage()); + assertLiteralObjectProvenance( + res.provTriple, + res.line, + TurtleNodeKind.STRING_LITERAL_QUOTE, + "\"Bonjour\"@fr", + "Bonjour" + ); + } + + @Test + public void testParsesRdfLiteralWithDatatypeAndProvenanceSpans() { + ParseResult res = parseSingleLiteral("typed", "\"42\"^^xsd:integer"); + Assertions.assertEquals("42", res.literal.getLexicalForm()); + Assertions.assertEquals("http://www.w3.org/2001/XMLSchema#integer", res.literal.getDatatypeURI()); + assertLiteralObjectProvenance( + res.provTriple, + res.line, + TurtleNodeKind.STRING_LITERAL_QUOTE, + "\"42\"^^xsd:integer", + "42" + ); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("rmlMappingFiles") + public void testParsesRmlMappingFiles(Path mappingFile) throws Exception { + String content = Files.readString(mappingFile); + ProvStore store = parseTurtleFromString(content); + + assertFalse(store.getTriples().isEmpty(), + "Expected some triples to be parsed in " + mappingFile); + } + + + public static Stream rmlMappingFiles() throws Exception { + Path resourcesPath = Paths.get("src/test/resources"); + if (!Files.exists(resourcesPath)) return Stream.empty(); + + return Files.walk(resourcesPath) + .filter(p -> p.toString().contains("rml-")) + .filter(p -> p.toString().endsWith("mapping.ttl")) + .map(Arguments::of); + } +} diff --git a/src/test/java/turtleprov/manifest/RdfManifest.java b/src/test/java/turtleprov/manifest/RdfManifest.java new file mode 100644 index 0000000..00d5833 --- /dev/null +++ b/src/test/java/turtleprov/manifest/RdfManifest.java @@ -0,0 +1,47 @@ +package turtleprov.manifest; + +/** Generated vocabulary object for RdfManifest. */ +public final class RdfManifest { + public static final String NS = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#"; + + public static final String Manifest = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#Manifest"; + public static final String ManifestEntry = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#ManifestEntry"; + public static final String NegativeSyntaxTest = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#NegativeSyntaxTest"; + public static final String NegativeSyntaxTest11 = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#NegativeSyntaxTest11"; + public static final String NegativeUpdateSyntaxTest = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#NegativeUpdateSyntaxTest"; + public static final String NegativeUpdateSyntaxTest11 = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#NegativeUpdateSyntaxTest11"; + public static final String Notable = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#Notable"; + public static final String PositiveSyntaxTest = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#PositiveSyntaxTest"; + public static final String PositiveSyntaxTest11 = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#PositiveSyntaxTest11"; + public static final String PositiveUpdateSyntaxTest = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#PositiveUpdateSyntaxTest"; + public static final String PositiveUpdateSyntaxTest11 = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#PositiveUpdateSyntaxTest11"; + public static final String QueryEvaluationTest = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#QueryEvaluationTest"; + public static final String Requirement = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#Requirement"; + public static final String ResultCardinality = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#ResultCardinality"; + public static final String TestStatus = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#TestStatus"; + public static final String UpdateEvaluationTest = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#UpdateEvaluationTest"; + public static final String action = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#action"; + public static final String assumedTestBase = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#assumedTestBase"; + public static final String conformanceRequirement = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#conformanceRequirement"; + public static final String entries = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#entries"; + public static final String include = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#include"; + public static final String includedSpecifications = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#includedSpecifications"; + public static final String name = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#name"; + public static final String notable = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#notable"; + public static final String requires = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#requires"; + public static final String result = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#result"; + public static final String resultCardinality = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#resultCardinality"; + public static final String specVersion = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#specVersion"; + public static final String IllFormedLiteral = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#IllFormedLiteral"; + public static final String KnownTypesDefault2Neq = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#KnownTypesDefault2Neq"; + public static final String LangTagAwareness = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#LangTagAwareness"; + public static final String LaxCardinality = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#LaxCardinality"; + public static final String NoCanonicalizationOfNumerics = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#NoCanonicalizationOfNumerics"; + public static final String StringSimpleLiteralCmp = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#StringSimpleLiteralCmp"; + public static final String XsdDateOperations = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#XsdDateOperations"; + public static final String accepted = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#accepted"; + public static final String proposed = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#proposed"; + public static final String rejected = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#rejected"; + + private RdfManifest() {} +} diff --git a/src/test/java/turtleprov/manifest/RdfTest.java b/src/test/java/turtleprov/manifest/RdfTest.java new file mode 100644 index 0000000..fbb6e9d --- /dev/null +++ b/src/test/java/turtleprov/manifest/RdfTest.java @@ -0,0 +1,33 @@ +package turtleprov.manifest; + +/** Generated vocabulary object for RdfTest. */ +public final class RdfTest { + public static final String NS = "http://www.w3.org/ns/rdftest#"; + + public static final String Approval = "http://www.w3.org/ns/rdftest#Approval"; + public static final String Approved = "http://www.w3.org/ns/rdftest#Approved"; + public static final String Proposed = "http://www.w3.org/ns/rdftest#Proposed"; + public static final String Rejected = "http://www.w3.org/ns/rdftest#Rejected"; + public static final String Test = "http://www.w3.org/ns/rdftest#Test"; + public static final String TestC14N = "http://www.w3.org/ns/rdftest#TestC14N"; + public static final String TestEval = "http://www.w3.org/ns/rdftest#TestEval"; + public static final String TestNQuadsNegativeSyntax = "http://www.w3.org/ns/rdftest#TestNQuadsNegativeSyntax"; + public static final String TestNQuadsPositiveSyntax = "http://www.w3.org/ns/rdftest#TestNQuadsPositiveSyntax"; + public static final String TestNTriplesNegativeSyntax = "http://www.w3.org/ns/rdftest#TestNTriplesNegativeSyntax"; + public static final String TestNTriplesPositiveC14N = "http://www.w3.org/ns/rdftest#TestNTriplesPositiveC14N"; + public static final String TestNTriplesPositiveSyntax = "http://www.w3.org/ns/rdftest#TestNTriplesPositiveSyntax"; + public static final String TestSyntax = "http://www.w3.org/ns/rdftest#TestSyntax"; + public static final String TestTriGNegativeSyntax = "http://www.w3.org/ns/rdftest#TestTriGNegativeSyntax"; + public static final String TestTriGPositiveSyntax = "http://www.w3.org/ns/rdftest#TestTriGPositiveSyntax"; + public static final String TestTrigEval = "http://www.w3.org/ns/rdftest#TestTrigEval"; + public static final String TestTrigNegativeEval = "http://www.w3.org/ns/rdftest#TestTrigNegativeEval"; + public static final String TestTurtleEval = "http://www.w3.org/ns/rdftest#TestTurtleEval"; + public static final String TestTurtleNegativeEval = "http://www.w3.org/ns/rdftest#TestTurtleNegativeEval"; + public static final String TestTurtleNegativeSyntax = "http://www.w3.org/ns/rdftest#TestTurtleNegativeSyntax"; + public static final String TestTurtlePositiveSyntax = "http://www.w3.org/ns/rdftest#TestTurtlePositiveSyntax"; + public static final String TestXMLNegativeSyntax = "http://www.w3.org/ns/rdftest#TestXMLNegativeSyntax"; + public static final String XMLEval = "http://www.w3.org/ns/rdftest#XMLEval"; + public static final String approval = "http://www.w3.org/ns/rdftest#approval"; + + private RdfTest() {} +} diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-Concat/mapping.ttl b/src/test/resources/burp/BURPFNMLTC-CSV-Concat/mapping.ttl new file mode 100644 index 0000000..2ca7e21 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-Concat/mapping.ttl @@ -0,0 +1,25 @@ +@prefix foaf: . +@prefix rml: . +@prefix idlab-fn: . +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; rml:root rml:MappingDirectory; rml:path "student.csv" ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ rml:template "http://example.com/{Id}" ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return idlab-fn:_stringOut + ] + ] . + +<#Execution> + rml:function idlab-fn:concat ; + rml:input + [ rml:parameter idlab-fn:str ; rml:inputValueMap [ rml:reference "Name" ] ], + [ rml:parameter idlab-fn:otherStr ; rml:inputValueMap [ rml:reference "Class" ] ], + [ rml:parameter idlab-fn:delimiter ; rml:inputValueMap [ rml:constant " - " ] ] . \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-Concat/output.nq b/src/test/resources/burp/BURPFNMLTC-CSV-Concat/output.nq new file mode 100644 index 0000000..ae89378 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-Concat/output.nq @@ -0,0 +1 @@ + "Gaston - A" . diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-Concat/student.csv b/src/test/resources/burp/BURPFNMLTC-CSV-Concat/student.csv new file mode 100644 index 0000000..e14d3a3 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-Concat/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Gaston,A&B,A \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/mapping.ttl b/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/mapping.ttl new file mode 100644 index 0000000..11d0238 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/mapping.ttl @@ -0,0 +1,35 @@ +@base . +@prefix rdf: . +@prefix foaf: . +@prefix rml: . +@prefix idlab-fn: . + + rml:logicalSource [ + rml:source [ + a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.csv"; + ]; + rml:referenceFormulation rml:CSV; +]; + rml:subjectMap [ rml:template "http://example.com/{Id}" ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution [ + rml:function idlab-fn:concatSequence; + rml:input [ + rml:parameter idlab-fn:_seq; + rml:inputValueMap [ + rml:gather ( [ rml:reference "Name" ] [ rml:constant "la Gaffe" ] ); + rml:gatherAs rdf:Seq; + ]; + ], [ + rml:parameter idlab-fn:_delimiter; + rml:inputValueMap [ rml:constant " " ]; + ]; + ]; + rml:return idlab-fn:_stringOut; + ]; + ]. + diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/output.nq b/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/output.nq new file mode 100644 index 0000000..b88acf7 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/output.nq @@ -0,0 +1 @@ + "Gaston la Gaffe" . diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/student.csv b/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/student.csv new file mode 100644 index 0000000..e14d3a3 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-ConcatSequence/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Gaston,A&B,A \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/mapping.ttl b/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/mapping.ttl new file mode 100644 index 0000000..1857681 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/mapping.ttl @@ -0,0 +1,23 @@ +@prefix foaf: . +@prefix rml: . +@prefix grel: . +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; rml:root rml:MappingDirectory; rml:path "student.csv" ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ rml:template "http://example.com/{Id}" ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:string_sha1 ; + rml:input + [ rml:parameter grel:valueParam ; rml:inputValueMap [ rml:reference "Name" ] ] . \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/output.nq b/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/output.nq new file mode 100644 index 0000000..a60de90 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/output.nq @@ -0,0 +1 @@ + "a72debed580725a9d93b704b1b61e44eec2169ee" . diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/student.csv b/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/student.csv new file mode 100644 index 0000000..e14d3a3 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-SHA1/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Gaston,A&B,A \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/mapping.ttl b/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/mapping.ttl new file mode 100644 index 0000000..4ab549f --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/mapping.ttl @@ -0,0 +1,23 @@ +@prefix foaf: . +@prefix rml: . +@prefix grel: . +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; rml:root rml:MappingDirectory; rml:path "student.csv" ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ rml:template "http://example.com/{Id}" ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function grel:string_sha256 ; + rml:input + [ rml:parameter grel:valueParam ; rml:inputValueMap [ rml:reference "Name" ] ] . \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/output.nq b/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/output.nq new file mode 100644 index 0000000..3a11edb --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/output.nq @@ -0,0 +1 @@ + "9ca1e827604bcf22ce1fc2839522052398565f7088cb9363965bab3bdae2e48d" . diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/student.csv b/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/student.csv new file mode 100644 index 0000000..e14d3a3 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-SHA256/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Gaston,A&B,A \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/mapping.ttl b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/mapping.ttl new file mode 100644 index 0000000..22cdcd1 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/mapping.ttl @@ -0,0 +1,24 @@ +@prefix foaf: . +@prefix rml: . +@prefix burp: . +@prefix grel: . +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; rml:root rml:MappingDirectory; rml:path "student.csv" ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ rml:template "http://example.com/{Id}" ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function burp:toSafeIRI ; + rml:input + [ rml:parameter grel:valueParam ; rml:inputValueMap [ rml:reference "Name" ] ] . \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/output.nq b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/output.nq new file mode 100644 index 0000000..ddcec80 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/output.nq @@ -0,0 +1 @@ + "Gaston" . diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/student.csv b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/student.csv new file mode 100644 index 0000000..e14d3a3 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeIRI/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Gaston,A&B,A \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/mapping.ttl b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/mapping.ttl new file mode 100644 index 0000000..bd9e6d2 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/mapping.ttl @@ -0,0 +1,24 @@ +@prefix foaf: . +@prefix rml: . +@prefix burp: . +@prefix grel: . +@base . + + + rml:logicalSource [ + rml:source [ a rml:RelativePathSource; rml:root rml:MappingDirectory; rml:path "student.csv" ]; + rml:referenceFormulation rml:CSV + ]; + rml:subjectMap [ rml:template "http://example.com/{Id}" ]; + rml:predicateObjectMap [ + rml:predicate foaf:name; + rml:objectMap [ + rml:functionExecution <#Execution> ; + rml:return grel:stringOut + ] + ] . + +<#Execution> + rml:function burp:toSafeURI ; + rml:input + [ rml:parameter grel:valueParam ; rml:inputValueMap [ rml:reference "Name" ] ] . \ No newline at end of file diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/output.nq b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/output.nq new file mode 100644 index 0000000..ddcec80 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/output.nq @@ -0,0 +1 @@ + "Gaston" . diff --git a/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/student.csv b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/student.csv new file mode 100644 index 0000000..e14d3a3 --- /dev/null +++ b/src/test/resources/burp/BURPFNMLTC-CSV-toSafeURI/student.csv @@ -0,0 +1,2 @@ +Id,Name,Comment,Class +1,Gaston,A&B,A \ No newline at end of file diff --git a/src/test/resources/burp/BURPIOTC-BSON/mapping.ttl b/src/test/resources/burp/BURPIOTC-BSON/mapping.ttl new file mode 100644 index 0000000..a04b1a4 --- /dev/null +++ b/src/test/resources/burp/BURPIOTC-BSON/mapping.ttl @@ -0,0 +1,26 @@ +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ a rml:LogicalSource; + rml:referenceFormulation rml:JSONPath; + rml:iterator "$.people[*]"; + rml:source [ a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "student.bson" + ] + ]; + rml:predicateObjectMap [ + rml:objectMap [ + rml:reference "$.lastname" + ]; + rml:predicate ex:name + ], [ + rml:objectMap [ + rml:reference "$.firstname" + ]; + rml:predicate ex:firstname + ]; + rml:subjectMap [ + rml:template "http://example.com/{$.id}" + ] . diff --git a/src/test/resources/burp/BURPIOTC-BSON/output.nq b/src/test/resources/burp/BURPIOTC-BSON/output.nq new file mode 100644 index 0000000..da7657b --- /dev/null +++ b/src/test/resources/burp/BURPIOTC-BSON/output.nq @@ -0,0 +1,4 @@ + "Gaston" . + "Lagaffe" . + "Joseph" . + "Longtarin" . diff --git a/src/test/resources/burp/BURPIOTC-BSON/student.bson b/src/test/resources/burp/BURPIOTC-BSON/student.bson new file mode 100644 index 0000000000000000000000000000000000000000..cbb228df1432b876ccd226fad3678d57c8fc4cfd GIT binary patch literal 140 zcmeBSU|?V=NX;+ENoA-9vY8DSEP<3jW(or%kY-BDEGjO^OUzAWU=dE5A6kAOlG+7f5e@UV2GlQDz>H%>V#e1|PZr literal 0 HcmV?d00001 diff --git a/src/test/resources/burp/BURPIOTC-CSV-BOM/country_info.csv b/src/test/resources/burp/BURPIOTC-CSV-BOM/country_info.csv new file mode 100644 index 0000000..cf40b17 --- /dev/null +++ b/src/test/resources/burp/BURPIOTC-CSV-BOM/country_info.csv @@ -0,0 +1,4 @@ +Country Code,Name,ISO 3166 +1,"Bolivia, Plurinational State of",BO +2,"Ireland",IE +3,"Saint Martin (French part)",MF diff --git a/src/test/resources/burp/BURPIOTC-CSV-BOM/mapping.ttl b/src/test/resources/burp/BURPIOTC-CSV-BOM/mapping.ttl new file mode 100644 index 0000000..d42ac88 --- /dev/null +++ b/src/test/resources/burp/BURPIOTC-CSV-BOM/mapping.ttl @@ -0,0 +1,19 @@ +@prefix ex: . +@prefix rml: . + + a rml:TriplesMap; + rml:logicalSource [ + a rml:LogicalSource; + rml:referenceFormulation rml:CSV; + rml:source [ + a rml:RelativePathSource; + rml:root rml:MappingDirectory; + rml:path "country_info.csv"; + ]; + ]; + rml:predicateObjectMap [ + rml:objectMap [ rml:reference "Name" ]; + rml:predicate ex:name; + ]; + rml:subjectMap [ rml:template "http://example.com/{Country Code}" ]. + diff --git a/src/test/resources/burp/BURPIOTC-CSV-BOM/output.nq b/src/test/resources/burp/BURPIOTC-CSV-BOM/output.nq new file mode 100644 index 0000000..9c16540 --- /dev/null +++ b/src/test/resources/burp/BURPIOTC-CSV-BOM/output.nq @@ -0,0 +1,3 @@ + "Bolivia, Plurinational State of" . + "Ireland" . + "Saint Martin (French part)" . diff --git a/src/test/resources/burp/BURPIOTC-SQLITE/mapping.ttl b/src/test/resources/burp/BURPIOTC-SQLITE/mapping.ttl new file mode 100644 index 0000000..30ff376 --- /dev/null +++ b/src/test/resources/burp/BURPIOTC-SQLITE/mapping.ttl @@ -0,0 +1,23 @@ +@prefix ex: . +@prefix rml: . +@prefix d2rq: . + + a rml:TriplesMap; + rml:logicalSource [ + a rml:LogicalSource; + rml:referenceFormulation rml:SQL2008Table; + rml:iterator "person"; + rml:source <#DB_source>; + ]; + rml:predicateObjectMap [ + rml:objectMap [ rml:reference "name" ]; + rml:predicate ex:name; + ], [ + rml:objectMap [ rml:reference "firstname" ]; + rml:predicate ex:firstname; + ]; + rml:subjectMap [ rml:template "http://example.com/{id}" ]. + +<#DB_source> a rml:Source, d2rq:Database; + d2rq:jdbcDSN "jdbc:sqlite:student.db". + diff --git a/src/test/resources/burp/BURPIOTC-SQLITE/output.nq b/src/test/resources/burp/BURPIOTC-SQLITE/output.nq new file mode 100644 index 0000000..617edb6 --- /dev/null +++ b/src/test/resources/burp/BURPIOTC-SQLITE/output.nq @@ -0,0 +1,2 @@ + "Gaston" . + "La Gaffe" . diff --git a/src/test/resources/burp/BURPIOTC-SQLITE/student.db b/src/test/resources/burp/BURPIOTC-SQLITE/student.db new file mode 100644 index 0000000000000000000000000000000000000000..2d2de88438986c583707c6b9678181beb2f48f2e GIT binary patch literal 8192 zcmeI#y$ZrG5C`x}D~N+sT%?0=qe5}<1^gfsp$OItt`SoxXe(`Azz6U}d^VrJ$w<*r zXW@V3lH4T__-)y4lH3~3%Ic&oPpL;j(2SXge3zcfcL=v>y$iR#>R;j0W4zdnvb2tWV=5P$##AOHafKmY;|fB*#k UM4&HPone@0j&+uqSl6~Jp1vz8{Qv*} literal 0 HcmV?d00001 diff --git a/src/test/resources/burp/ELSDVLEE-20/data.csv b/src/test/resources/burp/ELSDVLEE-20/data.csv new file mode 100644 index 0000000..ce1dfdd --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-20/data.csv @@ -0,0 +1,4 @@ +id,name,birthyear +P1,alice,1995 +P2,bob,1999 +P3,tobias,2005 \ No newline at end of file diff --git a/src/test/resources/burp/ELSDVLEE-20/data.json b/src/test/resources/burp/ELSDVLEE-20/data.json new file mode 100644 index 0000000..44de38e --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-20/data.json @@ -0,0 +1,26 @@ +{ + "people": [ + { + "name": "alice", + "items": [ + { + "type": "sword", + "weight": 1500 + }, + { + "type": "shield", + "weight": 2500 + } + ] + }, + { + "name": "bob", + "items": [ + { + "type": "flower", + "weight": 15 + } + ] + } + ] +} \ No newline at end of file diff --git a/src/test/resources/burp/ELSDVLEE-20/mapping.ttl b/src/test/resources/burp/ELSDVLEE-20/mapping.ttl new file mode 100644 index 0000000..4428b84 --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-20/mapping.ttl @@ -0,0 +1,94 @@ +@prefix rml: . +@prefix xsd: . +@prefix : . + +:jsonSource a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource , rml:Source ; + rml:path "data.json" ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$.people[*]" . + +:jsonView a rml:LogicalView ; + rml:viewOn :jsonSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "$.name" ; + ] ; + rml:field [ + a rml:IterableField ; + rml:fieldName "item" ; + rml:iterator "$.items[*]" ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "type" ; + rml:reference "$.type" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "weight" ; + rml:reference "$.weight" ; + ] ; + ] . + +:csvSource a rml:LogicalSource ; + rml:source [ a rml:RelativePathSource , rml:Source ; + rml:path "data.csv" ] ; + rml:referenceFormulation rml:CSV . + +:csvView a rml:LogicalView ; + rml:viewOn :csvSource ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "name" ; + rml:reference "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "id" ; + rml:reference "id" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "birthyear" ; + rml:reference "birthyear" ; + ] ; + rml:innerJoin [ + rml:parentLogicalView :jsonView ; + rml:joinCondition [ + rml:parent "name" ; + rml:child "name" ; + ] ; + rml:field [ + a rml:ExpressionField ; + rml:fieldName "item_type" ; + rml:reference "item.type" ; + ] ; + ] . + +:tm a rml:TriplesMap; + rml:logicalSource :csvView; + rml:subjectMap [ + rml:template "http://example.org/person/{id}" ; + rml:class :Person + ] ; + rml:predicateObjectMap [ + rml:predicate :hasName ; + rml:objectMap [ + rml:reference "name" ; + ] + ] ; + rml:predicateObjectMap [ + rml:predicate :hasBirthyear ; + rml:objectMap [ + rml:reference "birthyear" ; + rml:datatype xsd:gYear ; + ] + ] ; + rml:predicateObjectMap [ + rml:predicate :hasItem ; + rml:objectMap [ + rml:reference "item_type" ; + ] + ] . \ No newline at end of file diff --git a/src/test/resources/burp/errors.csv b/src/test/resources/burp/errors.csv new file mode 100644 index 0000000..e83fa2a --- /dev/null +++ b/src/test/resources/burp/errors.csv @@ -0,0 +1,23 @@ +TestCaseId,RerError,ExitCode,Pointer,Line,LineRangeStart,LineRangeEnd +RMLTC0002e-JSON,SourceAccessError,,"[] rml:path ""student2.json""",10,, +RMLTC0002g-JSON,ReferenceFormulationSyntaxError,,"[] rml:iterator ""$.students[*]]""",6,, +RMLTC0004b-JSON,MappingError,,[] rml:termType rml:Literal,21,, +RMLTC0007h-JSON,MappingError,,[] rml:termType rml:Literal,22,, +RMLTC0012d-JSON,MappingError,,"[ rml:template ""{$.fname}_{$.lname}_{$.amount}""; + rml:termType rml:BlankNode +],[ + rml:template ""{$.amount}_{$.fname}_{$.lname}""; + rml:termType rml:BlankNode +]",,27,31 +RMLTC0012c-JSON,MappingError,,,,5,25 +RMLTC0015b-JSON,MappingError,,"[] rml:language ""a-english""; +[] rml:language ""a-spanish""","15,35",, +RMLTC0019b-JSON,InvalidIRI,,$.FirstName,20,, +RMLTC0023a-JSON,ReferenceFormulationSyntaxError,,"[] rml:template ""http://example.com/{{Name}}""",14,, +RMLTC0023b-JSON,RDFMappingSyntaxError,,,14,, +RMLTC0023c-JSON,RDFMappingSyntaxError,,,14,, +RMLTC0023d-JSON,ReferenceFormulationSyntaxError,,"[] rml:template ""http://example.com/{\\\\{Name\\\\}}""",14,, +RMLTC0023e-JSON,RDFMappingSyntaxError,,"",14,, +RMLTC0024a-JSON,IncorrectTermType,,"[ rml:constant ""School""; + rml:termType rml:BlankNode ]",,21,22 +RMLTC0025b-JSON,ReferenceFormulationExecutionError,,"[] rml:reference ""$.amounts""",16,, diff --git a/src/test/resources/burp/metadata.csv b/src/test/resources/burp/metadata.csv new file mode 100644 index 0000000..3f6f697 --- /dev/null +++ b/src/test/resources/burp/metadata.csv @@ -0,0 +1,12 @@ +ID,title,description,specification,mapping,input_format1,output_format1,input1,output1,error +BURPFNMLTC-CSV-SHA1,string_sha1,Tests string_sha1 function,fnml,mapping.ttl,text/csv,application/n-quads,student.csv,output.nq,false +BURPFNMLTC-CSV-SHA256,string_sha256,Tests string_sha256 function,fnml,mapping.ttl,text/csv,application/n-quads,student.csv,output.nq,false +BURPFNMLTC-CSV-Concat,concat,Tests concat function,fnml,mapping.ttl,text/csv,application/n-quads,student.csv,output.nq,false +BURPFNMLTC-CSV-ConcatSequence,concatSequence,Tests concatSequence function,fnml,mapping.ttl,text/csv,application/n-quads,student.csv,output.nq,false +BURPFNMLTC-CSV-toSafeIRI,toSafeIRI,Tests toSafeIRI function,fnml,mapping.ttl,text/csv,application/n-quads,student.csv,output.nq,false +BURPFNMLTC-CSV-toSafeURI,toSafeURI,Tests toSafeURI function,fnml,mapping.ttl,text/csv,application/n-quads,student.csv,output.nq,false +BURPIOTC-CSV-BOM,csv_bom,Tests CSV BOM parsing,rml-core,mapping.ttl,text/csv,application/n-quads,country_info.csv,output.nq,false +BURPIOTC-SQLITE,sqlite,Tests SQLite DB reading,rml-io,mapping.ttl,application/sql,application/n-quads,student.db,output.nq,false +BURPIOTC-BSON,bson,Tests BSON reading,rml-io,mapping.ttl,application/bson,application/n-quads,student.bson,output.nq,false +ELSDVLEE-20,RML-LV left join causes error,,rml-lv,mapping.ttl,,,"",,false +ELSDVLEE-21,explicit rml:TriplesMap statement needed to use TriplesMap as ParentTriplesMap,,rml-lv,mapping.ttl,,,,,false \ No newline at end of file From ed85b2238fa7bd6a2a42e35d144e0a5bf2b10c32 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 9 Jun 2026 21:01:10 +0200 Subject: [PATCH 04/45] backport BURP-Error RML-LV RER --- src/main/java/burp/NQuadsWriter.java | 35 +++-- src/main/java/burp/ls/CSVSource.java | 5 - src/main/java/burp/ls/JSONSourceRFC.java | 15 ++- .../java/burp/ls/LogicalSourceFactory.java | 9 +- src/main/java/burp/ls/NetconfQuerySource.java | 3 +- src/main/java/burp/ls/RDBSource.java | 10 +- src/main/java/burp/ls/RDBSourceProvider.java | 2 +- .../java/burp/ls/RDBTableSourceProvider.java | 2 +- src/main/java/burp/ls/SPARQLFileSource.java | 5 - .../java/burp/ls/SPARQLServiceSource.java | 5 - src/main/java/burp/ls/XMLSource.java | 4 - .../burp/model/AbstractLogicalSource.java | 1 + src/main/java/burp/model/ExpressionField.java | 26 ---- src/main/java/burp/model/FieldParent.java | 9 -- .../java/burp/model/FormulationIterable.java | 1 - src/main/java/burp/model/IterableField.java | 68 ---------- src/main/java/burp/model/LogicalSource.java | 21 --- src/main/java/burp/model/MappingDocument.java | 3 +- src/main/java/burp/model/RawReference.java | 2 + src/main/java/burp/model/RdfStatement.java | 4 + src/main/java/burp/model/TermMap.java | 18 ++- .../java/burp/model/gathermap/GatherMap.java | 8 +- .../burp/model/{ => lv}/ContainsFields.java | 2 +- .../java/burp/model/lv/ExpressionField.java | 57 ++++++++ src/main/java/burp/model/{ => lv}/Field.java | 34 ++++- src/main/java/burp/model/lv/FieldParent.java | 6 + .../java/burp/model/lv/IterableField.java | 89 +++++++++++++ src/main/java/burp/model/lv/LogicalView.java | 11 +- src/main/java/burp/model/lv/ViewJoin.java | 7 +- src/main/java/burp/parse/PlanWiring.java | 3 +- .../parse/turtleprov/TurtleProvParser.java | 50 +++++++ .../burp/reporting/RdfReportGenerator.java | 123 ++++++++++++++++++ src/main/java/burp/util/Util.java | 4 +- src/main/java/burp/vocabularies/BURP.java | 8 +- .../resources/burp/ELSDVLEE-21/authors.json | 14 ++ .../resources/burp/ELSDVLEE-21/books.json | 22 ++++ .../resources/burp/ELSDVLEE-21/mapping.ttl | 58 +++++++++ 37 files changed, 533 insertions(+), 211 deletions(-) delete mode 100644 src/main/java/burp/model/ExpressionField.java delete mode 100644 src/main/java/burp/model/FieldParent.java delete mode 100644 src/main/java/burp/model/IterableField.java rename src/main/java/burp/model/{ => lv}/ContainsFields.java (89%) create mode 100644 src/main/java/burp/model/lv/ExpressionField.java rename src/main/java/burp/model/{ => lv}/Field.java (74%) create mode 100644 src/main/java/burp/model/lv/FieldParent.java create mode 100644 src/main/java/burp/model/lv/IterableField.java create mode 100644 src/main/java/burp/parse/turtleprov/TurtleProvParser.java create mode 100644 src/main/java/burp/reporting/RdfReportGenerator.java create mode 100644 src/test/resources/burp/ELSDVLEE-21/authors.json create mode 100644 src/test/resources/burp/ELSDVLEE-21/books.json create mode 100644 src/test/resources/burp/ELSDVLEE-21/mapping.ttl diff --git a/src/main/java/burp/NQuadsWriter.java b/src/main/java/burp/NQuadsWriter.java index 1ffbfd2..edf173a 100644 --- a/src/main/java/burp/NQuadsWriter.java +++ b/src/main/java/burp/NQuadsWriter.java @@ -14,10 +14,11 @@ public class NQuadsWriter { + public static void write(OutputStream output, List statements) { + write(output, statements, StandardCharsets.UTF_8); + } + public static void write(OutputStream output, List statements, Charset charset) { - if (charset == null) { - charset = StandardCharsets.UTF_8; - } BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, charset)); try { for (RdfStatement statement : statements) { @@ -138,13 +139,27 @@ static String escapeLiteral(String value) { char ch = value.charAt(i); int chCode = value.codePointAt(i); switch (ch) { - case '\\': escaped.append("\\\\"); break; - case '"': escaped.append("\\\""); break; - case '\n': escaped.append("\\n"); break; - case '\r': escaped.append("\\r"); break; - case '\t': escaped.append("\\t"); break; - case '\b': escaped.append("\\b"); break; - case '\u000C': escaped.append("\\f"); break; + case '\\': + escaped.append("\\\\"); + break; + case '"': + escaped.append("\\\""); + break; + case '\n': + escaped.append("\\n"); + break; + case '\r': + escaped.append("\\r"); + break; + case '\t': + escaped.append("\\t"); + break; + case '\b': + escaped.append("\\b"); + break; + case '\u000C': + escaped.append("\\f"); + break; default: if (chCode < 0x20) { escaped.append("\\u"); diff --git a/src/main/java/burp/ls/CSVSource.java b/src/main/java/burp/ls/CSVSource.java index e1d17de..3acba62 100644 --- a/src/main/java/burp/ls/CSVSource.java +++ b/src/main/java/burp/ls/CSVSource.java @@ -76,11 +76,6 @@ public Resource getReferenceFormulation() { return RML.CSV; } - @Override - public void setReferenceFormulation(Resource referenceFormulation) { - // do nothing - } - @Override public Reference buildExportedReference(String reference, Origin origin) { return new CSVReference(reference, origin); diff --git a/src/main/java/burp/ls/JSONSourceRFC.java b/src/main/java/burp/ls/JSONSourceRFC.java index 24d505b..f525e02 100644 --- a/src/main/java/burp/ls/JSONSourceRFC.java +++ b/src/main/java/burp/ls/JSONSourceRFC.java @@ -25,6 +25,8 @@ public class JSONSourceRFC extends FileBasedLogicalSource { public String iterator; public Origin iteratorOrigin; + + @Override public Iterable iterator() { try { @@ -50,6 +52,15 @@ public Iterable iterator() { } catch (BurpException burpException) { throw burpException; } catch (Exception exception) { + String exName = exception.getClass().getName(); + if (exName.equals("at.asitplus.jsonpath.core.JsonPathCompilerException") || + exName.equals("at.asitplus.jsonpath.implementation.JsonPathParserException") || + exception.getCause() != null && ( + exception.getCause().getClass().getName().equals("at.asitplus.jsonpath.core.JsonPathCompilerException") || + exception.getCause().getClass().getName().equals("at.asitplus.jsonpath.implementation.JsonPathParserException") + )) { + throw new BurpException(new RmlError("Syntax error in JSONPath iterator.", new Origin(this, null), RER.ReferenceFormulationSyntaxError, exception, null)); + } throw new BurpException(new RmlError("Error in JSON preparation of iterator.", new Origin(this, null), RER.LogicalSourceError, exception, null)); } } @@ -59,10 +70,6 @@ public Resource getReferenceFormulation() { return RML.JSONPath; } - @Override - public void setReferenceFormulation(Resource value) { - } - @Override public Reference buildExportedReference(String reference, Origin origin) { return new JSONPathReference(reference, origin); diff --git a/src/main/java/burp/ls/LogicalSourceFactory.java b/src/main/java/burp/ls/LogicalSourceFactory.java index f09515e..2854a6e 100644 --- a/src/main/java/burp/ls/LogicalSourceFactory.java +++ b/src/main/java/burp/ls/LogicalSourceFactory.java @@ -11,6 +11,7 @@ import burp.vocabularies.RML; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; +import org.jetbrains.annotations.NotNull; import java.nio.file.Path; import java.util.List; @@ -48,8 +49,8 @@ public static LogicalSource create(Resource ls, Path mappingDirectory, Path curr } public static List changeIterator( - String iterationAsString, - Resource referenceFormulation, + @NotNull String iterationAsString, + @NotNull Resource referenceFormulation, String iterator, Origin referenceFormulationOrigin ) { @@ -69,8 +70,8 @@ public static List changeIterator( } public static List changeIterator( - String iterationAsString, - Resource referenceFormulation, + @NotNull String iterationAsString, + @NotNull Resource referenceFormulation, String iterator ) { return changeIterator(iterationAsString, referenceFormulation, iterator, null); diff --git a/src/main/java/burp/ls/NetconfQuerySource.java b/src/main/java/burp/ls/NetconfQuerySource.java index 8ded88c..4978bf3 100644 --- a/src/main/java/burp/ls/NetconfQuerySource.java +++ b/src/main/java/burp/ls/NetconfQuerySource.java @@ -49,9 +49,8 @@ public Reference buildExportedReference(String reference, Origin origin) { public String iterator; public Resource referenceFormulation; public Resource getReferenceFormulation() { return referenceFormulation; } - public void setReferenceFormulation(Resource ref) { this.referenceFormulation = ref; } - protected List iterations = null; + protected List iterations = null; public Charset encoding = StandardCharsets.UTF_8; private final Map datastoreMap = Map.ofEntries( diff --git a/src/main/java/burp/ls/RDBSource.java b/src/main/java/burp/ls/RDBSource.java index e31f5db..88f4950 100644 --- a/src/main/java/burp/ls/RDBSource.java +++ b/src/main/java/burp/ls/RDBSource.java @@ -24,18 +24,13 @@ public class RDBSource extends LogicalSource { public String username; public String query; - private Resource referenceFormulation; + protected Resource referenceFormulation; @Override public Resource getReferenceFormulation() { return referenceFormulation; } - @Override - public void setReferenceFormulation(Resource value) { - this.referenceFormulation = value; - } - @Override public Iterable iterator() { try { @@ -115,10 +110,9 @@ public RDBReference(String reference, Origin origin) { @Override public List getValues(Iteration i) { - if (!(i instanceof RDBIteration)) { + if (!(i instanceof RDBIteration rdbIteration)) { throw new IllegalArgumentException("RDBReference can only be used with RDBIteration."); } - RDBIteration rdbIteration = (RDBIteration) i; List l = new ArrayList<>(); String columnname = StringEscapeUtils.unescapeJava(reference); diff --git a/src/main/java/burp/ls/RDBSourceProvider.java b/src/main/java/burp/ls/RDBSourceProvider.java index 6aac511..140569a 100644 --- a/src/main/java/burp/ls/RDBSourceProvider.java +++ b/src/main/java/burp/ls/RDBSourceProvider.java @@ -18,7 +18,7 @@ public boolean supports(Resource referenceFormulation) { @Override public RDBSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { RDBSource source = new RDBSource(); - source.setReferenceFormulation(RML.SQL2008Query); + source.referenceFormulation = RML.SQL2008Query; Resource sourceNode = ls.getPropertyResourceValue(RML.source); Statement jdbcDSNStmt = sourceNode.getProperty(D2RQ.jdbcDSN); diff --git a/src/main/java/burp/ls/RDBTableSourceProvider.java b/src/main/java/burp/ls/RDBTableSourceProvider.java index 6f66384..8d71f3f 100644 --- a/src/main/java/burp/ls/RDBTableSourceProvider.java +++ b/src/main/java/burp/ls/RDBTableSourceProvider.java @@ -15,7 +15,7 @@ public boolean supports(Resource referenceFormulation) { @Override public RDBSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { RDBSource source = super.create(ls, mappingDirectory, currentWorkingDirectory); - source.setReferenceFormulation(RML.SQL2008Table); + source.referenceFormulation = RML.SQL2008Table; source.query = "SELECT * FROM " + source.query; return source; } diff --git a/src/main/java/burp/ls/SPARQLFileSource.java b/src/main/java/burp/ls/SPARQLFileSource.java index 0c4de57..67d818a 100644 --- a/src/main/java/burp/ls/SPARQLFileSource.java +++ b/src/main/java/burp/ls/SPARQLFileSource.java @@ -32,11 +32,6 @@ public Resource getReferenceFormulation() { return referenceFormulation; } - @Override - public void setReferenceFormulation(Resource value) { - this.referenceFormulation = value; - } - @Override public Iterable iterator() { try { diff --git a/src/main/java/burp/ls/SPARQLServiceSource.java b/src/main/java/burp/ls/SPARQLServiceSource.java index 286c32d..3b6c159 100644 --- a/src/main/java/burp/ls/SPARQLServiceSource.java +++ b/src/main/java/burp/ls/SPARQLServiceSource.java @@ -33,11 +33,6 @@ public Resource getReferenceFormulation() { return referenceFormulation; } - @Override - public void setReferenceFormulation(Resource value) { - this.referenceFormulation = value; - } - @Override public Iterable iterator() { try { diff --git a/src/main/java/burp/ls/XMLSource.java b/src/main/java/burp/ls/XMLSource.java index b72b0f3..e52a93d 100644 --- a/src/main/java/burp/ls/XMLSource.java +++ b/src/main/java/burp/ls/XMLSource.java @@ -86,10 +86,6 @@ public Resource getReferenceFormulation() { return RML.XPath; } - @Override - public void setReferenceFormulation(Resource value) { - } - @Override public Reference buildExportedReference(String reference, Origin origin) { return new XMLReference(reference, origin); diff --git a/src/main/java/burp/model/AbstractLogicalSource.java b/src/main/java/burp/model/AbstractLogicalSource.java index 2558233..ef6453e 100644 --- a/src/main/java/burp/model/AbstractLogicalSource.java +++ b/src/main/java/burp/model/AbstractLogicalSource.java @@ -1,6 +1,7 @@ package burp.model; +import burp.model.lv.FieldParent; import burp.reporting.BurpException; import java.util.HashSet; diff --git a/src/main/java/burp/model/ExpressionField.java b/src/main/java/burp/model/ExpressionField.java deleted file mode 100644 index 70292a4..0000000 --- a/src/main/java/burp/model/ExpressionField.java +++ /dev/null @@ -1,26 +0,0 @@ -package burp.model; - -import burp.model.lv.LogicalIteration; - -import java.util.ArrayList; -import java.util.List; - -public class ExpressionField extends Field { - - public ConcreteExpressionMap fieldExpressionMap; - - public List enrich(LogicalIteration underlying){ - List list = new ArrayList<>(); - - int i = 0; - for(Object o : fieldExpressionMap.generateValues(underlying.getIteration(parent.getAbsoluteFieldName()), TemplateReferenceSafety.SAFE_IRI)){ - LogicalIteration e = underlying.copy(); - e.put(getAbsoluteFieldName() + ".#", i++); - e.put(getAbsoluteFieldName(), o); - list.add(e); - } - - return Field.expand(list, expressionFields, iterableFields); - } - -} diff --git a/src/main/java/burp/model/FieldParent.java b/src/main/java/burp/model/FieldParent.java deleted file mode 100644 index 3915bbb..0000000 --- a/src/main/java/burp/model/FieldParent.java +++ /dev/null @@ -1,9 +0,0 @@ -package burp.model; - -import java.util.Iterator; -import java.util.List; - -public interface FieldParent { - - String getAbsoluteFieldName(); -} diff --git a/src/main/java/burp/model/FormulationIterable.java b/src/main/java/burp/model/FormulationIterable.java index 47bd328..e12df94 100644 --- a/src/main/java/burp/model/FormulationIterable.java +++ b/src/main/java/burp/model/FormulationIterable.java @@ -4,5 +4,4 @@ public interface FormulationIterable extends PlanNode { Resource getReferenceFormulation(); - void setReferenceFormulation(Resource referenceFormulation); } \ No newline at end of file diff --git a/src/main/java/burp/model/IterableField.java b/src/main/java/burp/model/IterableField.java deleted file mode 100644 index d6d9bb7..0000000 --- a/src/main/java/burp/model/IterableField.java +++ /dev/null @@ -1,68 +0,0 @@ -package burp.model; - -import burp.ls.LogicalSourceFactory; -import burp.model.lv.LogicalIteration; -import burp.reporting.Origin; -import org.apache.jena.rdf.model.Resource; - -import java.util.ArrayList; -import java.util.List; - -public class IterableField extends Field implements FormulationIterable { - - public String iterator; -public Resource declaredReferenceFormulation; -public Origin declaredReferenceFormulationOrigin; -public Resource referenceFormulation; -private PlanNode planNodeParent; - -@Override -public Resource getReferenceFormulation() { return referenceFormulation; } -@Override -public void setReferenceFormulation(Resource r) { referenceFormulation = r; } - -@Override -public PlanNode getParent() { return planNodeParent; } -@Override -public void setParent(PlanNode p) { planNodeParent = p; } - - public List enrich(LogicalIteration underlying) { - List list = new ArrayList<>(); - - if (referenceFormulation == null) { - // The iterator has chanced - // We take the iterator from the parent - String i = underlying.getIterationString(parent.getAbsoluteFieldName()); - int index = 0; - for(Iteration newIteration : LogicalSourceFactory.changeIterator(i, getAncestorReferenceFormulation(), iterator)) { - LogicalIteration e = underlying.copy(); - e.put(getAbsoluteFieldName() + ".#", index++); - e.put(getAbsoluteFieldName(), newIteration); - list.add(e); - } - } else { - // The reference formulation (and iterator) have changed. - String i = underlying.getIterationString(parent.getAbsoluteFieldName()); - - int index = 0; - for(Iteration newIteration : LogicalSourceFactory.changeIterator(i, referenceFormulation, iterator)) { - System.out.println(newIteration); - LogicalIteration e = underlying.copy(); - e.put(getAbsoluteFieldName() + ".#", index++); - e.put(getAbsoluteFieldName(), newIteration); - list.add(e); - } - } - - return Field.expand(list, expressionFields, iterableFields); - } - - private Resource getAncestorReferenceFormulation() { - // Since we explicitly created an IterableField for the rood. the two lines below should suffice. - if(referenceFormulation != null) return referenceFormulation; - if(parent instanceof IterableField) return ((IterableField) parent).getAncestorReferenceFormulation(); - if(parent instanceof LogicalSource) return ((LogicalSource) parent).referenceFormulation; - return null; - } - -} \ No newline at end of file diff --git a/src/main/java/burp/model/LogicalSource.java b/src/main/java/burp/model/LogicalSource.java index 48fca3f..e049592 100644 --- a/src/main/java/burp/model/LogicalSource.java +++ b/src/main/java/burp/model/LogicalSource.java @@ -1,29 +1,8 @@ package burp.model; -import org.apache.jena.rdf.model.Resource; - -import java.util.Collections; - public abstract class LogicalSource extends AbstractLogicalSource { - public Resource referenceFormulation; - - @Override - public Iterable children() { - return Collections.emptyList(); - } - @Override public Iterable dependencies() { return children(); } - - @Override - public Resource getReferenceFormulation() { - return referenceFormulation; - } - - @Override - public void setReferenceFormulation(Resource referenceFormulation) { - this.referenceFormulation = referenceFormulation; - } } \ No newline at end of file diff --git a/src/main/java/burp/model/MappingDocument.java b/src/main/java/burp/model/MappingDocument.java index 0dfeff6..65c4261 100644 --- a/src/main/java/burp/model/MappingDocument.java +++ b/src/main/java/burp/model/MappingDocument.java @@ -9,7 +9,6 @@ import java.util.*; import java.util.function.Consumer; -import java.util.stream.Collectors; public class MappingDocument implements PlanNode { public final List triplesMaps; @@ -143,7 +142,7 @@ private List postProcessContainers(List stmts) { it.getGraph(), it.targets() )) - .collect(Collectors.toList()); + .toList(); result.addAll(rdfStmtsWithoutCollections); result.addAll(containerStmts); diff --git a/src/main/java/burp/model/RawReference.java b/src/main/java/burp/model/RawReference.java index 6e3dd14..4b57cd3 100644 --- a/src/main/java/burp/model/RawReference.java +++ b/src/main/java/burp/model/RawReference.java @@ -38,8 +38,10 @@ public List getValues(Iteration i) { public void compileReferences() { if (compiledReference == null && reference != null) { LocalReferenceScope scope = ancestor(LocalReferenceScope.class); + System.out.println("Compiling RawReference: " + reference + ", found scope: " + (scope != null ? scope.getClass().getSimpleName() : "null")); if (scope != null) { compiledReference = scope.buildLocalReference(reference, origin); + System.out.println(" compiled to: " + (compiledReference != null ? compiledReference.getClass().getSimpleName() : "null")); } } } diff --git a/src/main/java/burp/model/RdfStatement.java b/src/main/java/burp/model/RdfStatement.java index b2b86f6..fb84340 100644 --- a/src/main/java/burp/model/RdfStatement.java +++ b/src/main/java/burp/model/RdfStatement.java @@ -22,6 +22,10 @@ public RdfStatement(BlankNodeOrIRI subject, IRITerm predicate, Term object, IRIT this.targets = targets != null ? targets : Set.of(); } + public RdfStatement(BlankNodeOrIRI subject, IRITerm predicate, Term object, IRITerm graph) { + this(subject, predicate, object, graph, Set.of()); + } + public RdfStatement(BlankNodeOrIRI subject, IRITerm predicate, Term object) { this(subject, predicate, object, null, Set.of()); } diff --git a/src/main/java/burp/model/TermMap.java b/src/main/java/burp/model/TermMap.java index 5c08f27..d3d16c6 100644 --- a/src/main/java/burp/model/TermMap.java +++ b/src/main/java/burp/model/TermMap.java @@ -63,10 +63,10 @@ public List generateExpressionTerms(Iteration i, Set disallowed) if (RML.IRI.equals(termType) && allowed.contains(RML.IRI)) { return (List) (List) generateIRIs(i); - } else if (termType.toString().equals("http://w3id.org/rml/URI") && allowed.contains(RML.IRI)) { - return (List) (List) generateIRIs(i); // URI mapped to IRI - } else if (termType.toString().equals("http://w3id.org/rml/UnsafeIRI") && allowed.contains(RML.IRI)) { - return (List) (List) generateUnsafeIRIs(i); // UnsafeIRI mapped to IRI + } else if (RML.URI.equals(termType) && allowed.contains(RML.URI)) { + return (List) (List) generateURIs(i); + } else if (RML.UnsafeIRI.equals(termType) && allowed.contains(RML.IRI)) { + return (List) (List) generateUnsafeIRIs(i); } else if (RML.BLANKNODE.equals(termType) && allowed.contains(RML.BLANKNODE)) { return (List) (List) generateBlankNodes(i); } else if (RML.LITERAL.equals(termType) && allowed.contains(RML.LITERAL)) { @@ -74,9 +74,15 @@ public List generateExpressionTerms(Iteration i, Set disallowed) } else { throw new BurpException( new RmlError( - "The term map " + this.getName() + " generates " + termType + ", which is not allowed. Expected one of " + allowed, + "The term map " + this.getName() + " generates " + termType + ", which is not allowed. " + + "Expected one of " + allowed, new Origin(this, null), - RER.IncorrectTermType + RER.IncorrectTermType, + null, + Map.of( + RML.termType, termType, + BURP.allowedTermType, String.join("", allowed.stream().map(Resource::getURI).toList()) + ) ) ); } diff --git a/src/main/java/burp/model/gathermap/GatherMap.java b/src/main/java/burp/model/gathermap/GatherMap.java index 4390c1b..4052d6b 100644 --- a/src/main/java/burp/model/gathermap/GatherMap.java +++ b/src/main/java/burp/model/gathermap/GatherMap.java @@ -56,7 +56,7 @@ public List generateTerms(Iteration i, List explicitIds) { .map(gm -> gm.generateTerms(i)) .toList(); - List> itemSets; + List> itemSets; if (RML.append.equals(strategy)) { var flattened = superCollection.stream() @@ -79,7 +79,7 @@ public List generateTerms(Iteration i, List explicitIds) { List results = new ArrayList<>(); - for (List items : itemSets) { + for (List items : itemSets) { List idsToUse; boolean idGenerated; if (explicitIds != null) { @@ -116,11 +116,11 @@ public List generateTerms(Iteration i) { return generateTerms(i, null); } - private List> cartesianProduct(List> lists) { + private List> cartesianProduct(List> lists) { List> result = new ArrayList<>(); result.add(new ArrayList<>()); - for (List list : lists) { + for (List list : lists) { List> currentResult = new ArrayList<>(); for (T item : list) { for (List combination : result) { diff --git a/src/main/java/burp/model/ContainsFields.java b/src/main/java/burp/model/lv/ContainsFields.java similarity index 89% rename from src/main/java/burp/model/ContainsFields.java rename to src/main/java/burp/model/lv/ContainsFields.java index c11cda6..29215b9 100644 --- a/src/main/java/burp/model/ContainsFields.java +++ b/src/main/java/burp/model/lv/ContainsFields.java @@ -1,4 +1,4 @@ -package burp.model; +package burp.model.lv; import java.util.List; diff --git a/src/main/java/burp/model/lv/ExpressionField.java b/src/main/java/burp/model/lv/ExpressionField.java new file mode 100644 index 0000000..9dff5e7 --- /dev/null +++ b/src/main/java/burp/model/lv/ExpressionField.java @@ -0,0 +1,57 @@ +package burp.model.lv; + +import burp.model.ConcreteExpressionMap; +import burp.model.PlanNode; +import burp.model.TemplateReferenceSafety; +import burp.reporting.BurpException; +import burp.reporting.RmlError; +import burp.vocabularies.RER; + +import java.util.ArrayList; +import java.util.List; + +public class ExpressionField extends Field { + + public ConcreteExpressionMap fieldExpressionMap; + + public List enrich(LogicalIteration underlying) { + var underlyingIteration = underlying.getIteration(parentField.getAbsoluteFieldName()); + if (underlyingIteration == null) + throw new BurpException( + new RmlError( + "Cannot get iterations for ${parentField.absoluteFieldName}, which is required for expression field $absoluteFieldName.", + null, // TODO: Add origin to field + RER.ReferenceFormulationExecutionError + ) + ); + + var generatedValues = fieldExpressionMap.generateValues(underlyingIteration, TemplateReferenceSafety.SAFE_IRI); + var list = new ArrayList(); + if (generatedValues.isEmpty()) { + //FIXME: How should we register that a field with no result ? + // So that later on they can request that field an receive nothing (example with RMLLVTC0010b) + underlying.put(getAbsoluteFieldName() + ".#", null); + underlying.put(getAbsoluteFieldName(), null); + list.add(underlying); + } else { + for (var index = 0; index < generatedValues.size(); index++) { + var output = generatedValues.get(index); + var e = underlying.copy(); + e.put(getAbsoluteFieldName() + ".#", index); + e.put(getAbsoluteFieldName(), output); + list.add(e); + } + } + + return Field.expand(list, expressionFields, iterableFields); + } + + @Override + public Iterable children() { + List children = new ArrayList<>(); + if (fieldExpressionMap != null) children.add(fieldExpressionMap); + for (PlanNode child : super.children()) children.add(child); + return children; + } + +} diff --git a/src/main/java/burp/model/Field.java b/src/main/java/burp/model/lv/Field.java similarity index 74% rename from src/main/java/burp/model/Field.java rename to src/main/java/burp/model/lv/Field.java index b31ae56..77cad07 100644 --- a/src/main/java/burp/model/Field.java +++ b/src/main/java/burp/model/lv/Field.java @@ -1,14 +1,16 @@ -package burp.model; +package burp.model.lv; -import burp.model.lv.LogicalIteration; +import burp.model.AbstractLogicalSource; +import burp.model.PlanNode; import java.util.ArrayList; import java.util.List; -public abstract class Field implements ContainsFields, FieldParent { +public abstract class Field implements ContainsFields, FieldParent, PlanNode { public String fieldName ; - public FieldParent parent; + public FieldParent parentField; + private PlanNode planNodeParent; public List expressionFields = new ArrayList<>(); public List iterableFields = new ArrayList<>(); @@ -43,13 +45,31 @@ public static List expand(List list, List children() { + List children = new ArrayList<>(); + children.addAll(expressionFields); + children.addAll(iterableFields); + return children; + } + @Override public List getIterableFields() { return iterableFields; @@ -62,7 +82,7 @@ public List getExpressionFields() { @Override public void addField(Field field) { - field.parent = this; + field.parentField = this; if (field instanceof IterableField) { getIterableFields().add((IterableField) field); diff --git a/src/main/java/burp/model/lv/FieldParent.java b/src/main/java/burp/model/lv/FieldParent.java new file mode 100644 index 0000000..a688b02 --- /dev/null +++ b/src/main/java/burp/model/lv/FieldParent.java @@ -0,0 +1,6 @@ +package burp.model.lv; + +public interface FieldParent { + + String getAbsoluteFieldName(); +} diff --git a/src/main/java/burp/model/lv/IterableField.java b/src/main/java/burp/model/lv/IterableField.java new file mode 100644 index 0000000..3fc58d3 --- /dev/null +++ b/src/main/java/burp/model/lv/IterableField.java @@ -0,0 +1,89 @@ +package burp.model.lv; + +import burp.ls.LogicalSourceFactory; +import burp.model.*; +import burp.reporting.Origin; +import org.apache.jena.rdf.model.Resource; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; + +public class IterableField extends Field implements FormulationIterable, LocalReferenceScope { + private PlanNode parentNode; + + public String iterator; + public Resource declaredReferenceFormulation; + public Origin declaredReferenceFormulationOrigin; + + @Override + public Resource getReferenceFormulation() { + return declaredReferenceFormulation != null ? declaredReferenceFormulation : getAncestorReferenceFormulation(); + } + + @Override + public PlanNode getParent() { + return parentNode; + } + + @Override + public void setParent(PlanNode p) { + parentNode = p; + } + + @Override + public Reference buildLocalReference(String reference, Origin origin) { + if (declaredReferenceFormulation == null) { + LocalReferenceScope ancestorReferenceScope = ancestor(LocalReferenceScope.class); + if (ancestorReferenceScope == null) { + throw new IllegalArgumentException("No ancestor reference formulation scope in " + this); + } + return ancestorReferenceScope.buildLocalReference(reference, origin); + } + + return LogicalSourceFactory.buildReference( + declaredReferenceFormulation, + reference, + origin, + declaredReferenceFormulationOrigin + ); + } + + public List enrich(LogicalIteration underlying) { + var list = new ArrayList(); + + // The iterator has changed + // We take the iterator from the parent + var iterationContent = underlying.getIterationString(parentField.getAbsoluteFieldName()); + var changedIterator = LogicalSourceFactory.changeIterator( + iterationContent, + // The reference formulation has changed. + declaredReferenceFormulation != null + ? declaredReferenceFormulation + : getAncestorReferenceFormulation(), + iterator, + declaredReferenceFormulationOrigin + ); + + for (int index = 0; index < changedIterator.size(); index++) { + var iteration = changedIterator.get(index); + var e = underlying.copy(); + e.put(getAbsoluteFieldName() + ".#", index); + e.put(getAbsoluteFieldName(), iteration); + list.add(e); + } + + return expand(list, expressionFields, iterableFields); + } + + @Nullable + private Resource getAncestorReferenceFormulation() { + // Since we explicitly created an IterableField for the rood. the two lines below should suffice. + if (declaredReferenceFormulation != null) return declaredReferenceFormulation; + if (parentField instanceof IterableField) + return ((IterableField) parentField).getAncestorReferenceFormulation(); + if (parentField instanceof LogicalSource) return ((LogicalSource) parentField).getReferenceFormulation(); + return null; + } + +} \ No newline at end of file diff --git a/src/main/java/burp/model/lv/LogicalView.java b/src/main/java/burp/model/lv/LogicalView.java index 2a8e10a..952a70e 100644 --- a/src/main/java/burp/model/lv/LogicalView.java +++ b/src/main/java/burp/model/lv/LogicalView.java @@ -26,9 +26,8 @@ public class LogicalView extends AbstractLogicalSource implements ContainsFields public Iterable children() { List list = new ArrayList<>(); list.add(logicalSource); - for (ExpressionField e : expressionFields) { - if (e.fieldExpressionMap != null) list.add(e.fieldExpressionMap); - } + list.addAll(expressionFields); + list.addAll(iterableFields); list.addAll(joins); return list; } @@ -73,7 +72,7 @@ public List getIterableFields() { } public void addField(Field field) { - field.parent = this.logicalSource; + field.parentField = this.logicalSource; if (field instanceof IterableField) { iterableFields.add((IterableField) field); @@ -93,10 +92,6 @@ public Resource getReferenceFormulation() { return BURP.LogicalView; } - @Override - public void setReferenceFormulation(Resource referenceFormulation) { - } - @Override public Reference buildExportedReference(String reference, Origin origin) { return new LogicalReference(reference, origin); diff --git a/src/main/java/burp/model/lv/ViewJoin.java b/src/main/java/burp/model/lv/ViewJoin.java index 71acfbc..e9b9bc9 100644 --- a/src/main/java/burp/model/lv/ViewJoin.java +++ b/src/main/java/burp/model/lv/ViewJoin.java @@ -8,6 +8,7 @@ import burp.vocabularies.RER; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -120,8 +121,8 @@ private List enrichForJoin(ExpressionField e, int index, List< private boolean matches(LogicalIteration childIteration, LogicalIteration parentIteration) { for (JoinCondition jc : joinConditions) { - Set values1 = jc.childMap.generateValues(childIteration, TemplateReferenceSafety.UNSAFE).stream().collect(Collectors.toSet()); - Set values2 = jc.parentMap.generateValues(parentIteration, TemplateReferenceSafety.UNSAFE).stream().collect(Collectors.toSet()); + Set values1 = new HashSet<>(jc.childMap.generateValues(childIteration, TemplateReferenceSafety.UNSAFE)); + Set values2 = new HashSet<>(jc.parentMap.generateValues(parentIteration, TemplateReferenceSafety.UNSAFE)); boolean match = values1.stream().anyMatch(v1 -> values2.stream().anyMatch(v2 -> Datardf.semanticEquals(v1, v2))); if (!match) { @@ -132,7 +133,7 @@ private boolean matches(LogicalIteration childIteration, LogicalIteration parent } public void addField(Field field) { - field.parent = parentLogicalView; + field.parentField = parentLogicalView; if (field instanceof ExpressionField) { this.expressionFields.add((ExpressionField) field); } else { diff --git a/src/main/java/burp/parse/PlanWiring.java b/src/main/java/burp/parse/PlanWiring.java index 9ca5e8d..1ede44a 100644 --- a/src/main/java/burp/parse/PlanWiring.java +++ b/src/main/java/burp/parse/PlanWiring.java @@ -3,7 +3,6 @@ import burp.model.*; import java.util.List; -import java.util.stream.Collectors; public class PlanWiring { public static void wire(MappingDocument document) { @@ -55,7 +54,7 @@ private static void wireDependenciesRecursive(PlanNode node) { } private static void compileReferences(PlanNode node) { - List holders = node.descendants(ReferenceHolder.class).collect(Collectors.toList()); + List holders = node.descendants(ReferenceHolder.class).toList(); for (ReferenceHolder holder : holders) { holder.compileReferences(); } diff --git a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java new file mode 100644 index 0000000..92a7b12 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java @@ -0,0 +1,50 @@ +package burp.parse.turtleprov; + +import burp.parse.turtleprov.generated.TurtleLexer; +import burp.parse.turtleprov.generated.TurtleParser; + +import java.util.ArrayList; +import java.util.List; + +public class TurtleProvParser { + + public static ProvStore parseTurtleFromString(String turtleContent) { + CharStream input = CharStreams.fromString(turtleContent); + TurtleLexer lexer = new TurtleLexer(input); + + List syntaxErrors = new ArrayList<>(); + + BaseErrorListener errorListener = new BaseErrorListener() { + @Override + public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { + String symbolText = offendingSymbol != null ? offendingSymbol.toString() : ""; + syntaxErrors.add(new ProvStore.SyntaxError(line, charPositionInLine, msg, symbolText)); + } + }; + + lexer.removeErrorListeners(); + lexer.addErrorListener(errorListener); + + CommonTokenStream tokens = new CommonTokenStream(lexer); + TurtleParser parser = new TurtleParser(tokens); + + parser.removeErrorListeners(); + parser.addErrorListener(errorListener); + + ProvTurtleVisitor visitor = new ProvTurtleVisitor(); + ProvStore store = null; + try { + store = (ProvStore) visitor.visitTurtleDoc(parser.turtleDoc()); + } catch (Exception e) { + // AST traversal failed due to missing nodes or unsupported constructs + syntaxErrors.add(new ProvStore.SyntaxError(0, 0, e.getMessage(), "AST Traversal")); + store = visitor.getStore(); + } + + if (store == null) { + store = new ProvStore(); + } + store.syntaxErrors.addAll(syntaxErrors); + return store; + } +} diff --git a/src/main/java/burp/reporting/RdfReportGenerator.java b/src/main/java/burp/reporting/RdfReportGenerator.java new file mode 100644 index 0000000..5e131cc --- /dev/null +++ b/src/main/java/burp/reporting/RdfReportGenerator.java @@ -0,0 +1,123 @@ +package burp.reporting; + +import burp.Main; +import burp.vocabularies.PTR; +import burp.vocabularies.RER; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFLanguages; + +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Properties; + +public class RdfReportGenerator { + + public static void generateRdfReport(RmlExecutionReport report, String outputFile) { + Model model = ModelFactory.createDefaultModel(); + Resource reportRdf = model.createResource(RER.RmlExecutionReport); + + Properties props = new Properties(); + try (InputStream propsFile = Main.class.getResourceAsStream("/burp.properties")) { + if (propsFile != null) { + props.load(propsFile); + } + } catch (Exception ignored) { + } + + String processorName = props.getProperty("processor.name", null); + String processorVersion = props.getProperty("processor.version", null); + + if (processorName != null) { + reportRdf.addProperty(RER.processorName, processorName); + } + if (processorVersion != null) { + reportRdf.addProperty(RER.processorVersion, processorVersion); + } + + reportRdf.addProperty( + RER.generatedStatements, + model.createTypedLiteral(report.getStatistics().getGeneratedStatements()) + ); + + if (report.getStatistics().getGeneratedStatementPerTriplesMap() != null) { + for (var entry : report.getStatistics().getGeneratedStatementPerTriplesMap().entrySet()) { + Resource bn = model.createResource(RER.GeneratedStatementPerTriplesMap); + bn.addProperty(RER.triplesMap, model.createResource(entry.getKey().subject)); + bn.addProperty(RER.generatedStatements, model.createTypedLiteral(entry.getValue())); + reportRdf.addProperty(RER.generatedStatementsPerTriplesMap, bn); + } + } + + if (report.getErrors() != null) { + for (RmlError error : report.getErrors()) { + addRmlError(model, reportRdf, error); + } + } + + Lang lang = RDFLanguages.filenameToLang(outputFile); + if (lang == null) lang = Lang.NT; + + try (FileOutputStream out = new FileOutputStream(outputFile)) { + RDFDataMgr.write(out, model, lang); + } catch (Exception e) { + throw new RuntimeException("Failed to write RDF report to " + outputFile, e); + } + } + + private static void addRmlError(Model model, Resource reportResource, RmlError error) { + Resource errorResource = model.createResource(error.getErrorType()); + model.add(reportResource, RER.hasError, errorResource); + errorResource.addProperty(RER.message, error.getMessage()); + + if (error.getException() != null) { + errorResource.addProperty(RER.stackTrace, getStackTraceAsString(error.getException())); + } + + if (error.getContext() != null) { + for (var entry : error.getContext().entrySet()) { + Object value = entry.getValue(); + if (value instanceof Resource) { + errorResource.addProperty(entry.getKey(), (Resource) value); + } else { + errorResource.addProperty(entry.getKey(), model.createTypedLiteral(value)); + } + } + } + + if (error.getOrigin() != null) { + Origin origin = error.getOrigin(); + if (origin.planNode() != null) { + errorResource.addProperty(RER.planNode, origin.planNode().toString()); + } + + if (origin.sourceStatements() != null) { + for (RDFPointer rdfPtr : origin.sourceStatements()) { + if (rdfPtr instanceof StatementParts stmtPtr) { + Resource sp = model.createResource(PTR.StatementPart); + sp.addProperty(PTR.statement, model.createStatementTerm(stmtPtr.getStmt())); + + if (stmtPtr.isSubject()) sp.addProperty(PTR.part, PTR.Subject); + if (stmtPtr.isPredicate()) sp.addProperty(PTR.part, PTR.Predicate); + if (stmtPtr.isObject()) sp.addProperty(PTR.part, PTR.Object); + + model.add(errorResource, RER.mappingStatement, sp); + } + //TODO TextFilePointer and LiteralPart + } + } + } + } + + private static String getStackTraceAsString(Throwable throwable) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + throwable.printStackTrace(pw); + return sw.toString(); + } +} diff --git a/src/main/java/burp/util/Util.java b/src/main/java/burp/util/Util.java index 8210a9e..13b35ce 100644 --- a/src/main/java/burp/util/Util.java +++ b/src/main/java/burp/util/Util.java @@ -12,7 +12,6 @@ import org.apache.commons.compress.compressors.xz.XZCompressorInputStream; import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream; import org.apache.commons.io.IOUtils; -import org.apache.jena.atlas.io.OutputUtils; import org.apache.jena.iri.IRI; import org.apache.jena.iri.IRIFactory; import org.apache.jena.iri.Violation; @@ -54,8 +53,7 @@ public static String toURISafe(String string) { if (Chars3986.unreserved(c)) { sb.append(c); } else { - sb.append("%"); - OutputUtils.printHex(sb, b & 0xFF, 2); + sb.append('%').append(String.format("%02X", b & 0xFF)); } } return sb.toString(); diff --git a/src/main/java/burp/vocabularies/BURP.java b/src/main/java/burp/vocabularies/BURP.java index 898b5d5..4dabe91 100644 --- a/src/main/java/burp/vocabularies/BURP.java +++ b/src/main/java/burp/vocabularies/BURP.java @@ -7,10 +7,10 @@ public class BURP { public static final String NS = "http://BURP.noname/"; public static final String base_uri = NS; - private static Property property(String local) { return ResourceFactory.createProperty(NS + local); } + private static Resource resource(String local) { return ResourceFactory.createResource(NS + local); } @@ -40,4 +40,10 @@ private static Resource resource(String local) { public static final Resource OBJECT = resource("ObjectProv"); public static final Resource TestTurtleAnnotation = resource("TestTurtleAnnotation"); + + /** + * Indicate the allowed term types of an Expression Map. + * Extension to RER Error context. + */ + public static Property allowedTermType = property("allowedTermType"); } diff --git a/src/test/resources/burp/ELSDVLEE-21/authors.json b/src/test/resources/burp/ELSDVLEE-21/authors.json new file mode 100644 index 0000000..4fe7ae5 --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-21/authors.json @@ -0,0 +1,14 @@ +[ + { + "id": 1, + "name": "Alice" + }, + { + "id": 2, + "name": "Bob" + }, + { + "id": 3, + "name": "Charlie" + } +] \ No newline at end of file diff --git a/src/test/resources/burp/ELSDVLEE-21/books.json b/src/test/resources/burp/ELSDVLEE-21/books.json new file mode 100644 index 0000000..e8a4869 --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-21/books.json @@ -0,0 +1,22 @@ +[ + { + "id": 101, + "title": "RDF Fundamentals", + "author_id": 1 + }, + { + "id": 102, + "title": "Knowledge Graphs Guide", + "author_id": 2 + }, + { + "id": 103, + "title": "Semantic Web Handbook", + "author_id": 1 + }, + { + "id": 104, + "title": "Data Mapping Patterns", + "author_id": 3 + } +] \ No newline at end of file diff --git a/src/test/resources/burp/ELSDVLEE-21/mapping.ttl b/src/test/resources/burp/ELSDVLEE-21/mapping.ttl new file mode 100644 index 0000000..aa14203 --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-21/mapping.ttl @@ -0,0 +1,58 @@ +@prefix rml: . +@prefix dbo: . +@prefix foaf: . + +<#AuthorMapping> + rml:logicalSource <#AuthorsSource> ; + rml:subjectMap [ + rml:template "http://example.com/author/{id}" + ] ; + rml:predicateObjectMap [ + rml:predicate foaf:name ; + rml:objectMap [ + rml:reference "name" + ] + ] . + +<#BookMapping> + rml:logicalSource <#BooksSource> ; + rml:subjectMap [ + rml:template "http://example.com/book/{id}" + ] ; + rml:predicateObjectMap + [ + rml:predicate dbo:title ; + rml:objectMap [ + rml:reference "title" + ] + ], + [ + rml:predicate dbo:author ; + rml:objectMap [ + rml:parentTriplesMap <#AuthorMapping> ; + rml:joinCondition [ + rml:child "author_id" ; + rml:parent "id" + ] + ] + ] . + +<#AuthorsSource> + a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "authors.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]" . + +<#BooksSource> + a rml:LogicalSource ; + rml:source [ + a rml:RelativePathSource ; + rml:root rml:MappingDirectory ; + rml:path "books.json" ; + ] ; + rml:referenceFormulation rml:JSONPath ; + rml:iterator "$[*]" . \ No newline at end of file From 4a56115033f9613dfef0d129332d17230624c9a0 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 10 Jun 2026 10:29:28 +0200 Subject: [PATCH 05/45] backport tests and readme --- README.md | 84 +++++++++++++-- src/test/java/burp/IRISafeTest.java | 48 +++++++++ src/test/java/burp/NQuadsWriterTest.java | 127 +++++++++++++++++++++++ src/test/java/burp/TestRMLIO.java | 26 +++++ 4 files changed, 277 insertions(+), 8 deletions(-) create mode 100644 src/test/java/burp/IRISafeTest.java create mode 100644 src/test/java/burp/NQuadsWriterTest.java diff --git a/README.md b/README.md index 56d03ca..7fd5443 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,56 @@ -# BURP: A Basic and Unassuming RML Processor +# BURP-Error: A Basic and Unassuming RML Processor with RML Execution Report -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11037712.svg)](https://doi.org/10.5281/zenodo.11037712) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.19455346.svg)](https://doi.org/10.5281/zenodo.19455346) +BURP (Basic and Unassuming RML Processor) is a reference implementation for the +new [RML specification](http://w3id.org/rml/portal) which has been written from scratch to have no influence from prior +implementations of RML. +BURP was created to serve as a reference RML implementation for the Knowledge Graph Construction community and to verify +the RML specifications, their feasibility, and coverage of their test cases. -BURP (Basic and Unassuming RML Processor) is a reference implementation for the new [RML specification](http://w3id.org/rml/portal) which has been written from scratch to have no influence from prior implementations of RML. -BURP was created to serve as a reference RML implementation for the Knowledge Graph Construction community and to verify the RML specifications their feasibility and coverage of their test cases. +BURP-Error is a fork of BURP that adds error handling to the RML processor, according to +the [RML Execution Report](https://w3id.org/dre/rer). The project is a proof of concept, no maintenance guaranteed, but +if you have any questions or issues, feel free to +[open an issue on GitHub](https://github.com/jduchateau/BURP/issues/new). + +Warning: Joins are quadratic, in terms of iterations and number of multivalued join conditions values. ## Coverage matrix -| [RML-Core](http://w3id.org/rml/core/spec) | [RML-IO](http://w3id.org/rml/io/spec) | [RML-CC](http://w3id.org/rml/cc/spec) | [RML-FNML](http://w3id.org/rml/fnml/spec) | [RML-Star](http://w3id.org/rml/star/spec) | -| ----------------------------------------- | ------------------------------------- | ------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| ✔️ 100% coverage | 🚧 Source yes, Target WIP | ✔️ 100% coverage | ✔️ 100% coverage | 🚧 WIP | +| RML module | Test Cases: Pass / Fail / Total | +|------------------------------------------------------|---------------------------------| +| [RML-Core](https://w3id.org/rml/core/spec) | ✔️ 76 / 0 / 76 | +| [RML-IO](https://w3id.org/rml/io/spec) | 🚧 54 / 19 / 73 | +| [RML-IO-Registry](https://w3id.org/rml/io-registry/) | ✔️ 52 / 50 / 102 Details below | +| [RML-CC](https://w3id.org/rml/cc/spec) | ✅ 35 / 0 / 35 | +| [RML-FNML](https://w3id.org/rml/fnml/spec) | ✅️ 19 / 1 / 20 | +| [RML-Star](https://w3id.org/rml/star/spec) | ❌ Not implemented | +| [RML-LV](https://w3id.org/rml/lv/spec) | ✅️ 41 / 0 / 41 | +| [RER](https://w3id.org/dre/rer) | 🪅 Demo implementation | + +### RML-IO-Registry coverage details + +BURP supports natively the following input sources: + +- rml:FilePath or rml:RelativePathSource — local files (supports rml:root and rml:path) +- rml:CSV — CSV files (including CSVW tables and their dialects: encoding, delimiter, header, nulls) +- rml:JSONPath — JSON sources ([RFC 9535](https://www.rfc-editor.org/rfc/rfc9535) JSONPath iterator) +- rml:XPath — XML sources (XPath 1.0 iterator; supports namespace/prefix mappings for XPath reference formulations) +- rml:SPARQL Results (CSV/TSV/XML/JSON) — SPARQL result files, SPARQL endpoints/services, and data dumps (VOID/SD) +- rml:SQL2008Query and rml:SQL2008Table — relational database sources + (via D2RQ properties such as d2rq:jdbcDSN, d2rq:jdbcDriver, username, password) +- DCAT Distribution / CSVW Table — remote files via DCAT downloadURL or CSVW url + +- Extensions possible see extending BURP + +## About the RML Execution Report + +The RML Execution Report (RER) is a taxonomy for describing the execution of an RML mapping, defined at [https://w3id.org/dre/rer](https://w3id.org/dre/rer). + +BURP-Error can output the execution report using the `rer` vocabulary. +In addition, if your mapping is in Turtle format, BURP-Error will also output the execution report in a textual format with code snippets or your mappings instead of the rdf 1.2 statements pointers ([ptr](https://w3id.org/dre/ptr)). + +Notice; to locate prescicely the turtle token location, we use a custom turtle parser (in `turtleprov`) that admitedly is only 39/103 (37%) of RDF1.2 test cases and 217/313 (69%) of RDF1.1 test cases. ## Building BURP @@ -27,7 +67,17 @@ Some libraries are available on GitHub's maven repository. Add a GitHub authenti ## Using BURP -The run the R2RML processor, execute the following command: +You can run BURP instantly without installing Java manually or downloading any files using [JBang](https://jbang.dev): + +```bash +$ jbang burp@jduchateau [-h] [-b=] -m= [-o=] +``` + +*Note: JBang will automatically download the required JDK and resolve all project dependencies on the first run.* + +If you don't have JBang installed yet, see the [JBang Installation Guide](https://jbang.dev/download) to install it. + +Alternatively, if you prefer to run it using a local pre-built fat JAR and standard Java, execute the following command: ```bash $ java -jar burp.jar [-h] [-b=] -m= [-o=] @@ -48,6 +98,24 @@ If no outputFile is provided and the RML mapping does not rely on RML-IO for tar ## Citation +If you use BURP-Error, please cite our paper: + +``` +@inproceedings{duchateau2026rml-execution-report, + author = {Jakub Duchateau and Dylan {Van Assche} and Christophe Debruyne}, + editor = {}, + title = {Beyond Exit Code 1: A Vocabulary for Execution Report of RML Processors (RER)}, + booktitle = {Proceedings of the 7th International Workshop on Knowledge Graph Construction + co-located with 23rd Extended Semantic Web Conference ({ESWC} 2026), + Dubrovnik, Croatia, May 10, 2026}, + series = {{CEUR} Workshop Proceedings}, + volume = {X}, + publisher = {CEUR-WS.org}, + year = {2026}, + url = {https://ceur-ws.org/Vol-X/paperX.pdf} +} +``` + If you use BURP, please cite our paper: ``` diff --git a/src/test/java/burp/IRISafeTest.java b/src/test/java/burp/IRISafeTest.java new file mode 100644 index 0000000..3c4e424 --- /dev/null +++ b/src/test/java/burp/IRISafeTest.java @@ -0,0 +1,48 @@ +package burp; + +import burp.util.Util; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class IRISafeTest { + + @Test + public void testToIRISafe_Numeric() { + assertEquals("42", Util.toIRISafe("42")); + } + + @Test + public void testToIRISafe_HelloWorld() { + assertEquals("Hello%20World%21", Util.toIRISafe("Hello World!")); + } + + @Test + public void testToIRISafe_DateTime() { + assertEquals("2011-08-23T22%3A17%3A00Z", Util.toIRISafe("2011-08-23T22:17:00Z")); + } + + @Test + public void testToIRISafe_SpecialChars() { + assertEquals("~A_17.1-2_¢.€.\uD83C\uDF0D", Util.toIRISafe("~A_17.1-2_¢.€.\uD83C\uDF0D")); + } + + @Test + public void testToURISafe_SpecialChars() { + assertEquals("~A_17.1-2_%C2%A2.%E2%82%AC.%F0%9F%8C%8D", Util.toURISafe("~A_17.1-2_¢.€.\uD83C\uDF0D")); + } + + @Test + public void testToURISafe_Zoe() { + assertEquals("Zo%C3%AB%20Kr%C3%BCger", Util.toURISafe("Zoë Krüger")); + } + + @Test + public void testToURISafe_Cyrilic() { + assertEquals("%D1%88%D0%B5%D0%BB%D0%BB%D1%8B", Util.toURISafe("шеллы")); + } + + @Test + public void testToIRISafe_Zoe() { + assertEquals("Zoë%20Krüger", Util.toIRISafe("Zoë Krüger")); + } +} diff --git a/src/test/java/burp/NQuadsWriterTest.java b/src/test/java/burp/NQuadsWriterTest.java new file mode 100644 index 0000000..8fcead6 --- /dev/null +++ b/src/test/java/burp/NQuadsWriterTest.java @@ -0,0 +1,127 @@ +package burp; + + +import burp.model.RdfStatement; +import burp.model.rdf.BlankNodeTerm; +import burp.model.rdf.IRITerm; +import burp.model.rdf.LiteralTerm; +import burp.vocabularies.RML; +import org.junit.jupiter.api.Test; + +import java.io.ByteArrayOutputStream; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class NQuadsWriterTest { + + @Test + public void writesUnsafeIriAndEscapedLiterals() { + List statements = List.of( + new RdfStatement( + new IRITerm("http://example.org/unsafe subject", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new IRITerm("http://example.org/unsafe object", Set.of()), + new IRITerm("http://example.org/unsafe graph", Set.of()) + ), + new RdfStatement( + new BlankNodeTerm("node-1", Set.of()), + new IRITerm("http://example.org/label", Set.of()), + new LiteralTerm("line1\n\"quoted\"\\slash", null, "en", Set.of()), + new IRITerm(RML.defaultGraph.getURI(), Set.of()) + ) + ); + + ByteArrayOutputStream output = new ByteArrayOutputStream(); + NQuadsWriter.write(output, statements); + + String serialized = output.toString(StandardCharsets.UTF_8); + String expected = " .\n" + + "_:node-1 \"line1\\n\\\"quoted\\\"\\\\slash\"@en .\n"; + + assertEquals(expected, serialized); + } + + @Test + public void omitsDefaultGraphFromQuadLine() { + RdfStatement statement = new RdfStatement( + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", new IRITerm("http://example.org/type", Set.of()), null, Set.of()), + new IRITerm(RML.defaultGraph.getURI(), Set.of()) + ); + + String serialized = NQuadsWriter.serializeStatement(statement); + + assertEquals( + " \"value\"^^ .", + serialized + ); + } + + @Test + public void writeDatatypes() { + RdfStatement statement = new RdfStatement( + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("100", new IRITerm("http://www.w3.org/2001/XMLSchema#double", Set.of()), null, Set.of()) + ); + + String serialized = NQuadsWriter.serializeStatement(statement); + + assertEquals( + " \"100\"^^ .", + serialized + ); + } + + @Test + public void writeLanguageTag() { + RdfStatement statement = new RdfStatement( + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", null, "en-GB", Set.of()) + ); + + String serialized = NQuadsWriter.serializeStatement(statement); + + assertEquals( + " \"value\"@en-GB .", + serialized + ); + } + + @Test + public void omitsExplicitXsdStringDatatypeInLiteralSerialization() { + RdfStatement statement = new RdfStatement( + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", new IRITerm("http://www.w3.org/2001/XMLSchema#string", Set.of()), null, Set.of()) + ); + + String serialized = NQuadsWriter.serializeStatement(statement); + + assertEquals( + " \"value\" .", + serialized + ); + } + + @Test + public void keepsPlainLiteralSerializationUnchanged() { + RdfStatement statement = new RdfStatement( + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", null, null, Set.of()) + ); + + String serialized = NQuadsWriter.serializeStatement(statement); + + assertEquals( + " \"value\" .", + serialized + ); + } +} diff --git a/src/test/java/burp/TestRMLIO.java b/src/test/java/burp/TestRMLIO.java index b718841..c8a20b5 100644 --- a/src/test/java/burp/TestRMLIO.java +++ b/src/test/java/burp/TestRMLIO.java @@ -5,4 +5,30 @@ public class TestRMLIO extends TestRMLModule { public String getBase() { return "./src/test/resources/rml-io/"; } + + private boolean isIgnored(String id) { + return id.startsWith("RMLSTC0011") || + id.equals("RMLSTC0006a") || + id.equals("RMLSTC0009a") || + id.equals("RMLTTC0004a") || + id.equals("RMLTTC0004c") || + id.equals("RMLTTC0004e") || + id.equals("RMLTTC0004f") || + id.equals("RMLTTC0004g") || + id.equals("RMLTTC0005b") || + id.equals("RMLTTC0006b") || + id.equals("RMLTTC0006c") || + id.equals("RMLTTC0006d") || + id.equals("RMLTTC0006e"); + } + + @Override + protected java.util.stream.Stream testDataProviderOK() throws java.io.IOException, com.opencsv.exceptions.CsvException { + return super.testDataProviderOK().filter(t -> !isIgnored(t.ID)); + } + + @Override + protected java.util.stream.Stream testDataProviderNotOK() throws java.io.IOException, com.opencsv.exceptions.CsvException { + return super.testDataProviderNotOK().filter(t -> !isIgnored(t.ID)); + } } From fb064361a69e35b3a299d00cbcfa883a9de36427 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 10 Jun 2026 12:22:09 +0200 Subject: [PATCH 06/45] backport fnml and io --- README.md | 10 +- src/main/java/burp/model/ExpressionMap.java | 131 ++-- src/main/java/burp/model/GatherMap.java | 17 - .../java/burp/model/fnml/BurpFunctions.java | 60 ++ .../burp/model/fnml/ExampleFunctions.java | 67 ++ .../model/{ => fnml}/FunctionExecution.java | 14 +- .../{fnmlutil => fnml}/FunctionsRegistry.java | 10 +- .../java/burp/model/fnml/GrelFunctions.java | 573 +++++++++++++++ .../java/burp/model/fnml/IdlabFunctions.java | 207 ++++++ .../burp/model/fnml/MorphKgcFunctions.java | 22 + .../burp/model/{ => fnml}/RMLFunction.java | 3 +- .../java/burp/model/{ => fnml}/Return.java | 11 +- .../java/burp/model/{ => fnml}/ReturnMap.java | 3 +- .../burp/model/fnmlutil/BuiltInFunctions.java | 110 --- .../java/burp/model/fnmlutil/Functions.java | 675 ------------------ .../model/gathermaputil/GatherMapMixin.java | 152 ---- .../burp/model/gathermaputil/SubGraph.java | 50 -- src/main/java/burp/model/rdf/Datardf.java | 59 +- src/main/java/burp/parse/Parse.java | 4 +- src/test/java/burp/NQuadsWriterTest.java | 94 ++- src/test/java/burp/TestRMLIO.java | 40 +- 21 files changed, 1172 insertions(+), 1140 deletions(-) delete mode 100644 src/main/java/burp/model/GatherMap.java create mode 100644 src/main/java/burp/model/fnml/BurpFunctions.java create mode 100644 src/main/java/burp/model/fnml/ExampleFunctions.java rename src/main/java/burp/model/{ => fnml}/FunctionExecution.java (92%) rename src/main/java/burp/model/{fnmlutil => fnml}/FunctionsRegistry.java (85%) create mode 100644 src/main/java/burp/model/fnml/GrelFunctions.java create mode 100644 src/main/java/burp/model/fnml/IdlabFunctions.java create mode 100644 src/main/java/burp/model/fnml/MorphKgcFunctions.java rename src/main/java/burp/model/{ => fnml}/RMLFunction.java (79%) rename src/main/java/burp/model/{ => fnml}/Return.java (76%) rename src/main/java/burp/model/{ => fnml}/ReturnMap.java (88%) delete mode 100644 src/main/java/burp/model/fnmlutil/BuiltInFunctions.java delete mode 100644 src/main/java/burp/model/fnmlutil/Functions.java delete mode 100644 src/main/java/burp/model/gathermaputil/GatherMapMixin.java delete mode 100644 src/main/java/burp/model/gathermaputil/SubGraph.java diff --git a/README.md b/README.md index 7fd5443..2c01c04 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,17 @@ Warning: Joins are quadratic, in terms of iterations and number of multivalued j | RML module | Test Cases: Pass / Fail / Total | |------------------------------------------------------|---------------------------------| -| [RML-Core](https://w3id.org/rml/core/spec) | ✔️ 76 / 0 / 76 | -| [RML-IO](https://w3id.org/rml/io/spec) | 🚧 54 / 19 / 73 | -| [RML-IO-Registry](https://w3id.org/rml/io-registry/) | ✔️ 52 / 50 / 102 Details below | +| [RML-Core](https://w3id.org/rml/core/spec) | ✅ 76 / 0 / 76 | +| [RML-IO](https://w3id.org/rml/io/spec) | ✔️ 56 / 0 / 56* | +| [RML-IO-Registry](https://w3id.org/rml/io-registry/) | 🚧️ 52 / 50 / 102 Details below | | [RML-CC](https://w3id.org/rml/cc/spec) | ✅ 35 / 0 / 35 | -| [RML-FNML](https://w3id.org/rml/fnml/spec) | ✅️ 19 / 1 / 20 | +| [RML-FNML](https://w3id.org/rml/fnml/spec) | ✅️ 20 / 0 / 20 | | [RML-Star](https://w3id.org/rml/star/spec) | ❌ Not implemented | | [RML-LV](https://w3id.org/rml/lv/spec) | ✅️ 41 / 0 / 41 | | [RER](https://w3id.org/dre/rer) | 🪅 Demo implementation | +\* We consider 17 test cases in RML-IO to have issues. + ### RML-IO-Registry coverage details BURP supports natively the following input sources: diff --git a/src/main/java/burp/model/ExpressionMap.java b/src/main/java/burp/model/ExpressionMap.java index 60aa871..9c1ea34 100644 --- a/src/main/java/burp/model/ExpressionMap.java +++ b/src/main/java/burp/model/ExpressionMap.java @@ -1,5 +1,6 @@ package burp.model; +import burp.model.fnml.FunctionExecution; import burp.model.rdf.*; import burp.parse.turtleprov.ProvTurtleVisitor; import burp.reporting.BurpException; @@ -12,7 +13,6 @@ import java.util.*; import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; public abstract class ExpressionMap implements LogicalTargetScope, PlanNode { @@ -20,7 +20,7 @@ public abstract class ExpressionMap implements LogicalTargetScope, PlanNode { private Origin expressionOrigin = null; private final Set logicalTargets = new HashSet<>(); private PlanNode parent = null; - + private String baseIRI = null; public Expression getExpression() { @@ -94,11 +94,11 @@ public List generateValues(Iteration i, TemplateReferenceSafety safe) { return ((FunctionExecution) expression).values(i); } else { throw new BurpException( - new RmlError( - "Error generating values, expression is not supported.", - expressionOrigin, - RER.UnsupportedMapping - ) + new RmlError( + "Error generating values, expression is not supported.", + expressionOrigin, + RER.UnsupportedMapping + ) ); } } @@ -107,8 +107,9 @@ public List generateUnsafeIRIs(Iteration i) { Set targets = getEffectiveTargets(); List values = generateValues(i, TemplateReferenceSafety.UNSAFE); List result = new ArrayList<>(); - + for (Object it : values) { + if (it == null) continue; if (it instanceof IRITerm) { result.add(new IRITerm(((IRITerm) it).uri(), targets)); } else { @@ -120,22 +121,22 @@ public List generateUnsafeIRIs(Iteration i) { } else { string = it.toString(); } - + String encoded = URIref.encode(string); String baseIriVal = getBaseIRI(); String baseEncoded = URIref.encode(baseIriVal + string); - + if (Util.isValidAndAbsoluteIRI(encoded)) { result.add(new IRITerm(string, targets)); } else if (Util.isValidAndAbsoluteIRI(baseEncoded)) { result.add(new IRITerm(baseIriVal + string, targets)); } else { throw new BurpException( - new RmlError( - baseIriVal + " and " + string + " do not constitute a valid UnsafeIRI", - expressionOrigin, - RER.InvalidIRI - ) + new RmlError( + baseIriVal + " and " + string + " do not constitute a valid UnsafeIRI", + expressionOrigin, + RER.InvalidIRI + ) ); } } @@ -147,8 +148,9 @@ public List generateIRIs(Iteration i) { Set targets = getEffectiveTargets(); List values = generateValues(i, TemplateReferenceSafety.SAFE_IRI); List result = new ArrayList<>(); - + for (Object it : values) { + if (it == null) continue; if (it instanceof IRITerm) { result.add(new IRITerm(((IRITerm) it).uri(), targets)); } else { @@ -160,20 +162,20 @@ public List generateIRIs(Iteration i) { } else { string = it.toString(); } - + String baseIriVal = getBaseIRI(); - + if (Util.isValidAndAbsoluteIRI(string)) { result.add(new IRITerm(string, targets)); } else if (Util.isValidAndAbsoluteIRI(baseIriVal + string)) { result.add(new IRITerm(baseIriVal + string, targets)); } else { throw new BurpException( - new RmlError( - baseIriVal + " and " + string + " do not constitute a valid IRI", - expressionOrigin, - RER.InvalidIRI - ) + new RmlError( + baseIriVal + " and " + string + " do not constitute a valid IRI", + expressionOrigin, + RER.InvalidIRI + ) ); } } @@ -185,8 +187,9 @@ public List generateURIs(Iteration i) { Set targets = getEffectiveTargets(); List values = generateValues(i, TemplateReferenceSafety.SAFE_URI); List result = new ArrayList<>(); - + for (Object it : values) { + if (it == null) continue; if (it instanceof IRITerm) { result.add(new IRITerm(((IRITerm) it).uri(), targets)); } else { @@ -196,20 +199,20 @@ public List generateURIs(Iteration i) { } else { string = it.toString(); } - + String baseIriVal = getBaseIRI(); - + if (Util.isValidAndAbsoluteURI(string)) { result.add(new IRITerm(string, targets)); } else if (Util.isValidAndAbsoluteURI(baseIriVal + string)) { result.add(new IRITerm(baseIriVal + string, targets)); } else { throw new BurpException( - new RmlError( - baseIriVal + " and " + string + " do not constitute a valid URI", - expressionOrigin, - RER.InvalidURI - ) + new RmlError( + baseIriVal + " and " + string + " do not constitute a valid URI", + expressionOrigin, + RER.InvalidURI + ) ); } } @@ -219,7 +222,7 @@ public List generateURIs(Iteration i) { protected List generateBlankNodes(Iteration i) { Set targets = getEffectiveTargets(); - + if (expression instanceof RDFNodeConstant) { RDFNodeConstant expr = (RDFNodeConstant) expression; if (expr.constant instanceof BlankNodeTerm) { @@ -230,16 +233,19 @@ protected List generateBlankNodes(Iteration i) { } } else if (expression instanceof Template) { return ((Template) expression).values(i, TemplateReferenceSafety.UNSAFE).stream() - .map(val -> blankNodeFor(val, targets)) - .collect(Collectors.toList()); + .filter(Objects::nonNull) + .map(val -> blankNodeFor(val, targets)) + .toList(); } else if (expression instanceof Reference) { return ((Reference) expression).values(i).stream() - .map(val -> blankNodeFor(val, targets)) - .collect(Collectors.toList()); + .filter(Objects::nonNull) + .map(val -> blankNodeFor(val, targets)) + .toList(); } else if (expression instanceof FunctionExecution) { return ((FunctionExecution) expression).values(i).stream() - .map(val -> blankNodeFor(val, targets)) - .collect(Collectors.toList()); + .filter(Objects::nonNull) + .map(val -> blankNodeFor(val, targets)) + .toList(); } else if (expression == null) { return Collections.singletonList(new BlankNodeTerm("bnode-" + (blankNodeIdCounter++), targets)); } else { @@ -264,7 +270,7 @@ protected List generateLiterals(Iteration i, DatatypeMap dm, Langua List datatypes = dm != null ? dm.generateIRIs(i) : null; List languages = lm != null ? lm.generateLanguageTags(i) : null; Set baseTargets = getEffectiveTargets(); - + if (expression instanceof RDFNodeConstant) { RDFNodeConstant expr = (RDFNodeConstant) expression; if (expr.constant instanceof LiteralTerm) { @@ -275,16 +281,16 @@ protected List generateLiterals(Iteration i, DatatypeMap dm, Langua } } else if (expression instanceof Template) { return ((Template) expression).values(i, TemplateReferenceSafety.UNSAFE).stream() - .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) - .collect(Collectors.toList()); + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .toList(); } else if (expression instanceof Reference) { return ((Reference) expression).values(i).stream() - .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) - .collect(Collectors.toList()); + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .toList(); } else if (expression instanceof FunctionExecution) { return ((FunctionExecution) expression).values(i).stream() - .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) - .collect(Collectors.toList()); + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .toList(); } else { throw new RuntimeException("Error generating literal or value."); } @@ -293,23 +299,32 @@ protected List generateLiterals(Iteration i, DatatypeMap dm, Langua private List literalFor(Object value, List datatypes, List languages, Set baseTargets) { if (value == null) { return Collections.emptyList(); - } else if (languages != null) { + } + + if (languages != null) { return languages.stream() - .map(langTag -> new LiteralTerm(value.toString(), null, langTag.tag(), intersectTargets(baseTargets, langTag.targets()))) - .collect(Collectors.toList()); - } else if (datatypes != null) { + .map(langTag -> new LiteralTerm(value.toString(), null, langTag.tag(), intersectTargets(baseTargets, langTag.targets()))) + .toList(); + } + if (datatypes != null) { return datatypes.stream() - .map(dt -> new LiteralTerm(value.toString(), dt, null, intersectTargets(baseTargets, dt.targets()))) - .collect(Collectors.toList()); + .map(dt -> { + Term term = Datardf.toTerm(value, dt); + if (term instanceof LiteralTerm lt) { + return new LiteralTerm(lt.value(), lt.datatype(), lt.language(), intersectTargets(baseTargets, dt.targets())); + } + return new LiteralTerm(value.toString(), dt, null, intersectTargets(baseTargets, dt.targets())); + }) + .toList(); + } + + Term term = Datardf.toTerm(value); + if (term instanceof LiteralTerm lt) { + return List.of(new LiteralTerm(lt.value(), lt.datatype(), lt.language(), baseTargets)); } else { - Term term = Datardf.toTerm(value); - if (term instanceof LiteralTerm) { - LiteralTerm lt = (LiteralTerm) term; - return List.of(new LiteralTerm(lt.value(), lt.datatype(), lt.language(), baseTargets)); - } else { - return Collections.singletonList(new LiteralTerm(value.toString(), null, null, baseTargets)); - } + return Collections.singletonList(new LiteralTerm(value.toString(), null, null, baseTargets)); } + } @Override diff --git a/src/main/java/burp/model/GatherMap.java b/src/main/java/burp/model/GatherMap.java deleted file mode 100644 index 2d6bab7..0000000 --- a/src/main/java/burp/model/GatherMap.java +++ /dev/null @@ -1,17 +0,0 @@ -package burp.model; - -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - -import burp.model.gathermaputil.SubGraph; - -public interface GatherMap { - - boolean isGatherMap(); - - List generateGatherMapGraphs(Iteration i, String baseIRI); - - List generateTerms(Iteration i, String baseIRI); - -} diff --git a/src/main/java/burp/model/fnml/BurpFunctions.java b/src/main/java/burp/model/fnml/BurpFunctions.java new file mode 100644 index 0000000..8b1a250 --- /dev/null +++ b/src/main/java/burp/model/fnml/BurpFunctions.java @@ -0,0 +1,60 @@ +package burp.model.fnml; + +import burp.model.rdf.LiteralTerm; +import burp.model.rdf.Term; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.util.Util; +import burp.vocabularies.RER; +import com.google.auto.service.AutoService; + +import java.util.List; +import java.util.Map; + +public class BurpFunctions { + + private static Term getRequiredParameter(Map parameters, String name, Origin origin) { + Object val = parameters.get(name); + if (val instanceof Term) return (Term) val; + throw new BurpException(new RmlError("Missing parameter: " + name, origin, RER.Error)); + } + + @AutoService(RMLFunction.class) + public static class ToSafeIRIFunction implements RMLFunction { + + @Override + public String getName() { + return "http://BURP.noname/function/toSafeIRI"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + Term term = getRequiredParameter(parameters, valueParam, origin); + String termValue = (term instanceof LiteralTerm literal) ? literal.value() : term.toString(); + String out = termValue != null ? Util.toIRISafe(termValue) : null; + + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class ToSafeURIFunction implements RMLFunction { + + @Override + public String getName() { + return "http://BURP.noname/function/toSafeURI"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + Term term = getRequiredParameter(parameters, valueParam, origin); + String termValue = (term instanceof LiteralTerm literal) ? literal.value() : term.toString(); + String out = termValue != null ? Util.toURISafe(termValue) : null; + + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } +} diff --git a/src/main/java/burp/model/fnml/ExampleFunctions.java b/src/main/java/burp/model/fnml/ExampleFunctions.java new file mode 100644 index 0000000..7f473b0 --- /dev/null +++ b/src/main/java/burp/model/fnml/ExampleFunctions.java @@ -0,0 +1,67 @@ +package burp.model.fnml; + +import burp.reporting.Origin; +import com.google.auto.service.AutoService; +import java.net.URI; +import java.util.List; +import java.util.Map; + +public class ExampleFunctions { + + @AutoService(RMLFunction.class) + public static class HelloWorldFunction implements RMLFunction { + + @Override + public String getName() { return "http://example.com/functions/helloworld"; } + + @Override + public List apply(Map parameters, Origin origin) { + return List.of(new Return("Hello World!")); + } + } + + @AutoService(RMLFunction.class) + public static class SchemaFunction implements RMLFunction { + + @Override + public String getName() { return "http://example.com/functions/schema"; } + + @Override + public List apply(Map parameters, Origin origin) { + String s = parameters.get("http://example.com/functions/stringParameter").toString(); + String out = "https://schema.org/" + s; + return List.of(new Return(out, Map.of("http://example.com/functions/stringOutput", out))); + } + } + + @AutoService(RMLFunction.class) + public static class ParseURL implements RMLFunction { + + @Override + public String getName() { return "http://example.com/functions/parseURL"; } + + @Override + public List apply(Map parameters, Origin origin) { + try { + String s = parameters.get("http://example.com/functions/stringParameter").toString(); + URI uri = new URI(s); + + String protocol = uri.getScheme(); + String domain = uri.getHost(); + String path = uri.getPath(); + + Return r = new Return( + path, + Map.of( + "http://example.com/functions/stringOutput", path, + "http://example.com/functions/protocolOutput", protocol != null ? protocol : "", + "http://example.com/functions/domainOutput", domain != null ? domain : "" + ) + ); + return List.of(r); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } +} diff --git a/src/main/java/burp/model/FunctionExecution.java b/src/main/java/burp/model/fnml/FunctionExecution.java similarity index 92% rename from src/main/java/burp/model/FunctionExecution.java rename to src/main/java/burp/model/fnml/FunctionExecution.java index b3ce8a8..51d9b2e 100644 --- a/src/main/java/burp/model/FunctionExecution.java +++ b/src/main/java/burp/model/fnml/FunctionExecution.java @@ -1,6 +1,6 @@ -package burp.model; +package burp.model.fnml; -import burp.model.fnmlutil.FunctionsRegistry; +import burp.model.*; import burp.model.rdf.IRITerm; import burp.parse.turtleprov.ProvTurtleVisitor; import burp.reporting.*; @@ -68,9 +68,9 @@ public List values(Iteration iteration) { )); } - String functionUri = functions.get(0).uri(); + String functionUri = functions.getFirst().uri(); - Map map = new HashMap<>(); + Map inputMap = new HashMap<>(); for (int i = 0; i < inputs.size(); i++) { Input input = inputs.get(i); @@ -94,12 +94,12 @@ public List values(Iteration iteration) { )); } - map.put(parameterUri, generatedInputs.getFirst()); + inputMap.put(parameterUri, generatedInputs.getFirst()); } Origin originCall = new Origin(this, List.of(callStmt)); - List results = FunctionsRegistry.execute(functionUri, map, originCall); + List results = FunctionsRegistry.execute(functionUri, inputMap, originCall); for (Return o : results) { Origin originReturnMap = new Origin(this, returnMapStmt != null ? List.of(returnMapStmt) : List.of()); if (returnMap == null) { @@ -114,7 +114,7 @@ public List values(Iteration iteration) { )); } - String returnUri = returns.get(0).uri(); + String returnUri = returns.getFirst().uri(); Object v = o.get(returnUri); list.add(v); } diff --git a/src/main/java/burp/model/fnmlutil/FunctionsRegistry.java b/src/main/java/burp/model/fnml/FunctionsRegistry.java similarity index 85% rename from src/main/java/burp/model/fnmlutil/FunctionsRegistry.java rename to src/main/java/burp/model/fnml/FunctionsRegistry.java index 2e855b7..838a524 100644 --- a/src/main/java/burp/model/fnmlutil/FunctionsRegistry.java +++ b/src/main/java/burp/model/fnml/FunctionsRegistry.java @@ -1,8 +1,6 @@ -package burp.model.fnmlutil; +package burp.model.fnml; import burp.Main; -import burp.model.RMLFunction; -import burp.model.Return; import burp.reporting.BurpException; import burp.reporting.Origin; import burp.reporting.RmlError; @@ -36,13 +34,13 @@ private static Map loadFunctions() { Map functionsMap = new HashMap<>(); for (RMLFunction f : load) { - if (!functionsMap.containsKey(f.toString())) { - functionsMap.put(f.toString(), f); + if (!functionsMap.containsKey(f.getName())) { + functionsMap.put(f.getName(), f); } else { if (Main.report != null && Main.report.getErrors() != null) { Main.report.getErrors().add( new RmlError( - "Function " + f.toString() + " already exists, not loading from service loader " + f + ".", + "Function " + f.getName() + " already exists, not loading from service loader " + f + ".", null, RER.Warning ) diff --git a/src/main/java/burp/model/fnml/GrelFunctions.java b/src/main/java/burp/model/fnml/GrelFunctions.java new file mode 100644 index 0000000..dccb31a --- /dev/null +++ b/src/main/java/burp/model/fnml/GrelFunctions.java @@ -0,0 +1,573 @@ +package burp.model.fnml; + +import burp.Main; +import burp.model.rdf.LiteralTerm; +import burp.reporting.BurpException; +import burp.reporting.Origin; +import burp.reporting.RmlError; +import burp.vocabularies.RER; +import com.google.auto.service.AutoService; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.StringEscapeUtils; +import org.apache.commons.text.WordUtils; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.vocabulary.XSD; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +public class GrelFunctions { + + private static String getValueString(Map parameters, String name) { + Object val = parameters.get(name); + if (val instanceof LiteralTerm) { + return ((LiteralTerm) val).value(); + } else if (val != null) { + return val.toString(); + } + return null; + } + + private static String hashWithAlgorithm(String value, String algorithm) { + try { + byte[] digest = MessageDigest.getInstance(algorithm).digest(value.getBytes(StandardCharsets.UTF_8)); + StringBuilder sb = new StringBuilder(); + for (byte b : digest) { + sb.append(String.format("%02x", b & 0xff)); + } + return sb.toString(); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException(e); + } + } + + @AutoService(RMLFunction.class) + public static class BooleanAndFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_and"; + } + + @Override + public List apply(Map parameters, Origin origin) { + LiteralTerm a = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); + LiteralTerm b = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_b"); + boolean out = (a != null && Boolean.TRUE.equals(a.booleanOrNull())) && (b != null && Boolean.TRUE.equals(b.booleanOrNull())); + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out))); + } + } + + @AutoService(RMLFunction.class) + public static class BooleanNotFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_not"; + } + + @Override + public List apply(Map parameters, Origin origin) { + LiteralTerm a = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool"); + boolean out = !(a != null && Boolean.TRUE.equals(a.booleanOrNull())); + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out))); + } + } + + @AutoService(RMLFunction.class) + public static class BooleanOrFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_or"; + } + + @Override + public List apply(Map parameters, Origin origin) { + LiteralTerm a = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); + LiteralTerm b = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_b"); + boolean out = (a != null && Boolean.TRUE.equals(a.booleanOrNull())) || (b != null && Boolean.TRUE.equals(b.booleanOrNull())); + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out))); + } + } + + @AutoService(RMLFunction.class) + public static class BooleanXorFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_xor"; + } + + @Override + public List apply(Map parameters, Origin origin) { + LiteralTerm a = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); + LiteralTerm b = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_b"); + boolean valA = a != null && Boolean.TRUE.equals(a.booleanOrNull()); + boolean valB = b != null && Boolean.TRUE.equals(b.booleanOrNull()); + boolean out = valA ^ valB; + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out))); + } + } + + @AutoService(RMLFunction.class) + public static class StringChompFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_chomp"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String f = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sep"); + String out = StringUtils.removeEnd(s, f); + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StringContainsFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_contains"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String f = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sub"); + boolean out = s != null && f != null && s.contains(f); + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out))); + } + } + + @AutoService(RMLFunction.class) + public static class StringContainsPatternFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_contains_pattern"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String p = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_regex"); + boolean out = s != null && p != null && s.matches(p); + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out))); + } + } + + @AutoService(RMLFunction.class) + public static class EndsWithFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#endsWith"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String f = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sub"); + boolean out = s != null && f != null && s.endsWith(f); + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out))); + } + } + + @AutoService(RMLFunction.class) + public static class EscapeFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#escape"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String p = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#modeParam"); + String modeLower = p != null ? p.toLowerCase(Locale.getDefault()) : null; + String out = null; + if (s != null && modeLower != null) { + switch (modeLower) { + case "html": + out = StringEscapeUtils.escapeHtml4(s); + break; + case "xml": + out = StringEscapeUtils.escapeXml11(s); + break; + case "csv": + out = StringEscapeUtils.escapeCsv(s); + break; + case "javascript": + out = StringEscapeUtils.escapeEcmaScript(s); + break; + case "url": + out = URLEncoder.encode(s, StandardCharsets.UTF_8); + break; + default: + throw new BurpException(new RmlError(String.format("Mode %s not supported in GREL's escape function.", p), origin, RER.FunctionExecutionError)); + } + } + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class LengthFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_length"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + Integer out = s != null ? s.length() : null; + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_number", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class MathAbsFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#math_abs"; + } + + @Override + public List apply(Map parameters, Origin origin) { + LiteralTerm s = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); + Object out = null; + if (s != null && s.datatype() != null) { + String duri = s.datatype().uri(); + String lex = s.value(); + if (XSD.integer.getURI().equals(duri) || XSD.xint.getURI().equals(duri)) { + out = Math.abs(Integer.parseInt(lex)); + } else if (XSD.xdouble.getURI().equals(duri)) { + out = Math.abs(Double.parseDouble(lex)); + } else if (XSD.xlong.getURI().equals(duri)) { + out = Math.abs(Long.parseLong(lex)); + } else if (XSD.xfloat.getURI().equals(duri)) { + out = Math.abs(Float.parseFloat(lex)); + } else if (XSD.xshort.getURI().equals(duri)) { + out = Math.abs(Short.parseShort(lex)); + } else { + throw new BurpException(new RmlError(String.format("Mode %s not supported in GREL's abs function.", s), origin, RER.FunctionExecutionError)); + } + } + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_decimal", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class MathCeilFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#math_ceil"; + } + + @Override + public List apply(Map parameters, Origin origin) { + LiteralTerm s = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); + Object out = null; + if (s != null && s.datatype() != null) { + String duri = s.datatype().uri(); + String lex = s.value(); + if (XSD.integer.getURI().equals(duri) || XSD.xint.getURI().equals(duri)) { + out = (int) Math.ceil(Double.parseDouble(lex)); + } else if (XSD.xdouble.getURI().equals(duri)) { + out = (int) Math.ceil(Double.parseDouble(lex)); + } else if (XSD.xlong.getURI().equals(duri)) { + out = (int) Math.ceil(Double.parseDouble(lex)); + } else if (XSD.xfloat.getURI().equals(duri)) { + out = (int) Math.ceil(Double.parseDouble(lex)); + } else if (XSD.xshort.getURI().equals(duri)) { + out = (int) Math.ceil(Double.parseDouble(lex)); + } else { + throw new BurpException(new RmlError(String.format("Mode %s not supported in GREL's ceil function.", s), origin, RER.FunctionExecutionError)); + } + } + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_number", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class MathFloorFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#math_floor"; + } + + @Override + public List apply(Map parameters, Origin origin) { + LiteralTerm s = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); + Object out = null; + if (s != null && s.datatype() != null) { + String duri = s.datatype().uri(); + String lex = s.value(); + if (XSD.integer.getURI().equals(duri) || XSD.xint.getURI().equals(duri)) { + out = (int) Math.floor(Double.parseDouble(lex)); + } else if (XSD.xdouble.getURI().equals(duri)) { + out = (int) Math.floor(Double.parseDouble(lex)); + } else if (XSD.xlong.getURI().equals(duri)) { + out = (int) Math.floor(Double.parseDouble(lex)); + } else if (XSD.xfloat.getURI().equals(duri)) { + out = (int) Math.floor(Double.parseDouble(lex)); + } else if (XSD.xshort.getURI().equals(duri)) { + out = (int) Math.floor(Double.parseDouble(lex)); + } else { + throw new BurpException(new RmlError(String.format("Mode %s not supported in GREL's floor function.", s), origin, RER.FunctionExecutionError)); + } + } + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_number", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StartsWithFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#startsWith"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String f = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sub"); + boolean out = s != null && f != null && s.startsWith(f); + return List.of(new Return(out, Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out))); + } + } + + @AutoService(RMLFunction.class) + public static class StringGetFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_get"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + LiteralTerm from = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_from"); + LiteralTerm to = (LiteralTerm) parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_opt_to"); + String out = null; + if (s != null && from != null && from.intOrNull() != null) { + int f = from.intOrNull(); + if (to != null && to.intOrNull() != null) { + int t = to.intOrNull(); + if (t > 0) out = s.substring(f, t); + else out = s.substring(f, s.length() + t); + } else { + out = s.substring(f, f + 1); + } + } + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StringReplaceFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_replace"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String f = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_find"); + String r = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_replace"); + String out = null; + if (s != null && f != null) { + out = s.replaceAll(f, r != null ? r : ""); + } + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StringStripFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_strip"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String out = s != null ? s.trim() : null; + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StringSubstringFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_substring"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + String string = getValueString(parameters, valueParam); + if (string == null) { + throw new BurpException(new RmlError( + "Missing parameter " + valueParam + " in string_substring, received: " + parameters.get(valueParam), + origin, + RER.FunctionExecutionError + )); + } + + String pIntIFrom = "http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_from"; + LiteralTerm fromTerm = (LiteralTerm) parameters.get(pIntIFrom); + Integer from = fromTerm != null ? fromTerm.intOrNull() : null; + if (from == null) { + throw new BurpException(new RmlError("Missing or invalid parameter " + pIntIFrom + " in string_substring, received: " + parameters.get(pIntIFrom), origin, RER.FunctionExecutionError)); + } + + String pIntIOptTo = "http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_opt_to"; + LiteralTerm toTerm = (LiteralTerm) parameters.get(pIntIOptTo); + Integer to = toTerm != null ? toTerm.intOrNull() : null; + + String out = null; + try { + if (to != null) { + if (to > 0) out = string.substring(from, to); + else out = string.substring(from, string.length() + to); + } else { + out = string.substring(from); + } + } catch (StringIndexOutOfBoundsException e) { + Map parametersMap = new HashMap<>(); + parametersMap.put(ResourceFactory.createProperty(valueParam), string); + parametersMap.put(ResourceFactory.createProperty(pIntIFrom), from); + if (to != null) { + parametersMap.put(ResourceFactory.createProperty(pIntIOptTo), to); + } + Main.report.getErrors().add( + new RmlError( + "String index out of bounds [" + from + ", " + (to != null ? to : "null") + "] in string (length " + string.length() + ") " + string, + origin, + RER.FunctionExecutionError, + e, + parametersMap + ) + ); + } + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StringTrimFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_trim"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String out = s != null ? s.trim() : null; + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class ToLowerCaseFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#toLowerCase"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String out = s != null ? s.toLowerCase(Locale.getDefault()) : null; + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class ToUpperCaseFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + String string = getValueString(parameters, valueParam); + if (string == null) { + Main.report.getErrors().add( + new RmlError( + "Missing parameter " + valueParam + " in " + getName() + " function, received: " + parameters, + origin, + RER.FunctionExecutionError + ) + ); + } + String out = string != null ? string.toUpperCase(Locale.getDefault()) : null; + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class ToTitleCaseFunction implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#toTitleCase"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String out = s != null ? WordUtils.capitalizeFully(s.toLowerCase(Locale.getDefault())) : null; + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StringSha1Function implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_sha1"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + String string = getValueString(parameters, valueParam); + if (string == null) { + throw new BurpException(new RmlError("Missing parameter: " + valueParam, origin, RER.FunctionExecutionError)); + } + String out = hashWithAlgorithm(string, "SHA-1"); + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } + + @AutoService(RMLFunction.class) + public static class StringSha256Function implements RMLFunction { + @Override + public String getName() { + return "http://users.ugent.be/~bjdmeest/function/grel.ttl#string_sha256"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; + String string = getValueString(parameters, valueParam); + if (string == null) { + throw new BurpException(new RmlError("Missing parameter: " + valueParam, origin, RER.FunctionExecutionError)); + } + String out = hashWithAlgorithm(string, "SHA-256"); + return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); + } + } +} diff --git a/src/main/java/burp/model/fnml/IdlabFunctions.java b/src/main/java/burp/model/fnml/IdlabFunctions.java new file mode 100644 index 0000000..41d38cf --- /dev/null +++ b/src/main/java/burp/model/fnml/IdlabFunctions.java @@ -0,0 +1,207 @@ +package burp.model.fnml; + +import burp.model.rdf.LiteralTerm; +import burp.model.rdf.RdfSeqTerm; +import burp.reporting.Origin; +import com.google.auto.service.AutoService; + +import java.util.*; +import java.util.stream.Collectors; + +public class IdlabFunctions { + + public static String toValueString(Object obj) { + if (obj instanceof LiteralTerm literalTerm) { + return literalTerm.value(); + } + if (obj == null) { + return null; + } + return obj.toString(); + } + + private static Map createReturnMap(String key, Object value) { + Map map = new HashMap<>(); + map.put(key, value); + return map; + } + + @AutoService(RMLFunction.class) + public static class IdlabToUpperCaseURLFunction implements RMLFunction { + @Override + public String getName() { + return "https://w3id.org/imec/idlab/function#toUpperCaseURL"; + } + + @Override + public List apply(Map parameters, Origin origin) { + Object strParam = parameters.get("https://w3id.org/imec/idlab/function#str"); + String strVal = toValueString(strParam); + String strUpper = strVal != null ? strVal.toUpperCase(Locale.getDefault()) : null; + + String out; + if (strUpper == null || strUpper.startsWith("HTTP://")) { + out = strUpper; + } else { + out = "http://" + strUpper; + } + + Return r = new Return(out, createReturnMap("https://w3id.org/imec/idlab/function#_stringOut", out)); + return List.of(r); + } + } + + @AutoService(RMLFunction.class) + public static class IdlabRandomFunction implements RMLFunction { + @Override + public String getName() { + return "https://w3id.org/imec/idlab/function#random"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String out = UUID.randomUUID().toString(); + Return r = new Return(out, createReturnMap("https://w3id.org/imec/idlab/function#_stringOut", out)); + return List.of(r); + } + } + + @AutoService(RMLFunction.class) + public static class IdlabEqualFunction implements RMLFunction { + @Override + public String getName() { + return "https://w3id.org/imec/idlab/function#equal"; + } + + @Override + public List apply(Map parameters, Origin origin) { + var val1 = parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); + String val1Str = toValueString(val1); + var val2 = parameters.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam2"); + String val2Str = toValueString(val2); + boolean out = Objects.equals(val1Str, val2Str); + Return r = new Return(out, createReturnMap("https://w3id.org/imec/idlab/function#_boolOut", out)); + return List.of(r); + } + } + + @AutoService(RMLFunction.class) + public static class IdlabConcatFunction implements RMLFunction { + @Override + public String getName() { + return "https://w3id.org/imec/idlab/function#concat"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String str = toValueString(parameters.get("https://w3id.org/imec/idlab/function#str")); + String otherStr = toValueString(parameters.get("https://w3id.org/imec/idlab/function#otherStr")); + + Object delimObj = parameters.get("https://w3id.org/imec/idlab/function#delimiter"); + if (delimObj == null) { + delimObj = parameters.get("https://w3id.org/imec/idlab/function#separator"); + } + String delimiter = toValueString(delimObj); + if (delimiter == null) { + delimiter = ""; + } + + List list = new ArrayList<>(); + if (str != null) list.add(str); + if (otherStr != null) list.add(otherStr); + + String out = null; + if (!list.isEmpty()) { + out = String.join(delimiter, list); + } + + Return r = new Return(out, createReturnMap("https://w3id.org/imec/idlab/function#_stringOut", out)); + return List.of(r); + } + } + + @AutoService(RMLFunction.class) + public static class IdlabConcatSequenceFunction implements RMLFunction { + @Override + public String getName() { + return "https://w3id.org/imec/idlab/function#concatSequence"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String delimiter = toValueString(parameters.get("https://w3id.org/imec/idlab/function#_delimiter")); + if (delimiter == null) { + delimiter = ""; + } + + Object raw = parameters.get("https://w3id.org/imec/idlab/function#_seq"); + List seq; + if (raw instanceof RdfSeqTerm) { + seq = ((RdfSeqTerm) raw).getElements(); + } else if (raw instanceof Iterable) { + List list = new ArrayList<>(); + ((Iterable) raw).forEach(list::add); + seq = list; + } else if (raw instanceof Object[]) { + seq = Arrays.asList((Object[]) raw); + } else if (raw == null) { + seq = List.of(); + } else { + seq = List.of(raw); + } + + String out = seq.stream() + .map(IdlabFunctions::toValueString) + .filter(Objects::nonNull) + .collect(Collectors.joining(delimiter)); + + Return r = new Return(out, createReturnMap("https://w3id.org/imec/idlab/function#_stringOut", out)); + return List.of(r); + } + } + + @AutoService(RMLFunction.class) + public static class IdlabIfFunction implements RMLFunction { + @Override + public String getName() { + return "https://w3id.org/imec/idlab/function#IF"; + } + + @Override + public List apply(Map parameters, Origin origin) { + var condition = parameters.get("https://w3id.org/imec/idlab/function#boolParameter"); + var expr = parameters.get("https://w3id.org/imec/idlab/function#expressionParameter"); + + Boolean isTrue; + if (condition instanceof Boolean aBoolean) { + isTrue = aBoolean; + } else if (condition instanceof LiteralTerm literalTerm) { + isTrue = literalTerm.booleanOrNull(); + } else { + isTrue = condition != null && Boolean.parseBoolean(condition.toString()); + } + + if (Boolean.TRUE.equals(isTrue)) { + return List.of(new Return(expr)); + } else { + return List.of(); + } + } + } + + + // FIXME: This function is missing from the actual vocabulary but is required for the RML-FNML test case. + @AutoService(RMLFunction.class) + public static class AlwaysReturnsABCFunction implements RMLFunction { + @Override + public String getName() { + return "https://w3id.org/imec/idlab/function#alwaysReturnsABC"; + } + + @Override + public List apply(Map parameters, Origin origin) { + String out = "ABC"; + return List.of(new Return(out, createReturnMap("https://w3id.org/imec/idlab/function#_stringOut", out))); + } + } +} diff --git a/src/main/java/burp/model/fnml/MorphKgcFunctions.java b/src/main/java/burp/model/fnml/MorphKgcFunctions.java new file mode 100644 index 0000000..9e3087e --- /dev/null +++ b/src/main/java/burp/model/fnml/MorphKgcFunctions.java @@ -0,0 +1,22 @@ +package burp.model.fnml; + +import burp.reporting.Origin; +import com.google.auto.service.AutoService; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public class MorphKgcFunctions { + + @AutoService(RMLFunction.class) + public static class UUIDFunction implements RMLFunction { + + @Override + public String getName() { return "https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#uuid"; } + + @Override + public List apply(Map parameters, Origin origin) { + return List.of(new Return(UUID.randomUUID().toString())); + } + } +} diff --git a/src/main/java/burp/model/RMLFunction.java b/src/main/java/burp/model/fnml/RMLFunction.java similarity index 79% rename from src/main/java/burp/model/RMLFunction.java rename to src/main/java/burp/model/fnml/RMLFunction.java index cb1d453..2cd7c51 100644 --- a/src/main/java/burp/model/RMLFunction.java +++ b/src/main/java/burp/model/fnml/RMLFunction.java @@ -1,4 +1,4 @@ -package burp.model; +package burp.model.fnml; import burp.reporting.Origin; @@ -6,5 +6,6 @@ import java.util.Map; public interface RMLFunction { + String getName(); List apply(Map parameters, Origin origin); } diff --git a/src/main/java/burp/model/Return.java b/src/main/java/burp/model/fnml/Return.java similarity index 76% rename from src/main/java/burp/model/Return.java rename to src/main/java/burp/model/fnml/Return.java index 3d4f63d..0e23674 100644 --- a/src/main/java/burp/model/Return.java +++ b/src/main/java/burp/model/fnml/Return.java @@ -1,4 +1,4 @@ -package burp.model; +package burp.model.fnml; import java.util.HashMap; import java.util.Map; @@ -18,13 +18,16 @@ public Return(Object defaultValue) { public Return(Object defaultValue, Map additionalOutputs) { this.defaultValue = defaultValue; this.additionalOutputs = additionalOutputs; + if (additionalOutputs != null) { + this.returns.putAll(additionalOutputs); + } } public Object get(Object key) { - Object o = returns.get(key.toString()); - if(o == null) + if (!returns.containsKey(key.toString()) && !returns.isEmpty()) { throw new RuntimeException("Unknown return value %s.".formatted(key)); - return o; + } + return returns.get(key.toString()); } public Object put(String key, Object value) { diff --git a/src/main/java/burp/model/ReturnMap.java b/src/main/java/burp/model/fnml/ReturnMap.java similarity index 88% rename from src/main/java/burp/model/ReturnMap.java rename to src/main/java/burp/model/fnml/ReturnMap.java index d9b1819..c57ae74 100644 --- a/src/main/java/burp/model/ReturnMap.java +++ b/src/main/java/burp/model/fnml/ReturnMap.java @@ -1,5 +1,6 @@ -package burp.model; +package burp.model.fnml; +import burp.model.TermMap; import burp.vocabularies.RML; import org.apache.jena.rdf.model.Resource; import java.util.Set; diff --git a/src/main/java/burp/model/fnmlutil/BuiltInFunctions.java b/src/main/java/burp/model/fnmlutil/BuiltInFunctions.java deleted file mode 100644 index 47ec26c..0000000 --- a/src/main/java/burp/model/fnmlutil/BuiltInFunctions.java +++ /dev/null @@ -1,110 +0,0 @@ -package burp.model.fnmlutil; - -import burp.model.RMLFunction; -import burp.model.Return; -import burp.model.rdf.Term; -import burp.reporting.BurpException; -import burp.reporting.Origin; -import burp.reporting.RmlError; -import burp.util.Util; -import burp.vocabularies.RER; -import com.google.auto.service.AutoService; - -import java.net.URI; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -public class BuiltInFunctions { - - private static Term getRequiredParameter(Map parameters, String name, Origin origin) { - Object val = parameters.get(name); - if (val instanceof Term) return (Term) val; - throw new BurpException(new RmlError("Missing parameter: " + name, origin, RER.Error)); - } - - @AutoService(RMLFunction.class) - public static class HelloWorldFunction implements RMLFunction { - - @Override - public List apply(Map parameters, Origin origin) { - return List.of(new Return("Hello World!")); - } - } - - @AutoService(RMLFunction.class) - public static class SchemaFunction implements RMLFunction { - - @Override - public List apply(Map parameters, Origin origin) { - String s = parameters.get("http://example.com/functions/stringParameter").toString(); - String out = "https://schema.org/" + s; - return List.of(new Return(out, Map.of("http://example.com/functions/stringOutput", out))); - } - } - - @AutoService(RMLFunction.class) - public static class ParseURL implements RMLFunction { - - @Override - public List apply(Map parameters, Origin origin) { - try { - String s = parameters.get("http://example.com/functions/stringParameter").toString(); - URI uri = new URI(s); - - String protocol = uri.getScheme(); - String domain = uri.getHost(); - String path = uri.getPath(); - - Return r = new Return( - path, - Map.of( - "http://example.com/functions/stringOutput", path, - "http://example.com/functions/protocolOutput", protocol != null ? protocol : "", - "http://example.com/functions/domainOutput", domain != null ? domain : "" - ) - ); - return List.of(r); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - @AutoService(RMLFunction.class) - public static class UUIDFunction implements RMLFunction { - - @Override - public List apply(Map parameters, Origin origin) { - return List.of(new Return(UUID.randomUUID().toString())); - } - } - - @AutoService(RMLFunction.class) - public static class ToSafeIRIFunction implements RMLFunction { - - @Override - public List apply(Map parameters, Origin origin) { - String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; - Term term = getRequiredParameter(parameters, valueParam, origin); - String string = term.toString(); - String out = string != null ? Util.toIRISafe(string) : null; - - return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); - } - } - - @AutoService(RMLFunction.class) - public static class ToSafeURIFunction implements RMLFunction { - - @Override - public List apply(Map parameters, Origin origin) { - String valueParam = "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"; - Term term = getRequiredParameter(parameters, valueParam, origin); - String string = term.toString(); - String out = string != null ? Util.toURISafe(string) : null; - - return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); - } - } -} diff --git a/src/main/java/burp/model/fnmlutil/Functions.java b/src/main/java/burp/model/fnmlutil/Functions.java deleted file mode 100644 index 3bec3ab..0000000 --- a/src/main/java/burp/model/fnmlutil/Functions.java +++ /dev/null @@ -1,675 +0,0 @@ -package burp.model.fnmlutil; - -import burp.model.RMLFunction; -import burp.model.Return; -import burp.reporting.Origin; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.text.StringEscapeUtils; -import org.apache.commons.text.WordUtils; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.vocabulary.XSD; - -import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.*; - -public class Functions { - - public static Map functions = prepareFunctions(); - - static public List execute(String function, Map map) { - - RMLFunction f = functions.get(function); - if(f != null) - return f.apply(map, null); - - throw new RuntimeException(String.format("Function %s not yet supported.", function)); - } - - private static Map prepareFunctions() { - Map functions = new HashMap(); - - // Hello World Function - - functions.put("http://example.com/functions/helloworld", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - l.add(new Return("Hello World!")); - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function helloworld.", e); - } - } - }); - - // Schema Function - - functions.put("http://example.com/functions/schema", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://example.com/functions/stringParameter").toString(); - - String out = "https://schema.org/" + s; - - Return r = new Return(out); - r.put("http://example.com/functions/stringOutput", out); - l.add(r); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function schema.", e); - } - } - }); - - // parseURL Function - - functions.put("http://example.com/functions/parseURL", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - String s = map.get("http://example.com/functions/stringParameter").toString(); - - try { - List l = new ArrayList(); - URL url = new URL(s); - - String protocol = url.getProtocol(); - String domain = url.getHost(); - String path = url.getPath(); - - Return r = new Return(path); - r.put("http://example.com/functions/stringOutput", path); - r.put("http://example.com/functions/protocolOutput", protocol); - r.put("http://example.com/functions/domainOutput", domain); - l.add(r); - - return l; - } catch(Exception e) { - throw new RuntimeException("Invalid URL given as input" + s, e); - } - } - }); - - // UUID Function - - functions.put("https://github.com/morph-kgc/morph-kgc/function/built-in.ttl#uuid", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try{ - List l = new ArrayList(); - l.add(new Return(UUID.randomUUID().toString())); - return l; - } catch(Exception e) { - throw new RuntimeException("Problem calling function UUID.", e); - } - } - }); - - // GREL functions - // https://openrefine.org/docs/manual/grelfunctions - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_and", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); - Literal b = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_b"); - - Boolean out = a.getBoolean() && b.getBoolean(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function boolean_and.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_not", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool"); - - Boolean out = !a.getBoolean(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function boolean_not.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_or", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); - Literal b = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_b"); - - Boolean out = a.getBoolean() || b.getBoolean(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function boolean_or.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_xor", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - Literal a = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_a"); - Literal b = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_bool_b"); - - Boolean out = a.getBoolean() ^ b.getBoolean(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function boolean_xor.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_chomp", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - String f = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sep").toString(); - - String out = StringUtils.removeEnd(s, f); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_chomp.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_contains", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - String f = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sub").toString(); - - boolean out = s.contains(f); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_contains.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_contains_pattern", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - String p = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_regex").toString(); - - boolean out = s.matches(p); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_contains_pattern.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#endsWith", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - String f = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sub").toString(); - - boolean out = s.endsWith(f); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function endsWith.", e); - } - } - }); - - // Escapes s in the given escaping mode. The mode can be one of: "html", "xml", "csv", "url", "javascript". - // Note that quotes are required around your mode. See the recipes for examples of escaping and unescaping. - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#escape", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - String p = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#modeParam").toString(); - - String out = null; - if("html".equals(p.toLowerCase())) - out = StringEscapeUtils.escapeHtml4(s); - else if("xml".equals(p.toLowerCase())) - out = StringEscapeUtils.escapeXml11(s); - else if("csv".equals(p.toLowerCase())) - out = StringEscapeUtils.escapeCsv(s); - else if("javascript".equals(p.toLowerCase())) - out = StringEscapeUtils.escapeEcmaScript(s); - else if("url".equals(p.toLowerCase())) - out = URLEncoder.encode(s, StandardCharsets.UTF_8); - else - throw new RuntimeException(String.format("Mode %s not supported in GREL's escape function.", p)); - - Return r = new Return(out); - r.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(r); - - return l; - } catch (RuntimeException e) { - throw new RuntimeException("Problem calling function escape.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#length", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - - int out = s.length(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_number", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function length.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#math_abs", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - Literal s = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); - - Object out = null; - String duri = s.getDatatypeURI(); - - if(XSD.integer.getURI().equals(duri) || XSD.xint.getURI().equals(duri)) { - out = Math.abs(Integer.parseInt(s.getLexicalForm())); - } else if(XSD.xdouble.getURI().equals(duri)) { - out = Math.abs(Double.parseDouble(s.getLexicalForm())); - } else if(XSD.xlong.getURI().equals(duri)) { - out = Math.abs(Long.parseLong(s.getLexicalForm())); - } else if(XSD.xfloat.getURI().equals(duri)) { - out = Math.abs(Float.parseFloat(s.getLexicalForm())); - } else if(XSD.xshort.getURI().equals(duri)) { - out = Math.abs(Short.parseShort(s.getLexicalForm())); - } else { - throw new RuntimeException(String.format("Mode %s not supported in GREL's abs function.", s)); - } - - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_decimal", out); - l.add(re); - - return l; - } catch (RuntimeException e) { - throw new RuntimeException("Problem calling function math_abs.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#math_ceil", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - Literal s = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); - - Object out = null; - String duri = s.getDatatypeURI(); - - if(XSD.integer.getURI().equals(duri) || XSD.xint.getURI().equals(duri)) { - out = (int) Math.ceil(Integer.parseInt(s.getLexicalForm())); - } else if(XSD.xdouble.getURI().equals(duri)) { - out = (int) Math.ceil(Double.parseDouble(s.getLexicalForm())); - } else if(XSD.xlong.getURI().equals(duri)) { - out = (int) Math.ceil(Long.parseLong(s.getLexicalForm())); - } else if(XSD.xfloat.getURI().equals(duri)) { - out = (int) Math.ceil(Float.parseFloat(s.getLexicalForm())); - } else if(XSD.xshort.getURI().equals(duri)) { - out = (int) Math.ceil(Short.parseShort(s.getLexicalForm())); - } else { - throw new RuntimeException(String.format("Mode %s not supported in GREL's ceil function.", s)); - } - - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_number", out); - l.add(re); - - return l; - } catch (RuntimeException e) { - throw new RuntimeException("Problem calling function math_ceil.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#math_floor", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - Literal s = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_dec_n"); - - Object out = null; - String duri = s.getDatatypeURI(); - - if(XSD.integer.getURI().equals(duri) || XSD.xint.getURI().equals(duri)) { - out = (int) Math.floor(Integer.parseInt(s.getLexicalForm())); - } else if(XSD.xdouble.getURI().equals(duri)) { - out = (int) Math.floor(Double.parseDouble(s.getLexicalForm())); - } else if(XSD.xlong.getURI().equals(duri)) { - out = (int) Math.floor(Long.parseLong(s.getLexicalForm())); - } else if(XSD.xfloat.getURI().equals(duri)) { - out = (int) Math.floor(Float.parseFloat(s.getLexicalForm())); - } else if(XSD.xshort.getURI().equals(duri)) { - out = (int) Math.floor(Short.parseShort(s.getLexicalForm())); - } else { - throw new RuntimeException(String.format("Mode %s not supported in GREL's floor function.", s)); - } - - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_number", out); - l.add(re); - - return l; - } catch (RuntimeException e) { - throw new RuntimeException("Problem calling function math_floor.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#startsWith", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - String f = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sub").toString(); - - boolean out = s.startsWith(f); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#output_bool", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function starts_with.", e); - } - } - }); - - // https://openrefine.org/docs/manual/grelfunctions#gets-n-from-n-to-optional - // Similar to substring() when used in relation to strings, but when using get in the case - // that the second argument n to is omitted a single character will be returned. - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_get", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - Literal from = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_from"); - Literal to = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_opt_to"); - - String out = null; - int f = from.getInt(); - if(to != null) { - int t = to.getInt(); - if(t > 0) - out = s.substring(f, t); - else - // A negative character index counts from the end of the string. - out = s.substring(f, s.length() + t); - } - else - out = s.substring(f, f + 1); - - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_get.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_replace", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - String f = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_find").toString(); - String r = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#param_replace").toString(); - - String out = s.replaceAll(f, r); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_replace.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_strip", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - - String out = s.trim(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_strip.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_substring", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - Literal from = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_from"); - Literal to = (Literal) map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#p_int_i_opt_to"); - - String out = null; - int f = from.getInt(); - if(to != null) { - int t = to.getInt(); - if(t > 0) - out = s.substring(f, t); - else - // A negative character index counts from the end of the string. - out = s.substring(f, s.length() + t); - } - else - out = s.substring(f); - - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_substring.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#string_trim", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - - String out = s.trim(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function string_trim.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#toLowerCase", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - - String out = s.toLowerCase(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function toLowerCase.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - - String out = s.toUpperCase(); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function toUpperCase.", e); - } - } - }); - - functions.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#toTitleCase", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - - String s = map.get("http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam").toString(); - - // GREL transforms FOO into Foo - String out = WordUtils.capitalize(s.toLowerCase()); - Return re = new Return(out); - re.put("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function toTitleCase.", e); - } - } - }); - - - // ID-Lab functions - - functions.put("http://example.com/idlab/function/toUpperCaseURL", new RMLFunction() { - @Override - public List apply(Map map, Origin origin) { - try { - List l = new ArrayList(); - String str = map.get("http://example.com/idlab/function/str").toString().toUpperCase(); - - String out = null; - if(str.startsWith("HTTP://")) - out = str; - else - out = "http://" + str; - - Return re = new Return(out); - l.add(re); - - return l; - } catch (Exception e) { - throw new RuntimeException("Problem calling function toUpperCaseURL.", e); - } - } - }); - - System.out.println("The following functions were loaded:"); - functions.keySet().forEach(s -> System.out.println("- %s".formatted(s))); - - return functions; - } - -} diff --git a/src/main/java/burp/model/gathermaputil/GatherMapMixin.java b/src/main/java/burp/model/gathermaputil/GatherMapMixin.java deleted file mode 100644 index 2c9cc3b..0000000 --- a/src/main/java/burp/model/gathermaputil/GatherMapMixin.java +++ /dev/null @@ -1,152 +0,0 @@ -package burp.model.gathermaputil; - -import burp.model.GatherMap; -import burp.model.Iteration; -import burp.vocabularies.RML; -import com.google.common.collect.Lists; -import org.apache.jena.rdf.model.*; -import org.apache.jena.vocabulary.RDF; - -import java.util.ArrayList; -import java.util.List; - -public class GatherMapMixin { - - public boolean allowEmptyListAndContainer = false; - public Resource gatherAs = null; - public Resource strategy = RML.append; - public List gatherMaps = new ArrayList(); - - public List generateGraphs(Iteration i, String baseIRI) { - if (RML.append.equals(strategy)) { - return append(i, baseIRI); - } else if (RML.cartesianProduct.equals(strategy)) { - return cartesianProduct(i, baseIRI); - } - throw new RuntimeException("Unknown strategy."); - } - - private List cartesianProduct(Iteration i, String baseIRI) { - List graphs = new ArrayList(); - - List> superlist = new ArrayList>(); - for (GatherMap tm : gatherMaps) { - List list = new ArrayList(); - - if (tm.isGatherMap()) { - for (SubGraph g : tm.generateGatherMapGraphs(i, baseIRI)) { - list.add(g); - } - } else { - for (RDFNode generated : tm.generateTerms(i, baseIRI)) { - SubGraph sg = new SubGraph(); - sg.node = generated; - list.add(sg); - } - } - superlist.add(list); - } - - List> sets = Lists.cartesianProduct(superlist); - for (List list : sets) { - Model m = ModelFactory.createDefaultModel(); - RDFNode n = m.createResource(); - if (gatherAs.equals(RDF.List)) - createList(m, n, list); - else - createContainer(m, n, list); - - if (!m.isEmpty()) { - SubGraph g = new SubGraph(n, m); - graphs.add(g); - } - } - - return graphs; - } - - private List append(Iteration i, String baseIRI) { - List graphs = new ArrayList(); - Model m = ModelFactory.createDefaultModel(); - - // Let's create a node for the list / bag - // It may be overwritten if specific names / blank nodes - // have to be provided in the term map - RDFNode n = m.createResource(); - - List list = new ArrayList(); - for (GatherMap tm : gatherMaps) { - if (tm.isGatherMap()) { - for (SubGraph g : tm.generateGatherMapGraphs(i, baseIRI)) { - list.add(g); - } - } else { - for (RDFNode generated : tm.generateTerms(i, baseIRI)) { - SubGraph sg = new SubGraph(); - sg.node = generated; - list.add(sg); - } - } - } - - if (gatherAs.equals(RDF.List)) - createList(m, n, list); - else - createContainer(m, n, list); - - if (!m.isEmpty()) { - SubGraph g = new SubGraph(n, m); - graphs.add(g); - } - - return graphs; - } - - private void createList(Model m, RDFNode n, List list) { - if (list.size() > 0 || allowEmptyListAndContainer) { - m.add(n.asResource(), RDF.type, RML.list); - - for (SubGraph sg : list) { - // Adding the element to the container - try { - RDFList l = m.getList(n.asResource()); - l.add(sg.node); - } catch (Exception e) { - m.add(n.asResource(), RDF.rest, RDF.nil); - m.add(n.asResource(), RDF.first, sg.node); - } - - // Adding any triples around it into the model - if (sg.model != null) - m.add(sg.model); - } - } - } - - private void createContainer(Model m, RDFNode n, List list) { - if (list.size() > 0 || allowEmptyListAndContainer) { - Container c = null; - if (gatherAs.equals(RDF.Alt)) { - m.add(n.asResource(), RDF.type, RDF.Alt); - c = m.getAlt(n.asResource()); - } else if (gatherAs.equals(RDF.Bag)) { - m.add(n.asResource(), RDF.type, RDF.Bag); - c = m.getBag(n.asResource()); - - } else if (gatherAs.equals(RDF.Seq)) { - m.add(n.asResource(), RDF.type, RDF.Seq); - c = m.getSeq(n.asResource()); - } - - for (SubGraph sg : list) { - // Adding the element to the container - c.add(sg.node); - - // Adding any triples around it into the model - if (sg.model != null) - m.add(sg.model); - } - } - } - -} diff --git a/src/main/java/burp/model/gathermaputil/SubGraph.java b/src/main/java/burp/model/gathermaputil/SubGraph.java deleted file mode 100644 index cf0d14b..0000000 --- a/src/main/java/burp/model/gathermaputil/SubGraph.java +++ /dev/null @@ -1,50 +0,0 @@ -package burp.model.gathermaputil; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.apache.jena.rdf.model.impl.StatementImpl; -import org.apache.jena.vocabulary.RDF; - -public class SubGraph { - - public RDFNode node; - public Model model; - - public SubGraph(RDFNode n, Model m) { - this.node = n; - this.model = m; - } - - public SubGraph() {} - - public void updateNode(RDFNode n) { - StmtIterator iter = model.listStatements(); - List news = new ArrayList(); - List olds = new ArrayList(); - while(iter.hasNext()) { - Statement s = iter.next(); - if(s.getSubject().equals(node)) { - olds.add(s); - news.add(new StatementImpl(n.asResource(), s.getPredicate(), s.getObject())); - } - } - model.add(news); - model.remove(olds); - - node = n; - } - - public boolean isList() { return !isBag() && !isSeq() && !isAlt(); } - public boolean isAlt() { return model.contains(node.asResource(), RDF.type, RDF.Alt); } - public boolean isBag() { return model.contains(node.asResource(), RDF.type, RDF.Bag); } - public boolean isSeq() { return model.contains(node.asResource(), RDF.type, RDF.Seq); } - - public String toString() { - return node == null ? null : node.toString(); - } -} diff --git a/src/main/java/burp/model/rdf/Datardf.java b/src/main/java/burp/model/rdf/Datardf.java index 742f771..eab0f81 100644 --- a/src/main/java/burp/model/rdf/Datardf.java +++ b/src/main/java/burp/model/rdf/Datardf.java @@ -1,7 +1,10 @@ package burp.model.rdf; +import org.apache.jena.rdf.model.Literal; +import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; import org.apache.jena.vocabulary.RDF; +import org.jetbrains.annotations.Nullable; import java.math.BigDecimal; import java.sql.Date; @@ -13,7 +16,8 @@ public final class Datardf { - private Datardf() {} + private Datardf() { + } public static IRITerm iriTerm(Resource resource) { return new IRITerm(resource.getURI()); @@ -60,10 +64,61 @@ public static boolean semanticEquals(Object a, Object b) { static final IRITerm XSDdateTime = new IRITerm("http://www.w3.org/2001/XMLSchema#dateTime"); static final IRITerm XSDstring = new IRITerm("http://www.w3.org/2001/XMLSchema#string"); - public static Term toTerm(Object o) { + public static Term toTerm(@Nullable Object o) { + return toTerm(o, null); + } + + public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { if (o instanceof Term t) return t; if (o == null) return null; + boolean isXsdDouble = datatype != null && XSDdouble.uri().equals(datatype.uri()); + if (o instanceof RDFNode node) { + if (node.isLiteral()) { + Literal l = node.asLiteral(); + String lex = l.getLexicalForm(); + String lang = l.getLanguage(); + String dtUri = l.getDatatypeURI(); + if (XSDdouble.uri().equals(dtUri) || isXsdDouble) { + try { + double val = l.getDouble(); + return new LiteralTerm(doubleCanonicalMap(val), XSDdouble, null); + } catch (Exception e) { + // fallback + } + } + + IRITerm finalDt = dtUri != null && !dtUri.equals("http://www.w3.org/2001/XMLSchema#string") + ? new IRITerm(dtUri) + : (datatype); + + if (lang != null && !lang.isEmpty()) { + return new LiteralTerm(lex, null, lang); + } else { + return new LiteralTerm(lex, finalDt, null); + } + } else if (node.isURIResource()) { + return new IRITerm(node.asResource().getURI()); + } else if (node.isAnon()) { + return new BlankNodeTerm(node.asResource().getId().getLabelString()); + } + } + + if (datatype != null) { + if (isXsdDouble) { + if (o instanceof Number n) { + return new LiteralTerm(doubleCanonicalMap(n.doubleValue()), XSDdouble, null); + } + try { + double val = Double.parseDouble(o.toString()); + return new LiteralTerm(doubleCanonicalMap(val), XSDdouble, null); + } catch (NumberFormatException e) { + // fallback + } + } + return new LiteralTerm(o.toString(), datatype, null); + } + if (o instanceof Integer || o instanceof Long) { return new LiteralTerm(o.toString(), XSDinteger, null); } else if (o instanceof Float f) { diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index 4f2a882..5e0b1bf 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -3,6 +3,8 @@ import burp.Main; import burp.ls.LogicalSourceFactory; import burp.model.*; +import burp.model.fnml.FunctionExecution; +import burp.model.fnml.ReturnMap; import burp.model.gathermap.GatherMap; import burp.model.lv.JoinType; import burp.model.lv.LogicalView; @@ -200,7 +202,7 @@ private void normalizeConstantsUpdate(Model mapping) { rml:parameter idlab-fn:boolParameter ; rml:inputValueMap ?condition ] , [ - rml:parameter idlab-fn:parameter ; + rml:parameter idlab-fn:expressionParameter ; rml:inputValueMap [ ?prop ?value ] diff --git a/src/test/java/burp/NQuadsWriterTest.java b/src/test/java/burp/NQuadsWriterTest.java index 8fcead6..4b97f20 100644 --- a/src/test/java/burp/NQuadsWriterTest.java +++ b/src/test/java/burp/NQuadsWriterTest.java @@ -20,18 +20,18 @@ public class NQuadsWriterTest { @Test public void writesUnsafeIriAndEscapedLiterals() { List statements = List.of( - new RdfStatement( - new IRITerm("http://example.org/unsafe subject", Set.of()), - new IRITerm("http://example.org/p", Set.of()), - new IRITerm("http://example.org/unsafe object", Set.of()), - new IRITerm("http://example.org/unsafe graph", Set.of()) - ), - new RdfStatement( - new BlankNodeTerm("node-1", Set.of()), - new IRITerm("http://example.org/label", Set.of()), - new LiteralTerm("line1\n\"quoted\"\\slash", null, "en", Set.of()), - new IRITerm(RML.defaultGraph.getURI(), Set.of()) - ) + new RdfStatement( + new IRITerm("http://example.org/unsafe subject", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new IRITerm("http://example.org/unsafe object", Set.of()), + new IRITerm("http://example.org/unsafe graph", Set.of()) + ), + new RdfStatement( + new BlankNodeTerm("node-1", Set.of()), + new IRITerm("http://example.org/label", Set.of()), + new LiteralTerm("line1\n\"quoted\"\\slash", null, "en", Set.of()), + new IRITerm(RML.defaultGraph.getURI(), Set.of()) + ) ); ByteArrayOutputStream output = new ByteArrayOutputStream(); @@ -39,7 +39,7 @@ public void writesUnsafeIriAndEscapedLiterals() { String serialized = output.toString(StandardCharsets.UTF_8); String expected = " .\n" + - "_:node-1 \"line1\\n\\\"quoted\\\"\\\\slash\"@en .\n"; + "_:node-1 \"line1\\n\\\"quoted\\\"\\\\slash\"@en .\n"; assertEquals(expected, serialized); } @@ -47,81 +47,97 @@ public void writesUnsafeIriAndEscapedLiterals() { @Test public void omitsDefaultGraphFromQuadLine() { RdfStatement statement = new RdfStatement( - new IRITerm("http://example.org/s", Set.of()), - new IRITerm("http://example.org/p", Set.of()), - new LiteralTerm("value", new IRITerm("http://example.org/type", Set.of()), null, Set.of()), - new IRITerm(RML.defaultGraph.getURI(), Set.of()) + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", new IRITerm("http://example.org/type", Set.of()), null, Set.of()), + new IRITerm(RML.defaultGraph.getURI(), Set.of()) ); String serialized = NQuadsWriter.serializeStatement(statement); assertEquals( - " \"value\"^^ .", - serialized + " \"value\"^^ .", + serialized ); } @Test public void writeDatatypes() { RdfStatement statement = new RdfStatement( - new IRITerm("http://example.org/s", Set.of()), - new IRITerm("http://example.org/p", Set.of()), - new LiteralTerm("100", new IRITerm("http://www.w3.org/2001/XMLSchema#double", Set.of()), null, Set.of()) + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("100", new IRITerm("http://www.w3.org/2001/XMLSchema#double", Set.of()), null, Set.of()) ); String serialized = NQuadsWriter.serializeStatement(statement); assertEquals( - " \"100\"^^ .", - serialized + " \"100\"^^ .", + serialized + ); + } + + @Test + public void writeDouble() { + RdfStatement statement = new RdfStatement( + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("3.6E1", new IRITerm("http://www.w3.org/2001/XMLSchema#double", Set.of()), null, Set.of()) + ); + + String serialized = NQuadsWriter.serializeStatement(statement); + + assertEquals( + " \"3.6E1\"^^ .", + serialized ); } @Test public void writeLanguageTag() { RdfStatement statement = new RdfStatement( - new IRITerm("http://example.org/s", Set.of()), - new IRITerm("http://example.org/p", Set.of()), - new LiteralTerm("value", null, "en-GB", Set.of()) + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", null, "en-GB", Set.of()) ); String serialized = NQuadsWriter.serializeStatement(statement); assertEquals( - " \"value\"@en-GB .", - serialized + " \"value\"@en-GB .", + serialized ); } @Test public void omitsExplicitXsdStringDatatypeInLiteralSerialization() { RdfStatement statement = new RdfStatement( - new IRITerm("http://example.org/s", Set.of()), - new IRITerm("http://example.org/p", Set.of()), - new LiteralTerm("value", new IRITerm("http://www.w3.org/2001/XMLSchema#string", Set.of()), null, Set.of()) + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", new IRITerm("http://www.w3.org/2001/XMLSchema#string", Set.of()), null, Set.of()) ); String serialized = NQuadsWriter.serializeStatement(statement); assertEquals( - " \"value\" .", - serialized + " \"value\" .", + serialized ); } @Test public void keepsPlainLiteralSerializationUnchanged() { RdfStatement statement = new RdfStatement( - new IRITerm("http://example.org/s", Set.of()), - new IRITerm("http://example.org/p", Set.of()), - new LiteralTerm("value", null, null, Set.of()) + new IRITerm("http://example.org/s", Set.of()), + new IRITerm("http://example.org/p", Set.of()), + new LiteralTerm("value", null, null, Set.of()) ); String serialized = NQuadsWriter.serializeStatement(statement); assertEquals( - " \"value\" .", - serialized + " \"value\" .", + serialized ); } } diff --git a/src/test/java/burp/TestRMLIO.java b/src/test/java/burp/TestRMLIO.java index c8a20b5..8ab74a4 100644 --- a/src/test/java/burp/TestRMLIO.java +++ b/src/test/java/burp/TestRMLIO.java @@ -1,5 +1,8 @@ package burp; +import java.util.HashSet; +import java.util.List; + public class TestRMLIO extends TestRMLModule { @Override public String getBase() { @@ -7,19 +10,30 @@ public String getBase() { } private boolean isIgnored(String id) { - return id.startsWith("RMLSTC0011") || - id.equals("RMLSTC0006a") || - id.equals("RMLSTC0009a") || - id.equals("RMLTTC0004a") || - id.equals("RMLTTC0004c") || - id.equals("RMLTTC0004e") || - id.equals("RMLTTC0004f") || - id.equals("RMLTTC0004g") || - id.equals("RMLTTC0005b") || - id.equals("RMLTTC0006b") || - id.equals("RMLTTC0006c") || - id.equals("RMLTTC0006d") || - id.equals("RMLTTC0006e"); + var buggyTests = List.of( + // https://github.com/kg-construct/rml-io/issues/167 + "RMLSTC0011a", + "RMLSTC0011b", + "RMLSTC0011c", + "RMLSTC0011d", + "RMLSTC0011e", + // https://github.com/kg-construct/rml-io/issues/147 + "RMLSTC0006a", + // https://github.com/kg-construct/rml-io/issues/150 + "RMLSTC0009a", + // https://github.com/kg-construct/rml-io/issues/151 + "RMLTTC0004a", + "RMLTTC0004c", + "RMLTTC0004e", + "RMLTTC0004f", + "RMLTTC0004g", + "RMLTTC0005b", + "RMLTTC0006b", + "RMLTTC0006c", + "RMLTTC0006d", + "RMLTTC0006e" + ); + return (new HashSet<>(buggyTests)).contains(id); } @Override From fc3563bb6ee7f5318eb7cc72d8e964abaf096257 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 11 Jun 2026 11:06:06 +0200 Subject: [PATCH 07/45] backport fnml and io and rer --- README.md | 2 +- pom.xml | 354 ++++++++++++++++-- src/main/java/burp/Main.java | 6 +- src/main/java/burp/ls/RDBSource.java | 10 +- src/main/java/burp/ls/SPARQLFileSource.java | 36 +- .../java/burp/ls/SPARQLServiceSource.java | 3 +- src/main/java/burp/model/ExpressionMap.java | 44 +-- src/main/java/burp/model/LogicalTarget.java | 18 +- .../java/burp/model/LogicalTargetScope.java | 3 +- src/main/java/burp/model/MappingDocument.java | 75 ++-- .../java/burp/model/PredicateObjectMap.java | 17 +- src/main/java/burp/model/RawReference.java | 2 - src/main/java/burp/model/TriplesMap.java | 32 +- .../java/burp/model/fnml/GrelFunctions.java | 4 +- src/main/java/burp/model/lv/LogicalView.java | 7 +- src/main/java/burp/parse/Parse.java | 110 ++---- .../java/burp/parse/turtleprov/Point.java | 3 +- .../burp/parse/turtleprov/ProvTriple.java | 3 +- .../parse/turtleprov/ProvTurtleVisitor.java | 48 ++- .../parse/turtleprov/TurtleProvParser.java | 3 - .../java/burp/reporting/FileGeometry.java | 81 ++++ .../java/burp/reporting/FileHighlight.java | 123 ++++++ .../reporting/PlainTextReportGenerator.java | 142 +++++++ .../burp/util/SimpleNamespaceContext.java | 5 +- src/test/java/burp/FileGeometryTest.java | 176 +++++++++ src/test/java/burp/FileHighlightTest.java | 125 +++++++ src/test/java/burp/TestRMLIORegistry.java | 43 +-- src/test/java/burp/TestRMLModule.java | 2 +- 28 files changed, 1216 insertions(+), 261 deletions(-) create mode 100644 src/main/java/burp/reporting/FileGeometry.java create mode 100644 src/main/java/burp/reporting/FileHighlight.java create mode 100644 src/main/java/burp/reporting/PlainTextReportGenerator.java create mode 100644 src/test/java/burp/FileGeometryTest.java create mode 100644 src/test/java/burp/FileHighlightTest.java diff --git a/README.md b/README.md index 2c01c04..7cf7a97 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Some libraries are available on GitHub's maven repository. Add a GitHub authenti ## Using BURP -You can run BURP instantly without installing Java manually or downloading any files using [JBang](https://jbang.dev): +You can run BURP using [JBang](https://jbang.dev): ```bash $ jbang burp@jduchateau [-h] [-b=] -m= [-o=] diff --git a/pom.xml b/pom.xml index d748cbb..4e24674 100644 --- a/pom.xml +++ b/pom.xml @@ -2,15 +2,53 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + io.github.kg-construct BURP - 0.1.2 + 0.1.7 + Basic and Unassuming RML Processor + A Basic and Unassuming RML Processor (BURP) with RML Execution Report (RER) error handling + + https://github.com/kg-construct/BURP/ + 2024 + + + + MIT + https://opensource.org/license/mit/ + repo + + + + + + Christophe Debruyne + https://ChristopheDebruyne.be + University of Liège + https://www.uliege.be + + + Jakub Duchateau + https://jduchateau.github.io + University of Liège + https://www.uliege.be + + + + + https://github.com/kg-construct/BURP/ + scm:git:git://github.com/kg-construct/BURP.git + scm:git:ssh://git@github.com/kg-construct/BURP.git + - 17 - 17 + 21 + 21 UTF-8 + 5.6.0 + 4.13.1 + ${env.CI_PROJECT_ID} @@ -34,12 +72,144 @@ maven-compiler-plugin - 3.8.1 + 3.11.0 - 17 + 21 + + + com.google.auto.service + auto-service + 1.1.1 + + + + + org.antlr + antlr4-maven-plugin + ${antlr.version} + + + generate-sources + antlr + + antlr4 + + + + + true + false + + -package + burp.parse.turtleprov + + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + + generate-ptr + generate-sources + + java + + + jena.schemagen + + -i + ${project.basedir}/src/main/resources/vocabularies/ptr.ttl + -e + TURTLE + -o + ${project.build.directory}/generated-sources/vocabularies + --package + burp.vocabularies + -n + PTR + --ontology + --rdfs + --inference + -a + https://w3id.org/dre/ptr# + + true + + + + generate-rer + generate-sources + + java + + + jena.schemagen + + -i + ${project.basedir}/src/main/resources/vocabularies/rer.ttl + -e + TURTLE + -o + ${project.build.directory}/generated-sources/vocabularies + --package + burp.vocabularies + -n + RER + --ontology + --rdfs + --inference + --import + ${project.basedir}/src/main/resources/vocabularies/ptr.ttl + -a + https://w3id.org/dre/rer# + --declarations + static { + M_MODEL.read(RER.class.getClassLoader().getResourceAsStream("vocabularies/rer.ttl"), + RER.NS, "TURTLE"); } + + + true + + + + + + org.apache.jena + jena-cmds + ${jena.version} + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/generated-sources/vocabularies + ${project.build.directory}/generated-sources/antlr4 + + + + + + org.apache.maven.plugins maven-surefire-plugin @@ -89,6 +259,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 21 + 21 + + @@ -111,15 +289,15 @@ true + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> burp.Main + implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/> + implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"> false @@ -138,6 +316,120 @@ + + + + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 + true + + central + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.3 + + + attach-javadocs + + jar + + + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.12.0 + + + + A Basic and Unassuming RML Processor (BURP) with RML Execution Report + (RER) + error handling + + Jakub Duchateau, Christophe Debruyne + MIT + + https://github.com/kg-construct/BURP + + 2026 Jakub Duchateau, 2024 Christophe Debruyne + + + + kg-construct + BURP + github.com + true + true + true + + true + ALWAYS + conventional-commits + + + true + + + + + + ALWAYS + SINGLE_JAR + + 21 + burp.Main + + + burp + + + + ${project.build.directory}/burp.jar + + + + + + + ALWAYS + + ALWAYS + jduchateau + jbang-catalog + + + jduchateau + jduchateau@users.noreply.github.com + + + + + + @@ -190,10 +482,10 @@ kotlinx-serialization-json-jvm 1.6.3 - - com.mysql - mysql-connector-j - 9.3.0 + + com.mysql + mysql-connector-j + 9.3.0 org.postgresql @@ -237,33 +529,33 @@ test - org.junit.jupiter - junit-jupiter-params - 5.10.2 - test - - + org.junit.jupiter + junit-jupiter-params + 5.10.2 + test + + + org.testcontainers + testcontainers-junit-jupiter + 2.0.3 + test + + org.testcontainers - testcontainers-junit-jupiter - 2.0.3 + testcontainers-postgresql + 2.0.3 test org.testcontainers - testcontainers-postgresql - 2.0.3 - test - - - org.testcontainers - testcontainers-mysql - 2.0.3 + testcontainers-mysql + 2.0.3 test org.testcontainers - testcontainers-mssqlserver - 2.0.3 + testcontainers-mssqlserver + 2.0.3 test diff --git a/src/main/java/burp/Main.java b/src/main/java/burp/Main.java index dc52c0d..da96ddc 100644 --- a/src/main/java/burp/Main.java +++ b/src/main/java/burp/Main.java @@ -176,9 +176,7 @@ public static int doMain( final Lang finalLang = targetLang; final Charset finalEncoding = targetEncoding; - Util.writeCompressedFile(resolvedPath, target.getCompression(), output -> { - writeStatements(output, stmts, finalLang, finalEncoding); - }); + Util.writeCompressedFile(resolvedPath, target.getCompression(), output -> writeStatements(output, stmts, finalLang, finalEncoding)); } } } catch (BurpException e) { @@ -186,7 +184,7 @@ public static int doMain( } catch (Exception e) { report.getErrors().add(Errors.UnexpectedError(e)); } finally { - System.out.println(report.toString()); + System.out.print(PlainTextReportGenerator.generateTextReport(report)); if (reportFilePath != null && !reportFilePath.isBlank()) { RdfReportGenerator.generateRdfReport(report, reportFilePath); } diff --git a/src/main/java/burp/ls/RDBSource.java b/src/main/java/burp/ls/RDBSource.java index 88f4950..dbf9c2e 100644 --- a/src/main/java/burp/ls/RDBSource.java +++ b/src/main/java/burp/ls/RDBSource.java @@ -43,7 +43,7 @@ public Iterable iterator() { Class.forName(jdbcDriver); } catch (ClassNotFoundException e) { throw new BurpException( - new RmlError("Problem querying database.", null, RER.Error, e) + new RmlError("Problem querying database.", null, RER.Error, e) ); } } @@ -82,7 +82,7 @@ public boolean hasNext() { return goNext; } catch (SQLException e) { throw new BurpException( - new RmlError("Problem querying database while iterating over rows.", null, RER.Error, e) + new RmlError("Problem querying database while iterating over rows.", null, RER.LogicalSourceError, e) ); } } @@ -92,8 +92,10 @@ public Iteration next() { return new RDBIteration(resultset, indexMap, getNulls()); } }; + } catch (SQLSyntaxErrorException e) { + throw new BurpException(new RmlError("Syntax error in SQL " + query, null, RER.ReferenceFormulationSyntaxError, e)); } catch (Throwable e) { - throw new RuntimeException(e); + throw new BurpException(new RmlError("Error in RDB source.", null, RER.LogicalSourceError)); } } @@ -118,7 +120,7 @@ public List getValues(Iteration i) { if (!rdbIteration.values.containsKey(columnname) && !rdbIteration.values.containsKey( columnname != null ? columnname.replace("\"", "") : null)) { - throw new RuntimeException("Attribute " + columnname + " does not exist."); + throw new BurpException(new RmlError("Attribute " + columnname + " does not exist.", origin, RER.ReferenceFormulationExecutionError)); } Object value = rdbIteration.values.get(columnname); diff --git a/src/main/java/burp/ls/SPARQLFileSource.java b/src/main/java/burp/ls/SPARQLFileSource.java index 67d818a..aaa5f9c 100644 --- a/src/main/java/burp/ls/SPARQLFileSource.java +++ b/src/main/java/burp/ls/SPARQLFileSource.java @@ -18,7 +18,7 @@ public class SPARQLFileSource extends FileBasedLogicalSource { public List getIterations() { return iterations; } public void setIterations(List i) { iterations = i; } private final boolean isTSV; - private Resource referenceFormulation; + private final Resource referenceFormulation; public String iterator; public Origin iteratorOrigin; @@ -62,25 +62,46 @@ public Iterable iterator() { @Override public Reference buildExportedReference(String reference, Origin origin) { if (isTSV) return new SPARQLTSVReference(reference, origin); - return new SPARQLReference(reference, origin); + boolean isCSV = burp.vocabularies.RML.SPARQL_Results_CSV.equals(referenceFormulation); + return new SPARQLReference(reference, origin, isCSV); } } class SPARQLReference extends Reference { - public SPARQLReference(String reference, Origin origin) { + private final boolean isCSV; + + public SPARQLReference(String reference, Origin origin, boolean isCSV) { super(reference, origin); + this.isCSV = isCSV; } @Override public List getValues(Iteration i) { - if (!(i instanceof SPARQLIteration)) { + if (!(i instanceof SPARQLIteration sqIteration)) { throw new IllegalArgumentException("SPARQLReference can only be used with SPARQLIteration."); } - SPARQLIteration sqIteration = (SPARQLIteration) i; List l = new ArrayList<>(); RDFNode n = sqIteration.sol != null ? sqIteration.sol.get(reference) : null; if (n != null && !sqIteration.getNulls().contains(n)) { - l.add(n); + if (isCSV && n.isLiteral()) { + org.apache.jena.rdf.model.Literal lit = n.asLiteral(); + String dtUri = lit.getDatatypeURI(); + String lang = lit.getLanguage(); + if ((dtUri == null || dtUri.equals("http://www.w3.org/2001/XMLSchema#string")) && (lang == null || lang.isEmpty())) { + String lex = lit.getLexicalForm(); + if (lex.matches("^[+-]?\\d+$")) { + l.add(org.apache.jena.rdf.model.ResourceFactory.createTypedLiteral(lex, org.apache.jena.datatypes.xsd.XSDDatatype.XSDinteger)); + } else if (lex.matches("^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?$")) { + l.add(org.apache.jena.rdf.model.ResourceFactory.createTypedLiteral(lex, org.apache.jena.datatypes.xsd.XSDDatatype.XSDdouble)); + } else { + l.add(n); + } + } else { + l.add(n); + } + } else { + l.add(n); + } } return l; } @@ -93,10 +114,9 @@ public SPARQLTSVReference(String reference, Origin origin) { @Override public List getValues(Iteration i) { - if (!(i instanceof SPARQLTSVIteration)) { + if (!(i instanceof SPARQLTSVIteration sqIteration)) { throw new IllegalArgumentException("SPARQLTSVReference can only be used with SPARQLTSVIteration."); } - SPARQLTSVIteration sqIteration = (SPARQLTSVIteration) i; List l = new ArrayList<>(); RDFNode n = sqIteration.sol != null ? sqIteration.sol.get(reference != null ? reference.substring(1) : null) : null; if (n != null && !sqIteration.getNulls().contains(n)) { diff --git a/src/main/java/burp/ls/SPARQLServiceSource.java b/src/main/java/burp/ls/SPARQLServiceSource.java index 3b6c159..40ffbdb 100644 --- a/src/main/java/burp/ls/SPARQLServiceSource.java +++ b/src/main/java/burp/ls/SPARQLServiceSource.java @@ -86,6 +86,7 @@ public Iterable iterator() { @Override public Reference buildExportedReference(String reference, Origin origin) { if (isTSV) return new SPARQLTSVReference(reference, origin); - return new SPARQLReference(reference, origin); + boolean isCSV = burp.vocabularies.RML.SPARQL_Results_CSV.equals(referenceFormulation); + return new SPARQLReference(reference, origin, isCSV); } } \ No newline at end of file diff --git a/src/main/java/burp/model/ExpressionMap.java b/src/main/java/burp/model/ExpressionMap.java index 9c1ea34..578a230 100644 --- a/src/main/java/burp/model/ExpressionMap.java +++ b/src/main/java/burp/model/ExpressionMap.java @@ -78,22 +78,26 @@ private String getBaseIRI() { return baseIRI; } + @SuppressWarnings("unchecked") public List generateValues(Iteration i, TemplateReferenceSafety safe) { - if (expression instanceof RDFNodeConstant) { - RDFNodeConstant expr = (RDFNodeConstant) expression; - List list = new ArrayList<>(); - if (expr.constant != null) { - list.add(expr.constant); + switch (expression) { + case RDFNodeConstant expr -> { + List list = new ArrayList<>(); + if (expr.constant != null) { + list.add(expr.constant); + } + return list; } - return list; - } else if (expression instanceof Template) { - return (List) (List) ((Template) expression).values(i, safe); - } else if (expression instanceof Reference) { - return ((Reference) expression).values(i); - } else if (expression instanceof FunctionExecution) { - return ((FunctionExecution) expression).values(i); - } else { - throw new BurpException( + case Template template -> { + return (List) (List) template.values(i, safe); + } + case Reference reference -> { + return reference.values(i); + } + case FunctionExecution functionExecution -> { + return functionExecution.values(i); + } + case null, default -> throw new BurpException( new RmlError( "Error generating values, expression is not supported.", expressionOrigin, @@ -223,10 +227,8 @@ public List generateURIs(Iteration i) { protected List generateBlankNodes(Iteration i) { Set targets = getEffectiveTargets(); - if (expression instanceof RDFNodeConstant) { - RDFNodeConstant expr = (RDFNodeConstant) expression; - if (expr.constant instanceof BlankNodeTerm) { - BlankNodeTerm constant = (BlankNodeTerm) expr.constant; + if (expression instanceof RDFNodeConstant expr) { + if (expr.constant instanceof BlankNodeTerm constant) { return Collections.singletonList(new BlankNodeTerm(constant.id(), targets)); } else { return Collections.emptyList(); @@ -271,10 +273,8 @@ protected List generateLiterals(Iteration i, DatatypeMap dm, Langua List languages = lm != null ? lm.generateLanguageTags(i) : null; Set baseTargets = getEffectiveTargets(); - if (expression instanceof RDFNodeConstant) { - RDFNodeConstant expr = (RDFNodeConstant) expression; - if (expr.constant instanceof LiteralTerm) { - LiteralTerm constant = (LiteralTerm) expr.constant; + if (expression instanceof RDFNodeConstant expr) { + if (expr.constant instanceof LiteralTerm constant) { return Collections.singletonList(new LiteralTerm(constant.value(), constant.datatype(), constant.language(), baseTargets)); } else { return Collections.emptyList(); diff --git a/src/main/java/burp/model/LogicalTarget.java b/src/main/java/burp/model/LogicalTarget.java index 559a682..4fe89c9 100644 --- a/src/main/java/burp/model/LogicalTarget.java +++ b/src/main/java/burp/model/LogicalTarget.java @@ -1,9 +1,13 @@ package burp.model; import org.apache.jena.rdf.model.Resource; +import org.jspecify.annotations.NonNull; + +import java.util.HashSet; +import java.util.Set; public class LogicalTarget { - private RMLTarget target; + private final RMLTarget target; private Resource serialization; private Resource compression; private Resource encoding; @@ -19,6 +23,18 @@ public LogicalTarget(RMLTarget target) { this.target = target; } + @SafeVarargs + @NonNull + public static Set unionLogicalTargets(Set... targetSets) { + Set union = new HashSet<>(); + for (Set set : targetSets) { + if (set != null && !set.isEmpty()) { + union.addAll(set); + } + } + return union; + } + public RMLTarget getTarget() { return target; } diff --git a/src/main/java/burp/model/LogicalTargetScope.java b/src/main/java/burp/model/LogicalTargetScope.java index 3efc637..6aa09d2 100644 --- a/src/main/java/burp/model/LogicalTargetScope.java +++ b/src/main/java/burp/model/LogicalTargetScope.java @@ -12,8 +12,7 @@ default Set getEffectiveTargets() { } PlanNode p = getParent(); while (p != null) { - if (p instanceof LogicalTargetScope) { - LogicalTargetScope lts = (LogicalTargetScope) p; + if (p instanceof LogicalTargetScope lts) { if (lts.getLogicalTargets() != null && !lts.getLogicalTargets().isEmpty()) { return lts.getLogicalTargets(); } diff --git a/src/main/java/burp/model/MappingDocument.java b/src/main/java/burp/model/MappingDocument.java index 65c4261..0e80310 100644 --- a/src/main/java/burp/model/MappingDocument.java +++ b/src/main/java/burp/model/MappingDocument.java @@ -63,12 +63,10 @@ private List postProcessContainers(List stmts) { List result = new ArrayList<>(); for (RdfStatementLike stmt : stmts) { - if (stmt instanceof RdfStatement) { - RdfStatement rStmt = (RdfStatement) stmt; + if (stmt instanceof RdfStatement rStmt) { extractAndMergeContainers(rStmt.getSubject(), rStmt.getGraph(), containers, expandedContainer, newTerm -> rStmt.setSubject((BlankNodeOrIRI) newTerm)); extractAndMergeContainers(rStmt.getObject(), rStmt.getGraph(), containers, expandedContainer, newTerm -> rStmt.setObject(newTerm)); - } else if (stmt instanceof RdfStatementSubjectGraph) { - RdfStatementSubjectGraph rStmtGraph = (RdfStatementSubjectGraph) stmt; + } else if (stmt instanceof RdfStatementSubjectGraph rStmtGraph) { extractAndMergeContainers(rStmtGraph.getSubject(), rStmtGraph.getGraph(), containers, expandedContainer, newTerm -> rStmtGraph.setSubject((BlankNodeOrIRI) newTerm)); } } @@ -96,38 +94,42 @@ private List postProcessContainers(List stmts) { for (CollectionOrContainerTerm c : graphContainers.values()) { Term subject = c.getId(); - if (c instanceof RdfListTerm) { - Term currentListId = subject; - for (int i = 0; i < c.getElements().size(); i++) { - boolean isLast = i == c.getElements().size() - 1; - Term element = c.getElements().get(i); - - containerStmts.add(new RdfStatement( - (BlankNodeOrIRI) currentListId, - new IRITerm(RDF.first.getURI()), - TermExtensions.itselfOrId(element), - graph, - null - )); - - Term restObj = isLast ? new IRITerm(RDF.nil.getURI()) : new BlankNodeTerm(subject.toString() + "_" + (i + 1)); - - containerStmts.add(new RdfStatement( - (BlankNodeOrIRI) currentListId, - new IRITerm(RDF.rest.getURI()), - restObj, - graph, - null - )); - - currentListId = restObj; + switch (c) { + case RdfListTerm rdfListTerm -> { + Term currentListId = subject; + for (int i = 0; i < c.getElements().size(); i++) { + boolean isLast = i == c.getElements().size() - 1; + Term element = c.getElements().get(i); + + containerStmts.add(new RdfStatement( + (BlankNodeOrIRI) currentListId, + new IRITerm(RDF.first.getURI()), + TermExtensions.itselfOrId(element), + graph, + null + )); + + Term restObj = isLast ? new IRITerm(RDF.nil.getURI()) : new BlankNodeTerm(subject.toString() + "_" + (i + 1)); + + containerStmts.add(new RdfStatement( + (BlankNodeOrIRI) currentListId, + new IRITerm(RDF.rest.getURI()), + restObj, + graph, + null + )); + + currentListId = restObj; + } + } + case RdfBagTerm rdfBagTerm -> + emitContainerStmts(c, subject, new IRITerm(RDF.Bag.getURI()), graph, containerStmts); + case RdfSeqTerm rdfSeqTerm -> + emitContainerStmts(c, subject, new IRITerm(RDF.Seq.getURI()), graph, containerStmts); + case RdfAltTerm rdfAltTerm -> + emitContainerStmts(c, subject, new IRITerm(RDF.Alt.getURI()), graph, containerStmts); + default -> { } - } else if (c instanceof RdfBagTerm) { - emitContainerStmts(c, subject, new IRITerm(RDF.Bag.getURI()), graph, containerStmts); - } else if (c instanceof RdfSeqTerm) { - emitContainerStmts(c, subject, new IRITerm(RDF.Seq.getURI()), graph, containerStmts); - } else if (c instanceof RdfAltTerm) { - emitContainerStmts(c, subject, new IRITerm(RDF.Alt.getURI()), graph, containerStmts); } } } @@ -169,8 +171,7 @@ private Term rewrite(Term t) { } private void extractAndMergeContainers(Term t, IRITerm graph, Map> containers, Map> expandedContainer, Consumer replaceTermBy) { - if (t instanceof CollectionOrContainerTerm) { - CollectionOrContainerTerm c = (CollectionOrContainerTerm) t; + if (t instanceof CollectionOrContainerTerm c) { Set set = expandedContainer.computeIfAbsent(graph, k -> new HashSet<>()); if (set.add(c)) { Map graphContainers = containers.computeIfAbsent(graph, k -> new HashMap<>()); diff --git a/src/main/java/burp/model/PredicateObjectMap.java b/src/main/java/burp/model/PredicateObjectMap.java index 39e9782..26d5232 100644 --- a/src/main/java/burp/model/PredicateObjectMap.java +++ b/src/main/java/burp/model/PredicateObjectMap.java @@ -9,6 +9,8 @@ import java.util.Set; import java.util.stream.Stream; +import static burp.model.LogicalTarget.unionLogicalTargets; + public class PredicateObjectMap implements LogicalTargetScope, PlanNode { private final Set logicalTargets = new HashSet<>(); public List predicateMaps = new ArrayList<>(); @@ -46,17 +48,6 @@ public Iterable dependencies() { return children(); } - @SafeVarargs - private Set unionTargets(Set... targetSets) { - Set union = new HashSet<>(); - for (Set set : targetSets) { - if (set != null && !set.isEmpty()) { - union.addAll(set); - } - } - return union; - } - public List generate(Iteration i) { List lists = new ArrayList<>(); @@ -69,7 +60,7 @@ public List generate(Iteration i) { var objects = om.generateTerms(i); for (Term o : objects) { if (graphMaps.isEmpty()) { - lists.add(new RdfPredicateObject(pIri, o, null, unionTargets(p.targets(), o.targets()))); + lists.add(new RdfPredicateObject(pIri, o, null, unionLogicalTargets(p.targets(), o.targets()))); } else { for (GraphMap gm : graphMaps) { var graphs = gm.generateTerms(i); @@ -77,7 +68,7 @@ public List generate(Iteration i) { if (g instanceof IRITerm gIri) { // Graph targets are NOT applied here. They are applied per-graph in TriplesMap // to avoid graph-level targets leaking across different named graphs. - lists.add(new RdfPredicateObject(pIri, o, gIri, unionTargets(p.targets(), o.targets()))); + lists.add(new RdfPredicateObject(pIri, o, gIri, unionLogicalTargets(p.targets(), o.targets()))); } } } diff --git a/src/main/java/burp/model/RawReference.java b/src/main/java/burp/model/RawReference.java index 4b57cd3..6e3dd14 100644 --- a/src/main/java/burp/model/RawReference.java +++ b/src/main/java/burp/model/RawReference.java @@ -38,10 +38,8 @@ public List getValues(Iteration i) { public void compileReferences() { if (compiledReference == null && reference != null) { LocalReferenceScope scope = ancestor(LocalReferenceScope.class); - System.out.println("Compiling RawReference: " + reference + ", found scope: " + (scope != null ? scope.getClass().getSimpleName() : "null")); if (scope != null) { compiledReference = scope.buildLocalReference(reference, origin); - System.out.println(" compiled to: " + (compiledReference != null ? compiledReference.getClass().getSimpleName() : "null")); } } } diff --git a/src/main/java/burp/model/TriplesMap.java b/src/main/java/burp/model/TriplesMap.java index 66c2fa5..96a81db 100644 --- a/src/main/java/burp/model/TriplesMap.java +++ b/src/main/java/burp/model/TriplesMap.java @@ -13,6 +13,8 @@ import java.util.List; import java.util.Set; +import static burp.model.LogicalTarget.unionLogicalTargets; + public class TriplesMap implements PlanNode, BaseIRIScope, LocalReferenceScope, LogicalTargetScope { public Resource subject; public AbstractLogicalSource logicalSource; @@ -62,20 +64,10 @@ public Set getLogicalTargets() { return logicalTargets; } - private Set unionTargets(Set... targetSets) { - Set union = new HashSet<>(); - for (Set set : targetSets) { - if (set != null && !set.isEmpty()) { - union.addAll(set); - } - } - return union; - } - public List generate(Iteration i) { String tmBaseIRI = getBaseIri(); List stmts = new ArrayList<>(); - + Set subjectGraphs = new HashSet<>(); for (TermGenerator map : subjectMap.graphMaps) { for (Term t : map.generateTerms(i)) { @@ -84,7 +76,7 @@ public List generate(Iteration i) { } } } - + Set targetGraphsForSubjectMap = subjectMap.graphMaps.isEmpty() ? new HashSet<>() : subjectGraphs; if (subjectMap.graphMaps.isEmpty()) { targetGraphsForSubjectMap.add(null); @@ -93,17 +85,16 @@ public List generate(Iteration i) { var subjects = subjectMap.generateTerms(i); for (Term s : subjects) { - if (!(s instanceof BlankNodeOrIRI)) continue; - BlankNodeOrIRI sIri = (BlankNodeOrIRI) s; - + if (!(s instanceof BlankNodeOrIRI sIri)) continue; + if (s instanceof CollectionOrContainerTerm) { for (IRITerm g : targetGraphsForSubjectMap) { stmts.add(new RdfStatementSubjectGraph( - sIri, g, unionTargets(s.targets(), g != null ? g.targets() : null) + sIri, g, unionLogicalTargets(s.targets(), g != null ? g.targets() : null) )); } } - + for (Resource c : subjectMap.classes) { Set classTargets = subjectMap.getEffectiveTargets(); for (IRITerm g : targetGraphsForSubjectMap) { @@ -112,7 +103,7 @@ sIri, g, unionTargets(s.targets(), g != null ? g.targets() : null) new IRITerm("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), new IRITerm(c.getURI(), classTargets), g, - unionTargets(s.targets(), classTargets, g != null ? g.targets() : null) + unionLogicalTargets(s.targets(), classTargets, g != null ? g.targets() : null) )); countGeneratedStatements++; } @@ -122,8 +113,7 @@ sIri, g, unionTargets(s.targets(), g != null ? g.targets() : null) for (PredicateObjectMap pom : predicateObjectMaps) { List generatedPoms = pom.generate(i); for (Term s : subjects) { - if (!(s instanceof BlankNodeOrIRI)) continue; - BlankNodeOrIRI sIri = (BlankNodeOrIRI) s; + if (!(s instanceof BlankNodeOrIRI sIri)) continue; for (RdfPredicateObject po : generatedPoms) { Set combinedGraphs = new HashSet<>(); @@ -137,7 +127,7 @@ sIri, g, unionTargets(s.targets(), g != null ? g.targets() : null) } for (IRITerm g : combinedGraphs) { - Set finalTargets = unionTargets(s.targets(), po.targets(), g != null ? g.targets() : null); + Set finalTargets = unionLogicalTargets(s.targets(), po.targets(), g != null ? g.targets() : null); stmts.add(new RdfStatement(sIri, po.predicate(), po.object(), g, finalTargets)); countGeneratedStatements++; } diff --git a/src/main/java/burp/model/fnml/GrelFunctions.java b/src/main/java/burp/model/fnml/GrelFunctions.java index dccb31a..1e22a98 100644 --- a/src/main/java/burp/model/fnml/GrelFunctions.java +++ b/src/main/java/burp/model/fnml/GrelFunctions.java @@ -7,7 +7,7 @@ import burp.reporting.RmlError; import burp.vocabularies.RER; import com.google.auto.service.AutoService; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.text.WordUtils; import org.apache.jena.rdf.model.Property; @@ -124,7 +124,7 @@ public String getName() { public List apply(Map parameters, Origin origin) { String s = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParam"); String f = getValueString(parameters, "http://users.ugent.be/~bjdmeest/function/grel.ttl#param_string_sep"); - String out = StringUtils.removeEnd(s, f); + String out = Strings.CS.removeEnd(s, f); return List.of(new Return(out, out != null ? Map.of("http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOut", out) : Map.of())); } } diff --git a/src/main/java/burp/model/lv/LogicalView.java b/src/main/java/burp/model/lv/LogicalView.java index 952a70e..6eb7979 100644 --- a/src/main/java/burp/model/lv/LogicalView.java +++ b/src/main/java/burp/model/lv/LogicalView.java @@ -37,6 +37,7 @@ public Iterable dependencies() { return children(); } + @SuppressWarnings("unchecked") @Override public Iterable iterator() throws BurpException { if (iterations == null) { @@ -58,7 +59,7 @@ public Iterable iterator() throws BurpException { } } - return (List) (List) iterations; + return (List) (List) iterations; } @Override @@ -110,12 +111,10 @@ public LogicalReference(String reference, Origin origin) { @Override public List getValues(Iteration i) { - if (!(i instanceof LogicalIteration)) { + if (!(i instanceof LogicalIteration li)) { throw new IllegalArgumentException("LogicalReference " + reference + " can only be used with LogicalIteration."); } - LogicalIteration li = (LogicalIteration) i; - if (!li.map.containsKey(reference)) { throw new BurpException(new RmlError( "Attribute " + reference + " does not exist.", diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index 5e0b1bf..c594763 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -16,8 +16,6 @@ import burp.parse.turtleprov.ProvStore; import burp.parse.turtleprov.ProvTurtleVisitor; import burp.parse.turtleprov.RDF12Converter; -import burp.parse.turtleprov.generated.TurtleLexer; -import burp.parse.turtleprov.generated.TurtleParser; import burp.reporting.BurpException; import burp.reporting.Origin; import burp.reporting.RmlError; @@ -66,8 +64,6 @@ private Dataset parseTurtleFromFile(Path turtleFile) throws Exception { TurtleLexer lexer = new TurtleLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); TurtleParser parser = new TurtleParser(tokens); - var errorListeners = parser.getErrorListeners(); - var parserListeners = parser.getParseListeners(); parserError = new BurpParserError(); parser.addErrorListener(parserError); ProvTurtleVisitor visitor = new ProvTurtleVisitor(); @@ -85,9 +81,6 @@ public List parseMappingFile(Path mappingPath, Path currentDirectory if (guessType == Lang.TURTLE) { Dataset dataset = parseTurtleFromFile(mappingPath); - if (parserError!=null&& !parserError.errors.isEmpty()) { - - } mapping = dataset.getDefaultModel(); } else { mapping = RDFDataMgr.loadModel(mappingPath.toString()); @@ -109,16 +102,11 @@ public List parseMappingFile(Path mappingPath, Path currentDirectory Resource ls = r.getPropertyResourceValue(RML.logicalSource); Statement lsStmt = r.getProperty(RML.logicalSource); - AbstractLogicalSource source = prepareLogicalSource(ls); - tm.logicalSource = source; + tm.logicalSource = prepareLogicalSource(ls); - ls.listProperties(RML.logicalTarget).forEachRemaining(s -> { - tm.getLogicalTargets().add(prepareLogicalTarget(s.getResource())); - }); + ls.listProperties(RML.logicalTarget).forEachRemaining(s -> tm.getLogicalTargets().add(prepareLogicalTarget(s.getResource()))); - r.listProperties(RML.logicalTarget).forEachRemaining(s -> { - tm.getLogicalTargets().add(prepareLogicalTarget(s.getResource())); - }); + r.listProperties(RML.logicalTarget).forEachRemaining(s -> tm.getLogicalTargets().add(prepareLogicalTarget(s.getResource()))); List subjectMapList = r.listProperties(RML.subjectMap).toList(); if (subjectMapList.isEmpty()) { @@ -139,7 +127,7 @@ public List parseMappingFile(Path mappingPath, Path currentDirectory Main.report.getErrors().add( new RmlError( "Multiple subject maps in " + tm, - new Origin((PlanNode) null, originStatements), + new Origin(null, originStatements), RER.MappingError, null ) @@ -297,7 +285,7 @@ public String constructImplicitTermTypeQuery(Property mapType) { return pss.toString(); } - private AbstractLogicalSource prepareLogicalSource(Resource ls) throws Exception { + private AbstractLogicalSource prepareLogicalSource(Resource ls) { if (ls.hasProperty(RML.viewOn)) { return prepareLogicalView(ls); } @@ -311,17 +299,11 @@ private LogicalView prepareLogicalView(Resource ls) { lv.logicalSource = prepareLogicalSource(view); - ls.listProperties(RML.field).forEachRemaining(s -> { - lv.addField(prepareField(s.getObject().asResource())); - }); + ls.listProperties(RML.field).forEachRemaining(s -> lv.addField(prepareField(s.getObject().asResource()))); - ls.listProperties(RML.leftJoin).forEachRemaining(s -> { - lv.addJoin(prepareLeftJoin(s.getObject().asResource())); - }); + ls.listProperties(RML.leftJoin).forEachRemaining(s -> lv.addJoin(prepareLeftJoin(s.getObject().asResource()))); - ls.listProperties(RML.innerJoin).forEachRemaining(s -> { - lv.addJoin(prepareInnerJoin(s.getObject().asResource())); - }); + ls.listProperties(RML.innerJoin).forEachRemaining(s -> lv.addJoin(prepareInnerJoin(s.getObject().asResource()))); return lv; } catch (Exception e) { @@ -348,9 +330,7 @@ private ViewJoin prepareViewJoin(JoinType joinType, Resource resource) { resource.listProperties(RML.joinCondition).forEachRemaining(s -> conditions.add(prepareJoinCondition(s))); viewJoin.joinConditions = conditions; - resource.listProperties(RML.field).forEachRemaining(s -> { - viewJoin.addField(prepareField(s.getObject().asResource())); - }); + resource.listProperties(RML.field).forEachRemaining(s -> viewJoin.addField(prepareField(s.getObject().asResource()))); return viewJoin; } @@ -359,9 +339,7 @@ private SubjectMap prepareSubjectMap(Resource sm) { SubjectMap subjectMap = new SubjectMap(); prepareExpression(sm, subjectMap); - sm.listProperties(RML.clazz).forEachRemaining(s -> { - subjectMap.classes.add(s.getObject().asResource()); - }); + sm.listProperties(RML.clazz).forEachRemaining(s -> subjectMap.classes.add(s.getObject().asResource())); sm.listProperties(RML.graphMap).forEachRemaining(s -> { GraphMap gm = prepareGraphMap(s.getObject().asResource()); @@ -528,9 +506,7 @@ private Field prepareField(Resource p) { field.fieldName = p.getRequiredProperty(RML.fieldName).getObject().asLiteral().getString(); Field finalField = field; - p.listProperties(RML.field).forEachRemaining(s -> { - finalField.addField(prepareField(s.getObject().asResource())); - }); + p.listProperties(RML.field).forEachRemaining(s -> finalField.addField(prepareField(s.getObject().asResource()))); return finalField; } @@ -561,9 +537,7 @@ private ReferencingObjectMap prepareReferencingObjectMap(Resource rom) { rom.listProperties(RML.joinCondition).forEachRemaining(s -> conditions.add(prepareJoinCondition(s))); referencingObjectMap.joinConditions = conditions; - rom.listProperties(RML.logicalTarget).forEachRemaining(s -> { - referencingObjectMap.logicalTargets.add(prepareLogicalTarget(s.getResource())); - }); + rom.listProperties(RML.logicalTarget).forEachRemaining(s -> referencingObjectMap.logicalTargets.add(prepareLogicalTarget(s.getResource()))); return referencingObjectMap; } @@ -577,9 +551,7 @@ private EM prepareExpression(Resource r, EM em) { em.setExpression(exprAndOrigin.expression); em.setExpressionOrigin(exprAndOrigin.origin); - r.listProperties(RML.logicalTarget).forEachRemaining(s -> { - em.getLogicalTargets().add(prepareLogicalTarget(s.getResource())); - }); + r.listProperties(RML.logicalTarget).forEachRemaining(s -> em.getLogicalTargets().add(prepareLogicalTarget(s.getResource()))); return em; } @@ -609,7 +581,7 @@ private ExpressionAndOrigin prepareExpression(Resource r) { } else { term = new BlankNodeTerm(constant.asResource().getId().getLabelString()); } - Origin origin = new Origin((PlanNode) null, List.of(StatementParts.fromPredicateObject(stmt))); + Origin origin = new Origin(null, List.of(StatementParts.fromPredicateObject(stmt))); return new ExpressionAndOrigin(new RDFNodeConstant(term), origin); } @@ -655,8 +627,7 @@ private ExpressionAndOrigin prepareExpression(Resource r) { private Input prepareInput(Resource r) { Input input = new Input(); - ParameterMap pm = prepareExpression(r.getPropertyResourceValue(RML.parameterMap), new ParameterMap()); - input.parameterMap = pm; + input.parameterMap = prepareExpression(r.getPropertyResourceValue(RML.parameterMap), new ParameterMap()); input.inputValueMap = prepareInputValueMap(r.getPropertyResourceValue(RML.inputValueMap)); @@ -712,39 +683,38 @@ public List extractStatementsFromShaclViolation(ReportEntry vr, } if (resultPath != null) { - if (resultPath instanceof P_Path0 p0) { - Property predicate = mapping.getProperty(p0.getNode().getURI()); - if (valueNode != null) { - mapping.listStatements(focusResource, predicate, valueNode).forEachRemaining(stmt -> { - results.add(StatementParts.from(stmt, Subject, Predicate, Object)); - }); - } else { - mapping.listStatements(focusResource, predicate, (RDFNode) null).forEachRemaining(stmt -> { - results.add(StatementParts.from(stmt, Subject, Predicate, Object)); - }); + switch (resultPath) { + case P_Path0 p0 -> { + Property predicate = mapping.getProperty(p0.getNode().getURI()); + if (valueNode != null) { + mapping.listStatements(focusResource, predicate, valueNode).forEachRemaining(stmt -> results.add(StatementParts.from(stmt, Subject, Predicate, Object))); + } else { + mapping.listStatements(focusResource, predicate, (RDFNode) null).forEachRemaining(stmt -> results.add(StatementParts.from(stmt, Subject, Predicate, Object))); + } } - } else if (resultPath instanceof P_Path1 p1) { - if (resultPath instanceof P_Inverse pInv) { - org.apache.jena.sparql.path.Path subPath = pInv.getSubPath(); - if (subPath instanceof P_Path0 p0) { - Property predicate = mapping.getProperty(p0.getNode().getURI()); - Resource s = (valueNode != null && valueNode.isResource()) ? valueNode.asResource() : null; - mapping.listStatements(s, predicate, focusResource).forEachRemaining(stmt -> { - results.add(StatementParts.from(stmt, Subject, Predicate, Object)); - }); + case P_Path1 p1 -> { + if (resultPath instanceof P_Inverse pInv) { + org.apache.jena.sparql.path.Path subPath = pInv.getSubPath(); + if (subPath instanceof P_Path0 p0) { + Property predicate = mapping.getProperty(p0.getNode().getURI()); + Resource s = (valueNode != null && valueNode.isResource()) ? valueNode.asResource() : null; + mapping.listStatements(s, predicate, focusResource).forEachRemaining(stmt -> results.add(StatementParts.from(stmt, Subject, Predicate, Object))); + } } } - } else if (resultPath instanceof P_Path2) { - // Not handled - } else if (resultPath instanceof P_NegPropSet) { - // Not handled + case P_Path2 pPath2 -> { + // Not handled + } + case P_NegPropSet pNegPropSet -> { + // Not handled + } + default -> { + } } } if (results.isEmpty()) { - mapping.listStatements(focusResource, null, valueNode).forEachRemaining(stmt -> { - results.add(StatementParts.from(stmt, Subject)); - }); + mapping.listStatements(focusResource, null, valueNode).forEachRemaining(stmt -> results.add(StatementParts.from(stmt, Subject))); mapping.listStatements(null, null, focusResource).forEachRemaining(stmt -> { boolean contains = results.stream().anyMatch(it -> it.getStmt().equals(stmt)); diff --git a/src/main/java/burp/parse/turtleprov/Point.java b/src/main/java/burp/parse/turtleprov/Point.java index e719797..cccdcab 100644 --- a/src/main/java/burp/parse/turtleprov/Point.java +++ b/src/main/java/burp/parse/turtleprov/Point.java @@ -54,8 +54,7 @@ public static Point fromOffset(String text, int offset) { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof Point)) return false; - Point point = (Point) o; + if (!(o instanceof Point point)) return false; return line == point.line && column == point.column; } diff --git a/src/main/java/burp/parse/turtleprov/ProvTriple.java b/src/main/java/burp/parse/turtleprov/ProvTriple.java index a10878b..3156ccb 100644 --- a/src/main/java/burp/parse/turtleprov/ProvTriple.java +++ b/src/main/java/burp/parse/turtleprov/ProvTriple.java @@ -28,8 +28,7 @@ public ProvTriple(Statement statement) { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof ProvTriple)) return false; - ProvTriple that = (ProvTriple) o; + if (!(o instanceof ProvTriple that)) return false; return Objects.equals(statement, that.statement) && Objects.equals(subjectInfo, that.subjectInfo) && Objects.equals(predicateInfo, that.predicateInfo) && diff --git a/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java index 0bc9843..16fcd22 100644 --- a/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java +++ b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java @@ -1,8 +1,9 @@ package burp.parse.turtleprov; -import burp.parse.turtleprov.generated.TurtleBaseVisitor; -import burp.parse.turtleprov.generated.TurtleParser; +import burp.reporting.LiteralPart; import burp.reporting.PointRange; +import burp.reporting.RDFGraphPointer; +import burp.reporting.StatementParts; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.TerminalNode; import org.apache.jena.rdf.model.*; @@ -13,7 +14,48 @@ import java.util.regex.Pattern; public class ProvTurtleVisitor extends TurtleBaseVisitor { - public static List retrieveTurtleLocation(Object o) { return Collections.emptyList(); } + public static List retrieveTurtleLocation(Object o) { + if (!(o instanceof List sourceStatements)) { + return Collections.emptyList(); + } + if (sourceStatements.isEmpty()) { + return Collections.emptyList(); + } + List locations = new ArrayList<>(); + for (Object item : sourceStatements) { + if (item instanceof RDFGraphPointer gp) { + var stmt = gp.getStmt(); + if (stmt == null || stmt.getModel() == null) { + continue; + } + var infos = RDF12Converter.fromAnnotations(stmt, stmt.getModel()); + if (gp instanceof StatementParts sp) { + if (sp.isSubject() && infos.subjectInfo != null && infos.subjectInfo.start() != null) { + locations.add(new PointRange(infos.subjectInfo.start(), infos.subjectInfo.end())); + } + if (sp.isPredicate() && infos.predicateInfo != null && infos.predicateInfo.start() != null) { + locations.add(new PointRange(infos.predicateInfo.start(), infos.predicateInfo.end())); + } + if (sp.isObject() && infos.objectInfo != null && infos.objectInfo.start() != null) { + locations.add(new PointRange(infos.objectInfo.start(), infos.objectInfo.end())); + } + } else if (gp instanceof LiteralPart lp) { + if (infos.objectInfo != null) { + var info = infos.objectInfo; + Point literalEnd = lp.getObjectRange().getEnd(); + Point startPt = info.rdfLiteralStringStart(); + Point endPt = info.rdfLiteralStringEnd(); + Point newStart = startPt != null ? startPt.plus(lp.getObjectRange().getStart()) : null; + Point newEnd = (startPt != null && literalEnd != null) ? startPt.plus(literalEnd) : endPt; + if (newStart != null && newEnd != null) { + locations.add(new PointRange(newStart, newEnd)); + } + } + } + } + } + return locations; + } private final ProvStore store = new ProvStore(); public ProvStore getStore() { diff --git a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java index 92a7b12..e000698 100644 --- a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java +++ b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java @@ -1,8 +1,5 @@ package burp.parse.turtleprov; -import burp.parse.turtleprov.generated.TurtleLexer; -import burp.parse.turtleprov.generated.TurtleParser; - import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/burp/reporting/FileGeometry.java b/src/main/java/burp/reporting/FileGeometry.java new file mode 100644 index 0000000..60eb9a2 --- /dev/null +++ b/src/main/java/burp/reporting/FileGeometry.java @@ -0,0 +1,81 @@ +package burp.reporting; + +import java.util.*; + +/** + * Converts a list of Nodes (which may span multiple lines) into a map of + * LineIndex -> List. Overlapping ranges are merged. + * + * @return a map from line indexes (0 indexed) to a list of column ranges (also 0-indexed). + */ +public class FileGeometry { + + public record ColumnRange(int first, int last) { + } + + public static Map> getMergedHighlights(List nodes, List lines) { + Map> rawMap = new HashMap<>(); + + // 1. Flatten Nodes into raw line ranges + for (PointRange node : nodes) { + if (node.getEnd() == null) continue; + + int startLine = Math.max(node.getStart().line(), 0); + int endLine = Math.min(node.getEnd().line(), lines.size() - 1); + + for (int lineIdx = startLine; lineIdx <= endLine; lineIdx++) { + int lineLen = lines.get(lineIdx).length(); + + int startCol = (lineIdx == startLine) ? node.getStart().column() : 0; + int endCol = (lineIdx == endLine) ? node.getEnd().column() : lineLen; // Go to end of line if multi-line + + // Ensure we don't go out of bounds + int safeStart = Math.max(0, Math.min(startCol, lineLen)); + int safeEnd = Math.max(0, Math.min(endCol, lineLen)); + + // Add only valid ranges + if (safeStart <= safeEnd) { + rawMap.computeIfAbsent(lineIdx, k -> new ArrayList<>()).add(new ColumnRange(safeStart, safeEnd)); + } + } + } + + // 2. Merge overlapping ranges for each line + Map> mergedMap = new HashMap<>(); + for (Map.Entry> entry : rawMap.entrySet()) { + mergedMap.put(entry.getKey(), mergeRanges(entry.getValue())); + } + return mergedMap; + } + + /** + * Merges a list of overlapping or adjacent ranges. + * e.g. [0..5, 4..8, 10..12] -> [0..8, 10..12] + */ + public static List mergeRanges(List ranges) { + if (ranges.isEmpty()) { + return Collections.emptyList(); + } + + List sorted = new ArrayList<>(ranges); + sorted.sort(Comparator.comparingInt(ColumnRange::first)); + + List merged = new ArrayList<>(); + ColumnRange current = sorted.get(0); + + for (int i = 1; i < sorted.size(); i++) { + ColumnRange next = sorted.get(i); + // If next overlaps or is adjacent to current (next.first <= current.last + 1) + // We use +1 to merge "adjacent" chars (e.g. 0..1 and 2..3 become 0..3) + // because visually they should be one block. + if (next.first() <= current.last() + 1) { + current = new ColumnRange(current.first(), Math.max(current.last(), next.last())); + } else { + merged.add(current); + current = next; + } + } + merged.add(current); + return merged; + } +} diff --git a/src/main/java/burp/reporting/FileHighlight.java b/src/main/java/burp/reporting/FileHighlight.java new file mode 100644 index 0000000..feb71b5 --- /dev/null +++ b/src/main/java/burp/reporting/FileHighlight.java @@ -0,0 +1,123 @@ +package burp.reporting; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; + +public class FileHighlight { + + public static String extractAndHighlight(Path filePath, List nodes) { + return extractAndHighlight(filePath, nodes, 1); + } + + public static String extractAndHighlight(Path filePath, List nodes, int contextLines) { + if (!Files.exists(filePath)) { + return null; + } + + List allLines; + try { + allLines = Files.readAllLines(filePath); + } catch (IOException e) { + return null; + } + + if (nodes.isEmpty()) { + return null; + } + + Map> highlightsByLine = FileGeometry.getMergedHighlights(nodes, allLines); + if (highlightsByLine.isEmpty()) { + return null; + } + + List linesToPrint = calculateLinesToPrint(highlightsByLine.keySet(), allLines.size() - 1, contextLines); + + StringBuilder sb = new StringBuilder(); + int previousLineIndex = -1; + + for (int lineIndex : linesToPrint) { + // Add ellipsis if we skipped lines + if (previousLineIndex != -1 && lineIndex > previousLineIndex + 1) { + sb.append(String.format("%6s", "...")).append(System.lineSeparator()); + } + previousLineIndex = lineIndex; + + String lineContent = allLines.get(lineIndex); + List rangesOnLine = highlightsByLine.getOrDefault(lineIndex, Collections.emptyList()); + String lineNumberStr = formatLineNumber(lineIndex + 1); + + sb.append(lineNumberStr); + sb.append(renderLineWithColors(lineContent, rangesOnLine)).append(System.lineSeparator()); + } + + return sb.toString(); + } + + private static List calculateLinesToPrint( + Set highlightedLines, + int maxLineIndex, + int contextLines + ) { + Set linesToPrint = new TreeSet<>(); + for (int lineIdx : highlightedLines) { + int start = Math.max(lineIdx - contextLines, 0); + int end = Math.min(lineIdx + contextLines, maxLineIndex); + for (int i = start; i <= end; i++) { + linesToPrint.add(i); + } + } + return new ArrayList<>(linesToPrint); + } + + private static String formatLineNumber(int lineNumber) { + String s = lineNumber + " "; + return String.format("%5s", s) + "| "; + } + + /** + * Splits the line string based on ranges and inserts ANSI codes. + */ + private static String renderLineWithColors(String line, List ranges) { + if (ranges.isEmpty()) { + return line; + } + + StringBuilder sb = new StringBuilder(); + int currentIndex = 0; + + // Ranges are already sorted and non-overlapping from mergeRanges + for (FileGeometry.ColumnRange range : ranges) { + // Append text before the highlight + if (currentIndex < range.first()) { + sb.append(line, currentIndex, range.first()); + } + + // Append highlighted text + // Ensure we don't go out of bounds if the range extends slightly beyond line length (rare but possible) + int safeEnd = Math.min(range.last() + 1, line.length()); + if (range.first() < safeEnd) { + String textToHighlight = line.substring(range.first(), safeEnd); + sb.append(ansiBoldRed(textToHighlight)); + } + + currentIndex = safeEnd; + } + + // Append the remaining text + if (currentIndex < line.length()) { + sb.append(line.substring(currentIndex)); + } + + return sb.toString(); + } + + public static String ansiBoldRed(String text) { + return "\u001B[1;31m" + text + "\u001B[0m"; + } + + public static String ansiRed(String text) { + return "\u001B[31m" + text + "\u001B[0m"; + } +} diff --git a/src/main/java/burp/reporting/PlainTextReportGenerator.java b/src/main/java/burp/reporting/PlainTextReportGenerator.java new file mode 100644 index 0000000..961d615 --- /dev/null +++ b/src/main/java/burp/reporting/PlainTextReportGenerator.java @@ -0,0 +1,142 @@ +package burp.reporting; + +import burp.Main; +import burp.parse.turtleprov.ProvTurtleVisitor; +import burp.vocabularies.RER; +import org.apache.jena.ontology.OntClass; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +public class PlainTextReportGenerator { + + public static String generateTextReport(RmlExecutionReport report) { + StringBuilder sb = new StringBuilder(); + + printIssues(sb, report.getErrors(), "Errors"); + + sb.append("Statistics:\n"); + int triplesMapsSize = 0; + if (report.getExecutionPlan() != null && report.getExecutionPlan().triplesMaps != null) { + triplesMapsSize = report.getExecutionPlan().triplesMaps.size(); + } + sb.append(" - Number of triples maps: ").append(triplesMapsSize).append("\n"); + sb.append(" - Generated statements: ").append(report.getStatistics().getGeneratedStatements()).append("\n"); + sb.append(" - Generated statements per triples map:\n"); + + if (report.getStatistics().getGeneratedStatementPerTriplesMap() != null) { + for (var entry : report.getStatistics().getGeneratedStatementPerTriplesMap().entrySet()) { + sb.append(" * ") + .append(entry.getKey().subject) + .append("\t ") + .append(entry.getValue()) + .append("\n"); + } + } + + return sb.toString(); + } + + private static void printTracingInfo(StringBuilder sb, RmlError issue) { + if (issue.getOrigin() != null) { + Origin origin = issue.getOrigin(); + sb.append(prependIndent("In mapping", 4)).append(System.lineSeparator()); + Path file = Main.mappingFile.normalize(); + List locations = ProvTurtleVisitor.retrieveTurtleLocation(origin.sourceStatements() != null ? origin.sourceStatements() : Collections.emptyList()); + + // Print file:line:col - line:col + List sortedLocations = new ArrayList<>(locations); + sortedLocations.sort(Comparator.comparing(PointRange::getStart)); + + List lineLocations = new ArrayList<>(); + for (PointRange location : sortedLocations) { + lineLocations.add(prependIndent(Errors.fileLocationString(file, location), 6)); + } + + // Print File Underlined extract + String highlight = FileHighlight.extractAndHighlight(file, locations); + if (highlight != null) { + if (!lineLocations.isEmpty()) { + sb.append(lineLocations.get(0)).append(System.lineSeparator()); + } + sb.append(highlight); + } else { + for (String lineLoc : lineLocations) { + sb.append(lineLoc).append(System.lineSeparator()); + } + } + } + } + + private static void printIssues(StringBuilder sb, List issues, String header) { + if (issues != null && !issues.isEmpty()) { + sb.append(header).append(":").append(System.lineSeparator()); + for (int i = 0; i < issues.size(); i++) { + RmlError issue = issues.get(i); + sb.append(prependIndent(FileHighlight.ansiRed(issue.getMessage()), 2)).append(System.lineSeparator()); + printTracingInfo(sb, issue); + appendErrorTypeHelp(sb, issue.getErrorType()); + + if (issue.getException() != null) { + sb.append(prependIndent("Exception: " + issue.getException(), 4)).append(System.lineSeparator()); + sb.append(prependIndent("StackTrace: " + getStackTraceAsString(issue.getException()), 4)).append(System.lineSeparator()); + } + // Add empty line between issues for better readability + if (i < issues.size() - 1) { + sb.append(System.lineSeparator()); + } + } + sb.append(System.lineSeparator()); // Add an extra line after a section + } + } + + private static void appendErrorTypeHelp(StringBuilder sb, OntClass issueType) { + if (issueType == null) return; + String label = issueType.getLabel(null); + sb.append(prependIndent("is a " + label + " (" + issueType + ")", 4)).append(System.lineSeparator()); + + String comment = issueType.getComment(null); + if (comment == null) { + comment = "null"; + } + sb.append(prependIndent(prependIndent(comment, "| "), 6)).append(System.lineSeparator()); + + var potentialSolution = issueType.getPropertyValue(RER.potentialSolution); + if (potentialSolution != null) { + sb.append(prependIndent("| Try to: " + potentialSolution, 6)).append(System.lineSeparator()); + } + } + + private static String prependIndent(String s, int indent) { + return prependIndent(s, " ".repeat(indent)); + } + + private static String prependIndent(String s, String indent) { + if (s == null) return ""; + String[] lines = s.split("\r?\n", -1); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < lines.length; i++) { + if (i > 0) { + sb.append(System.lineSeparator()); + } + if (!lines[i].isBlank()) { + sb.append(indent).append(lines[i]); + } else { + sb.append(lines[i]); + } + } + return sb.toString(); + } + + private static String getStackTraceAsString(Throwable throwable) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + throwable.printStackTrace(pw); + return sw.toString(); + } +} diff --git a/src/main/java/burp/util/SimpleNamespaceContext.java b/src/main/java/burp/util/SimpleNamespaceContext.java index efd5419..cd508be 100644 --- a/src/main/java/burp/util/SimpleNamespaceContext.java +++ b/src/main/java/burp/util/SimpleNamespaceContext.java @@ -1,11 +1,10 @@ package burp.util; +import javax.xml.namespace.NamespaceContext; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import javax.xml.namespace.NamespaceContext; - // Kudos to https://stackoverflow.com/a/6392700 public class SimpleNamespaceContext implements NamespaceContext { @@ -23,7 +22,7 @@ public String getPrefix(String uri) { throw new UnsupportedOperationException(); } - public Iterator getPrefixes(String uri) { + public Iterator getPrefixes(String uri) { throw new UnsupportedOperationException(); } diff --git a/src/test/java/burp/FileGeometryTest.java b/src/test/java/burp/FileGeometryTest.java new file mode 100644 index 0000000..894e5e1 --- /dev/null +++ b/src/test/java/burp/FileGeometryTest.java @@ -0,0 +1,176 @@ +package burp; + +import burp.parse.turtleprov.Point; +import burp.reporting.FileGeometry; +import burp.reporting.PointRange; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class FileGeometryTest { + + @Test + public void testUserReproductionCaseWithMergedRanges() { + List lines = Arrays.asList( + "@prefix ex: .", + "@prefix rml: .", + " a rml:TriplesMap;", + "", + "rml:logicalSource [ a rml:LogicalSource;", + " rml:iterator \"$.students[*]\";", + " rml:referenceFormulation rml:JSONPath;", + " rml:source [ a rml:RelativePathSource;", + " rml:root rml:MappingDirectory;", + " rml:path \"student2.json\" ", + " ]", + "] ." + ); + + List nodes = Arrays.asList( + new PointRange(new Point(5, 18), new Point(5, 20)), + new PointRange(new Point(5, 21), new Point(5, 31)), + new PointRange(new Point(9, 7), new Point(9, 14)), + new PointRange(new Point(9, 17), new Point(9, 29)) + ); + + Map> result = FileGeometry.getMergedHighlights(nodes, lines); + + assertTrue(result.containsKey(5)); + assertTrue(result.containsKey(9)); + + List line6 = result.get(5); + assertEquals(1, line6.size()); + assertEquals(new FileGeometry.ColumnRange(18, 31), line6.get(0)); + + List line10 = result.get(9); + assertEquals(2, line10.size()); + assertEquals(new FileGeometry.ColumnRange(7, 14), line10.get(0)); + assertEquals(new FileGeometry.ColumnRange(17, 29), line10.get(1)); + } + + @Test + public void testOverlappingRangesMerge() { + List lines = Collections.singletonList("0123456789"); + // Overlapping: 0..4 and 2..6 -> 0..6 + List nodes = Arrays.asList( + new PointRange(new Point(0, 0), new Point(0, 4)), + new PointRange(new Point(0, 2), new Point(0, 6)) + ); + + Map> result = FileGeometry.getMergedHighlights(nodes, lines); + List ranges = result.get(0); + + assertEquals(1, ranges.size()); + assertEquals(new FileGeometry.ColumnRange(0, 6), ranges.get(0)); + } + + @Test + public void testAdjacentRangesMerge() { + List lines = Collections.singletonList("0123456789"); + // Adjacent: 0..4 and 5..9 -> 0..9 + List nodes = Arrays.asList( + new PointRange(new Point(0, 0), new Point(0, 4)), + new PointRange(new Point(0, 5), new Point(0, 9)) + ); + + Map> result = FileGeometry.getMergedHighlights(nodes, lines); + List ranges = result.get(0); + + assertEquals(1, ranges.size()); + assertEquals(new FileGeometry.ColumnRange(0, 9), ranges.get(0)); + } + + @Test + public void testNonAdjacentRangesDoNotMerge() { + List lines = Collections.singletonList("0123456789"); + // Gap: 0..3 and 5..8 (Gap at 4) -> 0..3, 5..8 + List nodes = Arrays.asList( + new PointRange(new Point(0, 0), new Point(0, 3)), + new PointRange(new Point(0, 5), new Point(0, 8)) + ); + + Map> result = FileGeometry.getMergedHighlights(nodes, lines); + List ranges = result.get(0); + + assertEquals(2, ranges.size()); + assertEquals(new FileGeometry.ColumnRange(0, 3), ranges.get(0)); + assertEquals(new FileGeometry.ColumnRange(5, 8), ranges.get(1)); + } + + @Test + public void testMultiLineNode() { + List lines = Arrays.asList("line1", "line2", "line3"); + // Node spans from line 1 col 2 to line 3 col 2 + // Indices: 0, 1, 2 + // Line 0: 2..end (len 5 -> 2..5) + // Line 1: 0..end (len 5 -> 0..5) + // Line 2: 0..2 + + List nodes = Collections.singletonList( + new PointRange(new Point(0, 2), new Point(2, 2)) + ); + + Map> result = FileGeometry.getMergedHighlights(nodes, lines); + + assertEquals(3, result.size()); + assertEquals(Collections.singletonList(new FileGeometry.ColumnRange(2, 5)), result.get(0)); + assertEquals(Collections.singletonList(new FileGeometry.ColumnRange(0, 5)), result.get(1)); + assertEquals(Collections.singletonList(new FileGeometry.ColumnRange(0, 2)), result.get(2)); + } + + @Test + public void testOutOfBoundsClamping() { + List lines = Collections.singletonList("abc"); + // Node requests col 10..20 on line 1 + List nodes = Collections.singletonList( + new PointRange(new Point(0, 10), new Point(0, 20)) + ); + + Map> result = FileGeometry.getMergedHighlights(nodes, lines); + List ranges = result.get(0); + assertEquals(Collections.singletonList(new FileGeometry.ColumnRange(3, 3)), ranges); + } + + @Test + public void testInvalidLineNumberIgnored() { + List lines = Collections.singletonList("abc"); + // Node on line 100 + List nodes = Collections.singletonList( + new PointRange(new Point(100, 0), new Point(100, 5)) + ); + + Map> result = FileGeometry.getMergedHighlights(nodes, lines); + assertTrue(result.isEmpty()); + } + + @Test + public void testMergeRangesLogicExplicitly() { + // Direct test of mergeRanges helper + List ranges = Arrays.asList( + new FileGeometry.ColumnRange(0, 5), + new FileGeometry.ColumnRange(4, 8), + new FileGeometry.ColumnRange(10, 12) + ); + List merged = FileGeometry.mergeRanges(ranges); + + // 0..5 and 4..8 overlap -> 0..8 + // 10..12 is separate (gap 9) + // Result: 0..8, 10..12 + + assertEquals(2, merged.size()); + assertEquals(new FileGeometry.ColumnRange(0, 8), merged.get(0)); + assertEquals(new FileGeometry.ColumnRange(10, 12), merged.get(1)); + } + + @Test + public void testMergeRangesEmpty() { + List merged = FileGeometry.mergeRanges(Collections.emptyList()); + assertTrue(merged.isEmpty()); + } +} diff --git a/src/test/java/burp/FileHighlightTest.java b/src/test/java/burp/FileHighlightTest.java new file mode 100644 index 0000000..9900bce --- /dev/null +++ b/src/test/java/burp/FileHighlightTest.java @@ -0,0 +1,125 @@ +package burp; + +import burp.parse.turtleprov.Point; +import burp.reporting.FileHighlight; +import burp.reporting.PointRange; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import static org.junit.jupiter.api.Assertions.*; + +public class FileHighlightTest { + + @BeforeAll + public static void setup() { + System.setProperty("picocli.ansi", "true"); + } + + @AfterAll + public static void teardown() { + System.clearProperty("picocli.ansi"); + } + + @TempDir + Path tempDir; + + @Test + public void testExtractAndHighlightBasicUsage() throws IOException { + Path file = tempDir.resolve("test.ttl"); + List lines = Arrays.asList( + "@prefix ex: .", + "foo bar baz", + "qux quux" + ); + Files.write(file, lines); + + // Highlight "bar" on line 2 (indices 4..6) + List nodes = Collections.singletonList( + new PointRange(new Point(1, 4), new Point(1, 6)) + ); + + String result = FileHighlight.extractAndHighlight(file, nodes, 0); + + System.out.println("Basic Result:\n" + result); + + assertNotNull(result); + assertTrue(result.contains(" 2 | "), "Should contain formatted line number ' 2 | '"); + assertTrue(result.contains("bar"), "Should contain highlighted text 'bar'"); + } + + @Test + public void testExtractAndHighlightWithContext() throws IOException { + Path file = tempDir.resolve("context.ttl"); + List lines = Arrays.asList( + "line 1", + "line 2 target", + "line 3" + ); + Files.write(file, lines); + + // Highlight "target" on line 2 (cols 7..12) + List nodes = Collections.singletonList( + new PointRange(new Point(1, 7), new Point(1, 12)) + ); + + String result = FileHighlight.extractAndHighlight(file, nodes, 1); + + assertNotNull(result); + // Check context lines and target line + assertTrue(result.contains(" 1 | line 1")); + assertTrue(result.contains(" 2 | line 2 ")); + assertTrue(result.contains("target")); + assertTrue(result.contains(" 3 | line 3")); + } + + @Test + public void testFileNotFound() { + Path file = tempDir.resolve("nonexistent.ttl"); + List nodes = Collections.singletonList(new PointRange(new Point(1, 0), new Point(1, 5))); + + String result = FileHighlight.extractAndHighlight(file, nodes); + assertNull(result); + } + + @Test + public void testEmptyNodes() throws IOException { + Path file = tempDir.resolve("empty.ttl"); + Files.write(file, Collections.singletonList("abc")); + + String result = FileHighlight.extractAndHighlight(file, Collections.emptyList()); + assertNull(result); + } + + @Test + public void testEllipsisInsertion() throws IOException { + Path file = tempDir.resolve("ellipsis.ttl"); + List lines = IntStream.rangeClosed(1, 10).mapToObj(i -> "line " + i).collect(Collectors.toList()); + Files.write(file, lines); + + // Highlight line 2 and line 9. Context 0. + // Should print line 2, then ellipsis, then line 9. + List nodes = Arrays.asList( + new PointRange(new Point(1, 0), new Point(1, 5)), + new PointRange(new Point(8, 0), new Point(8, 5)) + ); + + String result = FileHighlight.extractAndHighlight(file, nodes, 0); + + assertNotNull(result); + + assertTrue(result.contains(" 2 | "), "Should contain line 2"); + assertTrue(result.contains(" ..."), "Should contain ellipsis"); + assertTrue(result.contains(" 9 | "), "Should contain line 9"); + } +} diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java index fac3bab..fad5a46 100644 --- a/src/test/java/burp/TestRMLIORegistry.java +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -16,6 +16,7 @@ import java.io.File; import java.io.FileOutputStream; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; @@ -31,13 +32,11 @@ public String getBase() { @Override public void prepareSource(TestData testData) throws Exception { - System.out.printf("Preparing test %s%n", testData.ID); - String mappingPath = new File(base + testData.ID, testData.mapping).getAbsolutePath(); String newMappingPath = mappingPath; if ("application/sql".equals(testData.input_format1)) { - System.out.println("Preparing mapping for database connection..."); + System.out.println("Preparing database connection..."); Model model = RDFDataMgr.loadModel(mappingPath); String jdbcDriver = model.listObjectsOfProperty(D2RQ.jdbcDriver).next().asLiteral().getString(); @@ -75,12 +74,14 @@ public void prepareSource(TestData testData) throws Exception { throw new IllegalArgumentException("Unsupported JDBC driver: " + jdbcDriver); } + System.out.printf("Updating database connection in mapping with JDBC URL=%s Username=%s Password=%s%n", db.getJdbcUrl(), db.getUsername(), db.getPassword()); String sparql = String.format( - "PREFIX d2rq: \n" + - "DELETE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass }\n" + - "INSERT { ?s d2rq:jdbcDSN \"%s\"; d2rq:username \"%s\"; d2rq:password \"%s\" }\n" + - "WHERE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass }", - db.getJdbcUrl(), db.getUsername(), db.getPassword() + """ + PREFIX d2rq: + DELETE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass } + INSERT { ?s d2rq:jdbcDSN "%s"; d2rq:username "%s"; d2rq:password "%s" } + WHERE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass }""", + db.getJdbcUrl(), db.getUsername(), db.getPassword() ); var updateRequest = UpdateFactory.create(sparql); UpdateAction.execute(updateRequest, model); @@ -89,6 +90,7 @@ public void prepareSource(TestData testData) throws Exception { try (FileOutputStream out = new FileOutputStream(newMappingPath)) { RDFDataMgr.write(out, model, RDFFormat.TURTLE_PRETTY); } + System.out.println("Mapping updated in " + newMappingPath); System.out.println("Populating database..."); String sqlFilePath = new File(base + testData.ID, testData.input1).getAbsolutePath(); @@ -103,30 +105,23 @@ public void prepareSource(TestData testData) throws Exception { } } - System.out.println(testData.mapping); - System.out.println(testData.output1); - System.out.println(testData.error); - System.out.println(); - - if (testData.error) { - testForNotOK(testData, newMappingPath); - } else { - testForOK(testData); + if (!newMappingPath.equals(mappingPath)) { + testData.mapping = Path.of(newMappingPath).getFileName().toString(); } } public static PostgreSQLContainer PGSQL_CONTAINER = new PostgreSQLContainer("postgres:latest") - .withUsername("postgres") - .withPassword("test"); + .withUsername("postgres") + .withPassword("test"); private static CompletableFuture PGSQL_CONTAINER_FUTURE = null; public static MySQLContainer MYSQL_CONTAINER = new MySQLContainer("mysql:8") - .withEnv("MYSQL_ROOT_HOST", "%") - .withCommand("mysqld", "--sql_mode=ANSI_QUOTES"); + .withEnv("MYSQL_ROOT_HOST", "%") + .withCommand("mysqld", "--sql_mode=ANSI_QUOTES"); private static CompletableFuture MYSQL_CONTAINER_FUTURE = null; public static MSSQLServerContainer MSSQL_CONTAINER = new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2022-CU20-ubuntu-22.04") - .acceptLicense(); + .acceptLicense(); private static CompletableFuture MSSQL_CONTAINER_FUTURE = null; @BeforeAll @@ -139,7 +134,7 @@ public static void startContainers() { @AfterAll public static void stopContainers() { Stream.>of(PGSQL_CONTAINER, MYSQL_CONTAINER, MSSQL_CONTAINER) - .parallel() - .forEach(JdbcDatabaseContainer::stop); + .parallel() + .forEach(JdbcDatabaseContainer::stop); } } diff --git a/src/test/java/burp/TestRMLModule.java b/src/test/java/burp/TestRMLModule.java index 971535c..f07caca 100644 --- a/src/test/java/burp/TestRMLModule.java +++ b/src/test/java/burp/TestRMLModule.java @@ -124,7 +124,7 @@ public void testForOK(TestData testData) throws Exception { String resultPath = tempDir.resolve(testData.output1 != null && !testData.output1.isEmpty() ? testData.output1 : "default.nq").toString(); String reportPath = Files.createTempFile("report_" + testData.ID, ".nq").toString(); - String tempMappingPath = tempDir.resolve("mapping.ttl").toString(); + String tempMappingPath = tempDir.resolve(testData.mapping).toString(); int exit = Main.doMain( new String[]{ From 06d6153fde228a02d58eb7e5aff366dec5b651b3 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 11 Jun 2026 15:03:39 +0200 Subject: [PATCH 08/45] Improve parsing and reporting of error in text files, while parsing Turtle and JSONPath. --- pom.xml | 5 + src/main/java/burp/ls/JSONSourceProvider.java | 66 +++-- src/main/java/burp/ls/JSONSourceRFC.java | 234 +++++++++++++----- src/main/java/burp/parse/Parse.java | 36 ++- .../java/burp/parse/turtleprov/ProvStore.java | 12 +- .../parse/turtleprov/ProvTurtleVisitor.java | 66 +++-- .../parse/turtleprov/TurtleProvException.java | 16 ++ .../parse/turtleprov/TurtleProvParser.java | 132 +++++++++- src/main/java/burp/reporting/Errors.java | 29 +-- .../java/burp/reporting/FileGeometry.java | 29 +-- src/main/java/burp/reporting/LiteralPart.java | 19 +- .../reporting/PlainTextReportGenerator.java | 24 +- src/main/java/burp/reporting/PointRange.java | 25 +- .../java/burp/reporting/RDFGraphPointer.java | 2 +- .../burp/reporting/RdfReportGenerator.java | 59 ++++- .../java/burp/reporting/StatementParts.java | 41 +-- .../java/burp/reporting/TextFilePointer.java | 10 +- src/main/resources/vocabularies/ptr.ttl | 148 +++++++++++ .../java/burp/ParseShaclViolationTest.java | 111 +++++++++ .../java/turtleprov/TurtleParserTest.java | 44 +++- 20 files changed, 839 insertions(+), 269 deletions(-) create mode 100644 src/main/java/burp/parse/turtleprov/TurtleProvException.java create mode 100644 src/main/resources/vocabularies/ptr.ttl create mode 100644 src/test/java/burp/ParseShaclViolationTest.java diff --git a/pom.xml b/pom.xml index 4e24674..2f26833 100644 --- a/pom.xml +++ b/pom.xml @@ -477,6 +477,11 @@ jsonpath4k-jvm 3.1.1 + + com.strumenta + antlr-kotlin-runtime-jvm + 1.0.8 + org.jetbrains.kotlinx kotlinx-serialization-json-jvm diff --git a/src/main/java/burp/ls/JSONSourceProvider.java b/src/main/java/burp/ls/JSONSourceProvider.java index 72d3987..0f775a9 100644 --- a/src/main/java/burp/ls/JSONSourceProvider.java +++ b/src/main/java/burp/ls/JSONSourceProvider.java @@ -7,9 +7,7 @@ import burp.model.Iteration; import burp.model.LogicalSource; import burp.model.Reference; -import burp.reporting.BurpException; -import burp.reporting.Origin; -import burp.reporting.RmlError; +import burp.reporting.*; import burp.vocabularies.RER; import burp.vocabularies.RML; import com.google.auto.service.AutoService; @@ -34,6 +32,7 @@ public boolean supports(Resource referenceFormulation) { public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWorkingDirectory) { Resource source = ls.getPropertyResourceValue(RML.source); String iterator = ls.getProperty(RML.iterator).getLiteral().getString(); + var iteratorOrigin = ls.getProperty(RML.iterator); FileBaseSourceProvider.FileAndOrigin fileAndOrigin = FileBaseSourceProvider.getFile(source, mappingDirectory, currentWorkingDirectory); @@ -41,6 +40,7 @@ public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWork jsonSource.file = fileAndOrigin.file; jsonSource.fileOriginStmts = fileAndOrigin.origin; jsonSource.iterator = iterator; + jsonSource.iteratorOrigin = StatementParts.from(iteratorOrigin, StatementPart.Object); jsonSource.encoding = FileBaseSourceProvider.getEncoding(source); jsonSource.compression = FileBaseSourceProvider.getCompression(source); jsonSource.getNulls().addAll(FileBaseSourceProvider.getNullValues(source)); @@ -50,18 +50,19 @@ public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWork @Override public List parseStringPayload(String payload, String iterator, Origin referenceFormulationOrigin) { + CapturingErrorListener listener = new CapturingErrorListener(); try { JsonElement jsonContent = Json.Default.parseToJsonElement(payload); if (iterator == null) { throw new BurpException( - new RmlError( - "Iterator is null", referenceFormulationOrigin, - RER.MappingError - ) + new RmlError( + "Iterator is null", referenceFormulationOrigin, + RER.MappingError + ) ); } JsonPath jsonPath = new JsonPath( - iterator, new AntlrJsonPathCompiler(), s -> null + iterator, new AntlrJsonPathCompiler(listener), s -> null ); List results = jsonPath.query(jsonContent); List iterationList = new ArrayList<>(); @@ -71,29 +72,50 @@ iterator, new AntlrJsonPathCompiler(), s -> null return iterationList; } catch (Exception e) { if (e instanceof BurpException) throw (BurpException) e; - if (e instanceof JsonPathCompilerException || e instanceof IllegalArgumentException) { + if (e instanceof JsonPathCompilerException || e instanceof IllegalArgumentException || e.getCause() instanceof JsonPathCompilerException) { + if (!listener.getErrors().isEmpty()) { + JSONPathError firstError = listener.getErrors().get(0); + LiteralPart literalPart = null; + if (referenceFormulationOrigin != null && referenceFormulationOrigin.sourceStatements() != null && !referenceFormulationOrigin.sourceStatements().isEmpty()) { + RDFPointer first = referenceFormulationOrigin.sourceStatements().get(0); + if (first instanceof LiteralPart lp) { + literalPart = lp; + } + } + Origin errOrigin = referenceFormulationOrigin; + if (literalPart != null && firstError.start() != null) { + PointRange newRange = literalPart.objectRange().plus(new PointRange(firstError.start())); + errOrigin = new Origin(referenceFormulationOrigin.planNode(), Collections.singletonList(new LiteralPart(literalPart.stmt(), newRange))); + } + String displayMsg = "Syntax error in JSONPath `" + iterator + "`"; + if (firstError.start() != null) { + displayMsg += " at " + firstError.start().getDisplayLine() + ":" + firstError.start().getDisplayColumn(); + } + displayMsg += ": " + firstError.message(); + throw new BurpException(new RmlError(displayMsg, errOrigin, RER.ReferenceFormulationSyntaxError, e)); + } throw new BurpException( - new RmlError( - "Syntax error in JSONPath `" + iterator + "`", - referenceFormulationOrigin, - RER.ReferenceFormulationSyntaxError, - e - ) + new RmlError( + "Syntax error in JSONPath `" + iterator + "`", + referenceFormulationOrigin, + RER.ReferenceFormulationSyntaxError, + e + ) ); } throw new BurpException( - new RmlError( - "Unexpected Error while changing iterator to JSONPath, iteration content " + payload + ".", - referenceFormulationOrigin, - RER.Error, - e - ) + new RmlError( + "Unexpected Error while changing iterator to JSONPath, iteration content " + payload + ".", + referenceFormulationOrigin, + RER.Error, + e + ) ); } } @Override public Reference buildReference(String reference, Origin origin, Origin referenceFormulationOrigin) { - return new JSONPathReference(reference, origin); + return new JSONPathReference(reference, referenceFormulationOrigin); } } diff --git a/src/main/java/burp/ls/JSONSourceRFC.java b/src/main/java/burp/ls/JSONSourceRFC.java index f525e02..cc1a1c4 100644 --- a/src/main/java/burp/ls/JSONSourceRFC.java +++ b/src/main/java/burp/ls/JSONSourceRFC.java @@ -1,31 +1,39 @@ package burp.ls; import at.asitplus.jsonpath.JsonPath; -import at.asitplus.jsonpath.core.JsonPathCompilerException; -import at.asitplus.jsonpath.core.JsonPathQueryException; +import at.asitplus.jsonpath.core.JsonPathFilterExpressionType; +import at.asitplus.jsonpath.core.JsonPathFunctionExtension; import at.asitplus.jsonpath.core.NodeListEntry; import at.asitplus.jsonpath.implementation.AntlrJsonPathCompiler; +import at.asitplus.jsonpath.implementation.AntlrJsonPathCompilerErrorListener; import burp.model.Iteration; +import burp.model.PlanNode; import burp.model.Reference; -import burp.reporting.BurpException; -import burp.reporting.Origin; -import burp.reporting.RmlError; +import burp.parse.turtleprov.Point; +import burp.reporting.*; import burp.vocabularies.RER; import burp.vocabularies.RML; +import kotlin.Pair; import kotlinx.serialization.json.*; +import org.antlr.v4.kotlinruntime.Parser; +import org.antlr.v4.kotlinruntime.RecognitionException; +import org.antlr.v4.kotlinruntime.Recognizer; +import org.antlr.v4.kotlinruntime.atn.ATNConfigSet; +import org.antlr.v4.kotlinruntime.dfa.DFA; import org.apache.jena.rdf.model.Resource; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; +import java.util.*; + +import static java.util.Arrays.stream; +import static java.util.stream.Collectors.joining; public class JSONSourceRFC extends FileBasedLogicalSource { public String iterator; - public Origin iteratorOrigin; - - + public StatementParts iteratorOrigin; @Override public Iterable iterator() { @@ -41,7 +49,18 @@ public Iterable iterator() { JsonElement jsonContent = Json.Default.parseToJsonElement(jsonString); - JsonPath jsonPath = new JsonPath(iterator, new AntlrJsonPathCompiler(), JsonPath.Companion.getDefaultFunctionExtensionRepository()::getExtension); + CapturingErrorListener listener = new CapturingErrorListener(); + JsonPath jsonPath; + try { + jsonPath = new JsonPath(iterator, new AntlrJsonPathCompiler(listener), JsonPath.Companion.getDefaultFunctionExtensionRepository()::getExtension); + } catch (Exception e) { + if (!listener.getErrors().isEmpty()) { + JSONPathError firstError = listener.getErrors().getFirst(); + RmlError rmlError = firstError.getRmlError(e, iterator, iteratorOrigin, this); + throw new BurpException(rmlError); + } + throw e; + } List results = jsonPath.query(jsonContent); List iterationList = new ArrayList<>(); @@ -52,16 +71,7 @@ public Iterable iterator() { } catch (BurpException burpException) { throw burpException; } catch (Exception exception) { - String exName = exception.getClass().getName(); - if (exName.equals("at.asitplus.jsonpath.core.JsonPathCompilerException") || - exName.equals("at.asitplus.jsonpath.implementation.JsonPathParserException") || - exception.getCause() != null && ( - exception.getCause().getClass().getName().equals("at.asitplus.jsonpath.core.JsonPathCompilerException") || - exception.getCause().getClass().getName().equals("at.asitplus.jsonpath.implementation.JsonPathParserException") - )) { - throw new BurpException(new RmlError("Syntax error in JSONPath iterator.", new Origin(this, null), RER.ReferenceFormulationSyntaxError, exception, null)); - } - throw new BurpException(new RmlError("Error in JSON preparation of iterator.", new Origin(this, null), RER.LogicalSourceError, exception, null)); + throw new BurpException(new RmlError("Error in JSON preparation of iterator.", new Origin(this, List.of(iteratorOrigin)), RER.LogicalSourceError, exception, null)); } } @@ -74,7 +84,6 @@ public Resource getReferenceFormulation() { public Reference buildExportedReference(String reference, Origin origin) { return new JSONPathReference(reference, origin); } - } class JSONPathReference extends Reference { @@ -83,18 +92,21 @@ class JSONPathReference extends Reference { public JSONPathReference(String reference, Origin origin) { super(reference, origin); JsonPath cp = null; + CapturingErrorListener listener = new CapturingErrorListener(); try { if (reference != null) { - cp = new JsonPath(reference, new AntlrJsonPathCompiler(), JsonPath.Companion.getDefaultFunctionExtensionRepository()::getExtension); + cp = new JsonPath(reference, new AntlrJsonPathCompiler(listener), JsonPath.Companion.getDefaultFunctionExtensionRepository()::getExtension); } + } catch (BurpException be) { + throw be; } catch (Exception ex) { - if (ex instanceof JsonPathCompilerException) { - throw new BurpException(new RmlError("Syntax error in JSONPath `" + reference + "`", origin, RER.ReferenceFormulationSyntaxError, ex)); - } else if (ex instanceof BurpException burpException) { - throw burpException; - } else { - throw new BurpException(new RmlError("Unexpected Error in JSONPath preprocessing.", origin, RER.Error, ex)); + if (!listener.getErrors().isEmpty()) { + JSONPathError firstError = listener.getErrors().getFirst(); + RDFGraphPointer rdfPointer = origin.sourceStatements().stream().map(it -> it instanceof RDFGraphPointer gp ? gp : null).filter(Objects::nonNull).findFirst().orElseGet(null); + var error = firstError.getRmlError(ex, reference, rdfPointer, this); + throw new BurpException(error); } + throw new BurpException(new RmlError("Unexpected Error in JSONPath preprocessing.", origin, RER.Error, ex)); } this.compiledPath = cp; } @@ -112,58 +124,45 @@ public List getValues(Iteration i) { for (NodeListEntry entry : entries) { JsonElement jsonElement = entry.getValue(); switch (jsonElement) { - case JsonArray jsonElements -> throw new BurpException( - new RmlError( - "Data error: reference retrieved an array with `" + reference + "`", - origin, - RER.ReferenceFormulationExecutionError - ) - ); + case JsonArray jsonElements -> + // TODO In the future we may want to support cdt:List and cdt:Map. + throw new BurpException(new RmlError("Data error: reference retrieved an array with `" + reference + "`", origin, RER.ReferenceFormulationExecutionError)); case JsonObject jsonObject -> resultList.add(jsonElement.toString()); case JsonNull jsonNull -> { // ignore nulls } case JsonPrimitive p -> { - Object content; - if (p.isString()) { - content = p.getContent(); - } else { - String strContent = p.getContent(); - try { - if (strContent.contains(".")) { - content = Double.parseDouble(strContent); - } else if (strContent.equalsIgnoreCase("true") || strContent.equalsIgnoreCase("false")) { - content = Boolean.parseBoolean(strContent); - } else { - content = Long.parseLong(strContent); - } - } catch (NumberFormatException ignored) { - content = strContent; - } - } - if (!jsonIteration.getNulls().contains(content)) { - resultList.add(content); - } + Object content = parseJsonPrimitive(p); + if (!jsonIteration.getNulls().contains(content)) resultList.add(content); } default -> { } } } + } catch (BurpException ex) { + throw ex; } catch (Exception ex) { - if (ex instanceof JsonPathQueryException) { - throw new BurpException( - new RmlError( - "Execution error in JSONPath `" + reference + "`", origin, RER.ReferenceFormulationExecutionError, ex - ) - ); - } else if (ex instanceof BurpException) { - throw (BurpException) ex; - } else { - throw new BurpException(new RmlError("Unexpected Error", origin, RER.Error, ex)); - } + throw new BurpException(new RmlError("Unexpected Error in JSONPath evaluation.", origin, RER.ReferenceFormulationExecutionError, ex)); } return resultList; } + + public static Object parseJsonPrimitive(JsonPrimitive p) { + if (p.isString()) { + return p.getContent(); + } else if (JsonElementKt.getIntOrNull(p) != null) { + return JsonElementKt.getInt(p); + } else if (JsonElementKt.getLongOrNull(p) != null) { + return JsonElementKt.getLong(p); + } else if (JsonElementKt.getFloatOrNull(p) != null) { + return JsonElementKt.getFloat(p); + } else if (JsonElementKt.getDoubleOrNull(p) != null) { + return JsonElementKt.getDouble(p); + } else if (JsonElementKt.getBooleanOrNull(p) != null) { + return JsonElementKt.getBoolean(p); + } + return null; + } } class JSONIteration extends Iteration { @@ -180,4 +179,103 @@ public String asString() { } } +record JSONPathError(@Nullable Point start, @NonNull String message, boolean isSyntaxError) { + @NonNull RmlError getRmlError(@NonNull Exception compilerException, @Nullable String jsonPath, @NonNull RDFGraphPointer jsonPathPtr, @NonNull PlanNode planNode) { + Origin origin = new Origin(planNode, List.of(jsonPathPtr)); + if (start != null) { + LiteralPart literalPart; + switch (jsonPathPtr) { + case LiteralPart lp -> literalPart = lp; + case StatementParts sp -> literalPart = sp.toLiteralPart(); + default -> literalPart = null; + } + + if (literalPart != null) { + PointRange newRange = literalPart.objectRange().plus(new PointRange(start)); + var newRangeLiteralPart = new LiteralPart(literalPart.stmt(), newRange); + origin = new Origin(planNode, List.of(newRangeLiteralPart)); + } + } + + return new RmlError( + message, + origin, + isSyntaxError ? RER.ReferenceFormulationSyntaxError : RER.ReferenceFormulationExecutionError, + compilerException, + null + ); + } +} + +class CapturingErrorListener implements AntlrJsonPathCompilerErrorListener { + private final List errors = new ArrayList<>(); + + public List getErrors() { + return errors; + } + + @Override + public void unknownFunctionExtension(@NonNull String functionExtensionName) { + errors.add(new JSONPathError(null, "Unknown JSONPath function extension: \"" + functionExtensionName + "\"", false)); + } + + @Override + public void invalidFunctionExtensionForTestExpression(@NonNull String functionExtensionName) { + errors.add(new JSONPathError(null, "Invalid JSONPath function extension return type for test expression: \"" + functionExtensionName + "\"", false)); + } + + @Override + public void invalidFunctionExtensionForComparable(@NonNull String functionExtensionName) { + errors.add(new JSONPathError(null, "Invalid JSONPath function extension return type for comparable expression: \"" + functionExtensionName + "\"", false)); + } + + @Override + public void invalidArglistForFunctionExtension( + @NonNull String functionExtensionName, + @NonNull JsonPathFunctionExtension functionExtensionImplementation, + @NonNull List> coercedArgumentTypes + ) { + List firsts = new ArrayList<>(); + List seconds = new ArrayList<>(); + for (Object obj : coercedArgumentTypes) { + if (obj instanceof Pair pair) { + firsts.add(String.valueOf(pair.getFirst())); + seconds.add(String.valueOf(pair.getSecond())); + } + } + String expected = stream(functionExtensionImplementation.getArgumentTypes()) + .map(String::valueOf) + .collect(joining(", ")); + String receivedFirst = String.join(", ", firsts); + String receivedSecond = String.join(", ", seconds); + String msg = "Invalid arguments for function extension \"" + functionExtensionName + "\": Expected: <" + expected + ">, but received <" + receivedFirst + ">: <" + receivedSecond + ">"; + errors.add(new JSONPathError(null, msg, false)); + } + + + @Override + public void invalidTestExpression(@NonNull String testContextString) { + errors.add(new JSONPathError(null, "Invalid test expression: " + testContextString, false)); + } + + @Override + public void syntaxError(@NonNull Recognizer recognizer, @Nullable Object offendingSymbol, int line, int charPositionInLine, @NonNull String msg, @Nullable RecognitionException e) { + errors.add(new JSONPathError(new Point(line - 1, charPositionInLine), msg, true)); + } + + @Override + public void reportAmbiguity(@NonNull Parser recognizer, @NonNull DFA dfa, int startIndex, int stopIndex, boolean exact, @NonNull BitSet ambigAlts, @NonNull ATNConfigSet configs) { + // noop + } + + @Override + public void reportAttemptingFullContext(@NonNull Parser recognizer, @NonNull DFA dfa, int startIndex, int stopIndex, @NonNull BitSet ambigAlts, @NonNull ATNConfigSet configs) { + // noop + } + + @Override + public void reportContextSensitivity(@NonNull Parser recognizer, @NonNull DFA dfa, int startIndex, int stopIndex, int i2, @NonNull ATNConfigSet configs) { + // noop + } +} diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index c594763..f306f28 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -14,17 +14,11 @@ import burp.model.rdf.LiteralTerm; import burp.model.rdf.Term; import burp.parse.turtleprov.ProvStore; -import burp.parse.turtleprov.ProvTurtleVisitor; import burp.parse.turtleprov.RDF12Converter; -import burp.reporting.BurpException; -import burp.reporting.Origin; -import burp.reporting.RmlError; -import burp.reporting.StatementParts; +import burp.parse.turtleprov.TurtleProvParser; +import burp.reporting.*; import burp.vocabularies.RER; import burp.vocabularies.RML; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.CharStreams; -import org.antlr.v4.runtime.CommonTokenStream; import org.apache.jena.graph.Node; import org.apache.jena.query.Dataset; import org.apache.jena.query.DatasetFactory; @@ -57,18 +51,22 @@ public class Parse { private Path mappingFile = null; private Path currentDirectory = null; private Model mapping = null; - private BurpParserError parserError = null; + private ProvStore provStore = null; private Dataset parseTurtleFromFile(Path turtleFile) throws Exception { - CharStream input = CharStreams.fromPath(turtleFile); - TurtleLexer lexer = new TurtleLexer(input); - CommonTokenStream tokens = new CommonTokenStream(lexer); - TurtleParser parser = new TurtleParser(tokens); - parserError = new BurpParserError(); - parser.addErrorListener(parserError); - ProvTurtleVisitor visitor = new ProvTurtleVisitor(); - ProvStore store = visitor.visitTurtleDoc(parser.turtleDoc()); - Model m = RDF12Converter.toModel(store); + provStore = TurtleProvParser.parseTurtleFromPath(turtleFile); + if (!provStore.getSyntaxErrors().isEmpty()) { + var rmlSyntaxError = provStore.getSyntaxErrors().stream().map(error -> { + TextFilePointer tfp = new TextFilePointer(turtleFile, error.range); + Origin origin = new Origin(null, List.of(tfp)); + return new RmlError(error.message, origin, RER.RDFMappingSyntaxError); + }).toList(); + if (Main.report != null) { + Main.report.getErrors().addAll(rmlSyntaxError); + } + throw new BurpException(rmlSyntaxError.getFirst()); + } + Model m = RDF12Converter.toModel(provStore); return DatasetFactory.create(m); } @@ -717,7 +715,7 @@ public List extractStatementsFromShaclViolation(ReportEntry vr, mapping.listStatements(focusResource, null, valueNode).forEachRemaining(stmt -> results.add(StatementParts.from(stmt, Subject))); mapping.listStatements(null, null, focusResource).forEachRemaining(stmt -> { - boolean contains = results.stream().anyMatch(it -> it.getStmt().equals(stmt)); + boolean contains = results.stream().anyMatch(it -> it.stmt().equals(stmt)); if (!contains) { results.add(StatementParts.from(stmt, Object)); } diff --git a/src/main/java/burp/parse/turtleprov/ProvStore.java b/src/main/java/burp/parse/turtleprov/ProvStore.java index 6b7d89d..a14a888 100644 --- a/src/main/java/burp/parse/turtleprov/ProvStore.java +++ b/src/main/java/burp/parse/turtleprov/ProvStore.java @@ -1,5 +1,8 @@ package burp.parse.turtleprov; +import burp.reporting.PointRange; +import org.jetbrains.annotations.NotNull; + import java.util.*; public class ProvStore { @@ -15,6 +18,7 @@ public Map getPrefixes() { return prefixes; } + @NotNull public List getSyntaxErrors() { return syntaxErrors; } @@ -24,12 +28,18 @@ public static class SyntaxError { public final int charPositionInLine; public final String message; public final String offendingSymbol; + public final PointRange range; - public SyntaxError(int line, int charPositionInLine, String message, String offendingSymbol) { + public SyntaxError(int line, int charPositionInLine, String message, String offendingSymbol, PointRange range) { this.line = line; this.charPositionInLine = charPositionInLine; this.message = message; this.offendingSymbol = offendingSymbol; + this.range = range; + } + + public SyntaxError(int line, int charPositionInLine, String message, String offendingSymbol) { + this(line, charPositionInLine, message, offendingSymbol, null); } @Override diff --git a/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java index 16fcd22..5eb01fc 100644 --- a/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java +++ b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java @@ -4,6 +4,7 @@ import burp.reporting.PointRange; import burp.reporting.RDFGraphPointer; import burp.reporting.StatementParts; +import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.TerminalNode; import org.apache.jena.rdf.model.*; @@ -24,28 +25,28 @@ public static List retrieveTurtleLocation(Object o) { List locations = new ArrayList<>(); for (Object item : sourceStatements) { if (item instanceof RDFGraphPointer gp) { - var stmt = gp.getStmt(); + var stmt = gp.stmt(); if (stmt == null || stmt.getModel() == null) { continue; } var infos = RDF12Converter.fromAnnotations(stmt, stmt.getModel()); if (gp instanceof StatementParts sp) { - if (sp.isSubject() && infos.subjectInfo != null && infos.subjectInfo.start() != null) { + if (sp.subject() && infos.subjectInfo != null && infos.subjectInfo.start() != null) { locations.add(new PointRange(infos.subjectInfo.start(), infos.subjectInfo.end())); } - if (sp.isPredicate() && infos.predicateInfo != null && infos.predicateInfo.start() != null) { + if (sp.predicate() && infos.predicateInfo != null && infos.predicateInfo.start() != null) { locations.add(new PointRange(infos.predicateInfo.start(), infos.predicateInfo.end())); } - if (sp.isObject() && infos.objectInfo != null && infos.objectInfo.start() != null) { + if (sp.object() && infos.objectInfo != null && infos.objectInfo.start() != null) { locations.add(new PointRange(infos.objectInfo.start(), infos.objectInfo.end())); } } else if (gp instanceof LiteralPart lp) { if (infos.objectInfo != null) { var info = infos.objectInfo; - Point literalEnd = lp.getObjectRange().getEnd(); + Point literalEnd = lp.objectRange().end(); Point startPt = info.rdfLiteralStringStart(); Point endPt = info.rdfLiteralStringEnd(); - Point newStart = startPt != null ? startPt.plus(lp.getObjectRange().getStart()) : null; + Point newStart = startPt != null ? startPt.plus(lp.objectRange().start()) : null; Point newEnd = (startPt != null && literalEnd != null) ? startPt.plus(literalEnd) : endPt; if (newStart != null && newEnd != null) { locations.add(new PointRange(newStart, newEnd)); @@ -97,9 +98,21 @@ private Point getEndPoint(Token token) { return new Point(endLine, endCol); } - @Override - protected Object defaultResult() { - return null; + private PointRange getRange(ParserRuleContext ctx) { + if (ctx == null || ctx.getStart() == null) return null; + Point start = getStartPoint(ctx.getStart()); + Point end = ctx.getStop() != null ? getEndPoint(ctx.getStop()) : getEndPoint(ctx.getStart()); + return new PointRange(start, end); + } + + private PointRange getRange(Token token) { + if (token == null) return null; + return new PointRange(getStartPoint(token), getEndPoint(token)); + } + + private PointRange getRange(TerminalNode node) { + if (node == null || node.getSymbol() == null) return null; + return getRange(node.getSymbol()); } @Override @@ -123,10 +136,10 @@ public Object visitStatement(TurtleParser.StatementContext ctx) { return null; } - public Object makeRegisterPrefix(TerminalNode prefix, TerminalNode iriref, boolean isSparql) { + public Object makeRegisterPrefix(TerminalNode prefix, TerminalNode iriRef, boolean isSparql) { String prefixText = prefix.getText(); String prefixNs = prefixText.substring(0, prefixText.length() - 1); - String iriText = iriref.getText(); + String iriText = iriRef.getText(); String iri = iriText.substring(1, iriText.length() - 1); store.getPrefixes().put(prefixNs, iri); return null; @@ -139,7 +152,7 @@ public Object visitPrefixID(TurtleParser.PrefixIDContext ctx) { @Override public Object visitSparqlPrefix(TurtleParser.SparqlPrefixContext ctx) { - return makeRegisterPrefix(ctx.PNAME_NS(), ctx.IRIREF(), false); + return makeRegisterPrefix(ctx.PNAME_NS(), ctx.IRIREF(), true); } @Override @@ -176,7 +189,7 @@ public Object visitSubject(TurtleParser.SubjectContext ctx) { if (ctx.iri() != null) return visitIri(ctx.iri()); if (ctx.BlankNode() != null) return visitBlankNodeTerminal(ctx.BlankNode()); if (ctx.collection() != null) return visitCollection(ctx.collection()); - throw new IllegalArgumentException("Unknown subject type"); + throw new TurtleProvException("Unknown subject type", getRange(ctx)); } @Override @@ -205,15 +218,15 @@ public Object visitIri(TurtleParser.IriContext ctx) { String prefix = match.group(1) != null ? match.group(1) : ""; String localName = match.group(2); String namespace = store.getPrefixes().get(prefix); - if (namespace == null) throw new IllegalArgumentException("Unknown prefix: " + prefix); + if (namespace == null) throw new TurtleProvException("Unknown prefix: " + prefix, getRange(token)); Resource resource = ResourceFactory.createResource(namespace + localName); NodeInfo nodeInfo = new NodeInfo(TurtleNodeKind.PREFIXED_NAME, getStartPoint(token), getEndPoint(token), null); return new Pair<>(resource, nodeInfo); } else { - throw new IllegalArgumentException("Invalid prefixed name: " + prefixedName); + throw new TurtleProvException("Invalid prefixed name: " + prefixedName, getRange(token)); } } else { - throw new IllegalArgumentException("Unknown IRI type"); + throw new TurtleProvException("Unknown IRI type", getRange(ctx)); } } @@ -232,7 +245,7 @@ private Pair visitBlankNodeTerminal(TerminalNode terminalNod ); return new Pair<>(resource, nodeInfo); } else { - throw new IllegalArgumentException("Invalid blank node label: " + text); + throw new TurtleProvException("Invalid blank node label: " + text, getRange(token)); } } else if (text.startsWith("[") && text.endsWith("]")) { Resource resource = createBlankNode(); @@ -242,13 +255,13 @@ private Pair visitBlankNodeTerminal(TerminalNode terminalNod ); return new Pair<>(resource, nodeInfo); } else { - throw new IllegalArgumentException("Unknown blank node format: " + text); + throw new TurtleProvException("Unknown blank node format: " + text, getRange(token)); } } public Resource assembleList(List list) { if (list.isEmpty()) { - return (Resource) RDF.nil; + return RDF.nil; } else { List blankNodes = new ArrayList<>(list.size()); for (int i = 0; i < list.size(); i++) { @@ -265,8 +278,8 @@ public Resource assembleList(List list) { Resource next = blankNodes.get(i + 1); store.getTriples().add(new ProvTriple(model.createStatement(current, RDF.rest, next))); } - store.getTriples().add(new ProvTriple(model.createStatement(blankNodes.get(blankNodes.size() - 1), RDF.rest, (Resource) RDF.nil))); - return blankNodes.get(0); + store.getTriples().add(new ProvTriple(model.createStatement(blankNodes.getLast(), RDF.rest, (Resource) RDF.nil))); + return blankNodes.getFirst(); } } @@ -336,7 +349,7 @@ public Object visitVerb(TurtleParser.VerbContext ctx) { ); return new Pair<>(RDF.type, nodeInfo); } else { - throw new IllegalArgumentException("Unknown verb type: " + ctx.getText()); + throw new TurtleProvException("Unknown verb type: " + ctx.getText(), getRange(ctx)); } } @@ -351,16 +364,15 @@ public Object visitObjectList(TurtleParser.ObjectListContext ctx) { } @Override - @SuppressWarnings("unchecked") public Object visitObject_(TurtleParser.Object_Context ctx) { if (ctx.iri() != null) return visitIri(ctx.iri()); if (ctx.BlankNode() != null) return visitBlankNodeTerminal(ctx.BlankNode()); if (ctx.collection() != null) return visitCollection(ctx.collection()); if (ctx.blankNodePropertyList() != null) return visitBlankNodePropertyList(ctx.blankNodePropertyList()); if (ctx.literal() != null) return visitLiteral(ctx.literal()); - if (ctx.tripleTerm() != null) throw new UnsupportedOperationException("RDF-star / RDF 1.2 triple terms are not supported"); - if (ctx.reifiedTriple() != null) throw new UnsupportedOperationException("RDF-star / RDF 1.2 reified triples are not supported"); - throw new IllegalArgumentException("Unknown object type: " + ctx.getText()); + if (ctx.tripleTerm() != null) throw new TurtleProvException("RDF-star / RDF 1.2 triple terms are not supported", getRange(ctx)); + if (ctx.reifiedTriple() != null) throw new TurtleProvException("RDF-star / RDF 1.2 reified triples are not supported", getRange(ctx)); + throw new TurtleProvException("Unknown object type: " + ctx.getText(), getRange(ctx)); } @Override @@ -368,7 +380,7 @@ public Object visitLiteral(TurtleParser.LiteralContext ctx) { if (ctx.rdfLiteral() != null) return visitRdfLiteral(ctx.rdfLiteral()); if (ctx.NumericLiteral() != null) return visitNumericLiteral(ctx.NumericLiteral()); if (ctx.BooleanLiteral() != null) return visitBooleanLiteral(ctx.BooleanLiteral()); - throw new IllegalArgumentException("Unknown literal type"); + throw new TurtleProvException("Unknown literal type", getRange(ctx)); } @Override diff --git a/src/main/java/burp/parse/turtleprov/TurtleProvException.java b/src/main/java/burp/parse/turtleprov/TurtleProvException.java new file mode 100644 index 0000000..a7ead9c --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/TurtleProvException.java @@ -0,0 +1,16 @@ +package burp.parse.turtleprov; + +import burp.reporting.PointRange; + +public class TurtleProvException extends RuntimeException { + private final PointRange range; + + public TurtleProvException(String message, PointRange range) { + super(message); + this.range = range; + } + + public PointRange getRange() { + return range; + } +} diff --git a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java index e000698..3d0e1fd 100644 --- a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java +++ b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java @@ -1,47 +1,157 @@ package burp.parse.turtleprov; +import burp.reporting.PointRange; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; public class TurtleProvParser { - + public static ProvStore parseTurtleFromString(String turtleContent) { CharStream input = CharStreams.fromString(turtleContent); + return parse(input); + } + + public static ProvStore parseTurtleFromPath(Path path) throws IOException { + CharStream input = CharStreams.fromPath(path); + return parse(input); + } + + public static ProvStore parseTurtleFromStream(InputStream stream) throws IOException { + CharStream input = CharStreams.fromStream(stream); + return parse(input); + } + + private static ProvStore parse(CharStream input) { TurtleLexer lexer = new TurtleLexer(input); - List syntaxErrors = new ArrayList<>(); - + + final String fullText = input.size() > 0 ? input.getText(org.antlr.v4.runtime.misc.Interval.of(0, input.size() - 1)) : ""; + BaseErrorListener errorListener = new BaseErrorListener() { @Override public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) { - String symbolText = offendingSymbol != null ? offendingSymbol.toString() : ""; - syntaxErrors.add(new ProvStore.SyntaxError(line, charPositionInLine, msg, symbolText)); + String symbolText = ""; + PointRange range = null; + boolean hasOffendingSymbol = false; + + if (offendingSymbol instanceof Token token) { + symbolText = token.getText(); + if (symbolText != null && !symbolText.isEmpty() && token.getType() != Token.EOF) { + hasOffendingSymbol = true; + } + } else if (offendingSymbol != null) { + symbolText = offendingSymbol.toString(); + if (!symbolText.isEmpty() && !symbolText.equals("")) { + hasOffendingSymbol = true; + } + } + + if (hasOffendingSymbol) { + int len = symbolText.length(); + int startLine = (offendingSymbol instanceof Token token) ? token.getLine() - 1 : line - 1; + int startCol = (offendingSymbol instanceof Token token) ? token.getCharPositionInLine() : charPositionInLine; + range = new PointRange( + new Point(startLine, startCol), + new Point(startLine, startCol + len) + ); + } else { + // FIXME Improve the detection of the end of the token when having a token recognition error at:'...' + // It should surely be possible to have that token length data from somewhere else than parsing the anltr message. + String quotedText = extractQuotedText(msg); + if (!quotedText.isEmpty() && !quotedText.equals("")) { + int len = quotedText.length(); + range = new PointRange( + new Point(line - 1, charPositionInLine), + new Point(line - 1, charPositionInLine + len) + ); + } else { + int startOffset = (offendingSymbol instanceof Token token) ? token.getStartIndex() : getOffsetOfLineAndColumn(fullText, line, charPositionInLine); + int len = getLengthToLineEnd(fullText, startOffset); + range = new PointRange( + new Point(line - 1, charPositionInLine), + new Point(line - 1, charPositionInLine + len) + ); + } + } + syntaxErrors.add(new ProvStore.SyntaxError(line, charPositionInLine, msg, symbolText, range)); } }; lexer.removeErrorListeners(); lexer.addErrorListener(errorListener); - + CommonTokenStream tokens = new CommonTokenStream(lexer); TurtleParser parser = new TurtleParser(tokens); - + parser.removeErrorListeners(); parser.addErrorListener(errorListener); - + ProvTurtleVisitor visitor = new ProvTurtleVisitor(); - ProvStore store = null; + ProvStore store; try { - store = (ProvStore) visitor.visitTurtleDoc(parser.turtleDoc()); + store = visitor.visitTurtleDoc(parser.turtleDoc()); + } catch (TurtleProvException e) { + int line = e.getRange() != null && e.getRange().start() != null ? e.getRange().start().line + 1 : 0; + int col = e.getRange() != null && e.getRange().start() != null ? e.getRange().start().column : 0; + syntaxErrors.add(new ProvStore.SyntaxError(line, col, e.getMessage(), "AST Traversal", e.getRange())); + store = visitor.getStore(); } catch (Exception e) { // AST traversal failed due to missing nodes or unsupported constructs syntaxErrors.add(new ProvStore.SyntaxError(0, 0, e.getMessage(), "AST Traversal")); store = visitor.getStore(); } - + if (store == null) { store = new ProvStore(); } store.syntaxErrors.addAll(syntaxErrors); return store; } + private static int getOffsetOfLineAndColumn(String text, int targetLine, int targetCol) { + int currentLine = 1; + int currentCol = 0; + for (int i = 0; i < text.length(); i++) { + if (currentLine == targetLine && currentCol == targetCol) { + return i; + } + char c = text.charAt(i); + if (c == '\n') { + currentLine++; + currentCol = 0; + } else { + currentCol++; + } + } + return -1; + } + + private static int getLengthToLineEnd(String text, int startOffset) { + if (startOffset < 0 || startOffset >= text.length()) { + return 1; + } + int len = 0; + for (int i = startOffset; i < text.length(); i++) { + char c = text.charAt(i); + if (c == '\n' || c == '\r') { + break; + } + len++; + } + return len > 0 ? len : 1; + } + private static String extractQuotedText(String msg) { + if (msg == null) return ""; + int firstQuote = msg.indexOf('\''); + if (firstQuote >= 0) { + int secondQuote = msg.indexOf('\'', firstQuote + 1); + if (secondQuote > firstQuote) { + return msg.substring(firstQuote + 1, secondQuote); + } + } + return ""; + } } diff --git a/src/main/java/burp/reporting/Errors.java b/src/main/java/burp/reporting/Errors.java index d4c0a53..c90bbdc 100644 --- a/src/main/java/burp/reporting/Errors.java +++ b/src/main/java/burp/reporting/Errors.java @@ -2,20 +2,18 @@ import burp.model.PlanNode; import burp.vocabularies.RER; -import org.apache.jena.ontology.OntClass; import java.nio.file.Path; -import java.util.function.Consumer; public class Errors { public static String fileLocationString(Path file, PointRange location) { String locationStr = ""; if (location != null) { - String start = location.getStart().getDisplayLine() + ":" + location.getStart().getDisplayColumn(); + String start = location.start().getDisplayLine() + ":" + location.start().getDisplayColumn(); String end = null; - if (location.getEnd() != null) { - end = location.getEnd().getDisplayLine() + ":" + location.getEnd().getDisplayColumn(); + if (location.end() != null) { + end = location.end().getDisplayLine() + ":" + location.end().getDisplayColumn(); } locationStr = (end != null) ? start + "-" + end : start; } @@ -23,20 +21,6 @@ public static String fileLocationString(Path file, PointRange location) { return !locationStr.isEmpty() ? file.toString() + ":" + locationStr : file.toString(); } - public static RmlError rmlError(OntClass errorType, Consumer init) { - RmlErrorBuilder builder = new RmlErrorBuilder(errorType); - init.accept(builder); - return builder.build(); - } - - public static RmlError SourceAccessError(String message, Origin info, Exception ex) { - return new RmlError(message, info, RER.SourceAccessError, ex); - } - - public static RmlError InvalidRDF(String message, Origin info, OntClass type) { - return new RmlError(message, info, type); - } - public static RmlError ReferenceFormulationSyntaxError(String message, Origin info) { return new RmlError(message, info, RER.ReferenceFormulationSyntaxError); } @@ -45,13 +29,6 @@ public static RmlError ReferenceFormulationExecutionError(String message, PlanNo return new RmlError(message, new Origin(planNode, null), RER.ReferenceFormulationExecutionError); } - public static RmlError RDFMappingSyntaxError(String message, Origin info) { - return new RmlError(message, info, RER.RDFMappingSyntaxError); - } - - public static RmlError UnsupportedMapping(String message, Origin info) { - return new RmlError(message, info, RER.UnsupportedMapping); - } public static RmlError NoTriplesMap() { return new RmlError("No triples map (with rml:logicalSource) found in mapping.", new Origin(), RER.NoTriplesMap); diff --git a/src/main/java/burp/reporting/FileGeometry.java b/src/main/java/burp/reporting/FileGeometry.java index 60eb9a2..260d251 100644 --- a/src/main/java/burp/reporting/FileGeometry.java +++ b/src/main/java/burp/reporting/FileGeometry.java @@ -2,36 +2,37 @@ import java.util.*; -/** - * Converts a list of Nodes (which may span multiple lines) into a map of - * LineIndex -> List. Overlapping ranges are merged. - * - * @return a map from line indexes (0 indexed) to a list of column ranges (also 0-indexed). - */ + public class FileGeometry { public record ColumnRange(int first, int last) { } + /** + * Converts a list of Nodes (which may span multiple lines) into a map of + * LineIndex -> List. Overlapping ranges are merged. + * + * @return a map from line indexes (0 indexed) to a list of column ranges (also 0-indexed). + */ public static Map> getMergedHighlights(List nodes, List lines) { Map> rawMap = new HashMap<>(); // 1. Flatten Nodes into raw line ranges for (PointRange node : nodes) { - if (node.getEnd() == null) continue; + if (node.end() == null) continue; - int startLine = Math.max(node.getStart().line(), 0); - int endLine = Math.min(node.getEnd().line(), lines.size() - 1); + int startLine = Math.max(node.start().line(), 0); + int endLine = Math.min(node.end().line(), lines.size() - 1); for (int lineIdx = startLine; lineIdx <= endLine; lineIdx++) { int lineLen = lines.get(lineIdx).length(); - int startCol = (lineIdx == startLine) ? node.getStart().column() : 0; - int endCol = (lineIdx == endLine) ? node.getEnd().column() : lineLen; // Go to end of line if multi-line + int startCol = (lineIdx == startLine) ? node.start().column() : 0; + int endCol = (lineIdx == endLine) ? node.end().column() : lineLen; // Go to end of line if multi-line // Ensure we don't go out of bounds - int safeStart = Math.max(0, Math.min(startCol, lineLen)); - int safeEnd = Math.max(0, Math.min(endCol, lineLen)); + int safeStart = Math.clamp(startCol, 0, lineLen); + int safeEnd = Math.clamp(endCol, 0, lineLen); // Add only valid ranges if (safeStart <= safeEnd) { @@ -61,7 +62,7 @@ public static List mergeRanges(List ranges) { sorted.sort(Comparator.comparingInt(ColumnRange::first)); List merged = new ArrayList<>(); - ColumnRange current = sorted.get(0); + ColumnRange current = sorted.getFirst(); for (int i = 1; i < sorted.size(); i++) { ColumnRange next = sorted.get(i); diff --git a/src/main/java/burp/reporting/LiteralPart.java b/src/main/java/burp/reporting/LiteralPart.java index d153a77..23d39f0 100644 --- a/src/main/java/burp/reporting/LiteralPart.java +++ b/src/main/java/burp/reporting/LiteralPart.java @@ -1,25 +1,12 @@ package burp.reporting; import org.apache.jena.rdf.model.Statement; +import org.jspecify.annotations.NonNull; -public class LiteralPart implements RDFGraphPointer { - private final Statement stmt; - private final PointRange objectRange; - - public LiteralPart(Statement stmt, PointRange objectRange) { +public record LiteralPart(@NonNull Statement stmt, @NonNull PointRange objectRange) implements RDFGraphPointer { + public LiteralPart { if (!stmt.getObject().isLiteral()) { throw new IllegalArgumentException("Statement object is not a literal: " + stmt); } - this.stmt = stmt; - this.objectRange = objectRange; - } - - @Override - public Statement getStmt() { - return stmt; - } - - public PointRange getObjectRange() { - return objectRange; } } diff --git a/src/main/java/burp/reporting/PlainTextReportGenerator.java b/src/main/java/burp/reporting/PlainTextReportGenerator.java index 961d615..e522683 100644 --- a/src/main/java/burp/reporting/PlainTextReportGenerator.java +++ b/src/main/java/burp/reporting/PlainTextReportGenerator.java @@ -46,12 +46,30 @@ private static void printTracingInfo(StringBuilder sb, RmlError issue) { if (issue.getOrigin() != null) { Origin origin = issue.getOrigin(); sb.append(prependIndent("In mapping", 4)).append(System.lineSeparator()); - Path file = Main.mappingFile.normalize(); - List locations = ProvTurtleVisitor.retrieveTurtleLocation(origin.sourceStatements() != null ? origin.sourceStatements() : Collections.emptyList()); + + Path file = Main.mappingFile != null ? Main.mappingFile.normalize() : null; + List locations = new ArrayList<>(); + if (origin.sourceStatements() != null) { + for (RDFPointer ptr : origin.sourceStatements()) { + if (ptr instanceof TextFilePointer tfp) { + locations.add(tfp.range()); + if (tfp.path() != null) { + file = tfp.path().normalize(); + } + } + } + } + + locations.addAll(ProvTurtleVisitor.retrieveTurtleLocation(origin.sourceStatements() != null ? origin.sourceStatements() : Collections.emptyList())); + + if (file == null) { + return; + } // Print file:line:col - line:col List sortedLocations = new ArrayList<>(locations); - sortedLocations.sort(Comparator.comparing(PointRange::getStart)); + sortedLocations.removeIf(l -> l == null || l.start() == null); + sortedLocations.sort(Comparator.comparing(PointRange::start)); List lineLocations = new ArrayList<>(); for (PointRange location : sortedLocations) { diff --git a/src/main/java/burp/reporting/PointRange.java b/src/main/java/burp/reporting/PointRange.java index d876122..28e2f89 100644 --- a/src/main/java/burp/reporting/PointRange.java +++ b/src/main/java/burp/reporting/PointRange.java @@ -1,35 +1,26 @@ package burp.reporting; - import burp.parse.turtleprov.Point; -public class PointRange { - private final Point start; - private final Point end; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; + +public record PointRange(@NonNull Point start, @Nullable Point end) { - public PointRange(Point start, Point end) { - this.start = start; - this.end = end; + public PointRange() { + this(new Point(0, 0), null); } public PointRange(Point start) { this(start, null); } - public Point getStart() { - return start; - } - - public Point getEnd() { - return end; - } - public PointRange plus(PointRange other) { Point end1 = this.end != null ? this.end : Point.zero(); Point end2 = other.end != null ? other.end : Point.zero(); return new PointRange( - this.start.plus(other.start), - end1.plus(end2) + this.start.plus(other.start), + end1.plus(end2) ); } } diff --git a/src/main/java/burp/reporting/RDFGraphPointer.java b/src/main/java/burp/reporting/RDFGraphPointer.java index 96c1042..0b3f54d 100644 --- a/src/main/java/burp/reporting/RDFGraphPointer.java +++ b/src/main/java/burp/reporting/RDFGraphPointer.java @@ -3,5 +3,5 @@ import org.apache.jena.rdf.model.Statement; public interface RDFGraphPointer extends RDFPointer { - Statement getStmt(); + Statement stmt(); } diff --git a/src/main/java/burp/reporting/RdfReportGenerator.java b/src/main/java/burp/reporting/RdfReportGenerator.java index 5e131cc..6dd44a9 100644 --- a/src/main/java/burp/reporting/RdfReportGenerator.java +++ b/src/main/java/burp/reporting/RdfReportGenerator.java @@ -98,22 +98,61 @@ private static void addRmlError(Model model, Resource reportResource, RmlError e if (origin.sourceStatements() != null) { for (RDFPointer rdfPtr : origin.sourceStatements()) { - if (rdfPtr instanceof StatementParts stmtPtr) { - Resource sp = model.createResource(PTR.StatementPart); - sp.addProperty(PTR.statement, model.createStatementTerm(stmtPtr.getStmt())); - - if (stmtPtr.isSubject()) sp.addProperty(PTR.part, PTR.Subject); - if (stmtPtr.isPredicate()) sp.addProperty(PTR.part, PTR.Predicate); - if (stmtPtr.isObject()) sp.addProperty(PTR.part, PTR.Object); - - model.add(errorResource, RER.mappingStatement, sp); + switch (rdfPtr) { + case StatementParts( + var stmt, boolean subject, boolean predicate, boolean object + ) -> { + Resource sp = model.createResource(PTR.StatementPart); + sp.addProperty(PTR.statement, model.createStatementTerm(stmt)); + + if (subject) sp.addProperty(PTR.part, PTR.Subject); + if (predicate) sp.addProperty(PTR.part, PTR.Predicate); + if (object) sp.addProperty(PTR.part, PTR.Object); + + model.add(errorResource, RER.mappingStatement, sp); + } + case LiteralPart(var stmt, var range) -> { + Resource sp = model.createResource(PTR.StatementPart); + sp.addProperty(PTR.statement, model.createStatementTerm(stmt)); + sp.addProperty(PTR.part, PTR.Object); + sp.addProperty(PTR.textRange, createRangeResource(model, range)); + model.add(errorResource, RER.mappingStatement, sp); + } + case TextFilePointer tfp -> { + Resource tfpRes = model.createResource(PTR.TextFilePointer); + if (tfp.path() != null) + tfpRes.addProperty(PTR.path, tfp.path().toString()); + if (tfp.range() != null) + tfpRes.addProperty(PTR.range, createRangeResource(model, tfp.range())); + model.add(errorResource, RER.mappingStatement, tfpRes); + } + + case null, default -> { + } } - //TODO TextFilePointer and LiteralPart } } } } + private static Resource createRangeResource(Model model, PointRange range) { + Resource rangeRes = model.createResource(PTR.Range); + + Resource startPt = model.createResource(PTR.Point); + startPt.addProperty(PTR.line, model.createTypedLiteral(range.start().getDisplayLine())); + startPt.addProperty(PTR.column, model.createTypedLiteral(range.start().getDisplayColumn())); + rangeRes.addProperty(PTR.start, startPt); + + if (range.end() != null) { + Resource endPt = model.createResource(PTR.Point); + endPt.addProperty(PTR.line, model.createTypedLiteral(range.end().getDisplayLine())); + endPt.addProperty(PTR.column, model.createTypedLiteral(range.end().getDisplayColumn())); + rangeRes.addProperty(PTR.end, endPt); + } + + return rangeRes; + } + private static String getStackTraceAsString(Throwable throwable) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); diff --git a/src/main/java/burp/reporting/StatementParts.java b/src/main/java/burp/reporting/StatementParts.java index 9b5af54..a770b19 100644 --- a/src/main/java/burp/reporting/StatementParts.java +++ b/src/main/java/burp/reporting/StatementParts.java @@ -1,36 +1,13 @@ package burp.reporting; import org.apache.jena.rdf.model.Statement; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; -public class StatementParts implements RDFGraphPointer { - private final Statement stmt; - private final boolean subject; - private final boolean predicate; - private final boolean object; - - public StatementParts(Statement stmt, boolean subject, boolean predicate, boolean object) { - this.stmt = stmt; - this.subject = subject; - this.predicate = predicate; - this.object = object; - } - - @Override - public Statement getStmt() { - return stmt; - } - - public boolean isSubject() { - return subject; - } - - public boolean isPredicate() { - return predicate; - } - - public boolean isObject() { - return object; - } +public record StatementParts(@NonNull Statement stmt, + boolean subject, + boolean predicate, + boolean object) implements RDFGraphPointer { public static StatementParts from(Statement stmt, StatementPart... parts) { boolean subj = false; @@ -47,4 +24,10 @@ public static StatementParts from(Statement stmt, StatementPart... parts) { public static StatementParts fromPredicateObject(Statement stmt) { return new StatementParts(stmt, false, true, true); } + + public @Nullable LiteralPart toLiteralPart() { + if (object() && stmt.getObject().isLiteral()) + return new LiteralPart(stmt, new PointRange()); + else return null; + } } diff --git a/src/main/java/burp/reporting/TextFilePointer.java b/src/main/java/burp/reporting/TextFilePointer.java index 6974dad..71d6327 100644 --- a/src/main/java/burp/reporting/TextFilePointer.java +++ b/src/main/java/burp/reporting/TextFilePointer.java @@ -1,5 +1,13 @@ package burp.reporting; -public class TextFilePointer implements RDFPointer { +import org.jspecify.annotations.NonNull; +import java.nio.file.Path; + +public record TextFilePointer(Path path, PointRange range) implements RDFPointer { + + @Override + public @NonNull String toString() { + return "TextFilePointer[path=" + path + ", range=" + range + "]"; + } } diff --git a/src/main/resources/vocabularies/ptr.ttl b/src/main/resources/vocabularies/ptr.ttl new file mode 100644 index 0000000..0a7696c --- /dev/null +++ b/src/main/resources/vocabularies/ptr.ttl @@ -0,0 +1,148 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix dc: . +@prefix xsd: . +@prefix schema: . +@prefix widoco: . +@prefix vann: . + +@prefix rer: . +@prefix ptr: . +@prefix draw: . + +ptr: + a owl:Ontology ; + vann:preferredNamespacePrefix "ptr" ; + vann:preferredNamespaceUri "https://w3id.org/dre/ptr#" ; + dc:title "RDF Pointer Vocabulary" ; + dc:abstract "Vocabulary to describe pointers to parts of RDF statements (statement parts and descriptors)." ; + dc:date "2026-01-07"^^xsd:date ; + dc:creator "Jakub Duchateau" ; + schema:codeRepository "https://github.com/jduchateau/RER" ; + owl:versionInfo "0.0.1" ; + dc:license ; + schema:funding "This work was supported by the Fonds de la Recherche Scientifique -- FNRS under Grant n° MIS~F.4016.24." . + + +ptr:StatementPart + a owl:Class ; + rdfs:label "Statement part" ; + rdfs:comment "Wrapper describing which part of an RDF statement is implicated." ; + rdfs:isDefinedBy ptr: ; + widoco:order 1 . + +ptr:statement + a owl:ObjectProperty ; + rdfs:label "statement" ; + rdfs:comment "The RDF statement to which this part belongs." ; + rdfs:range rdf:Statement ; + rdfs:domain ptr:StatementPart ; + rdfs:isDefinedBy ptr: . + +ptr:part + a owl:ObjectProperty ; + rdfs:label "part" ; + rdfs:comment "Whether the subject, predicate, or object of the statement is implicated." ; + rdfs:range ptr:StatementPartDescriptor ; + rdfs:domain ptr:StatementPart ; + rdfs:isDefinedBy ptr: . + + +ptr:StatementPartDescriptor + a owl:Class ; + rdfs:label "Statement part descriptor" ; + rdfs:comment "Named descriptor of a statement position (subject, predicate, object)." ; + rdfs:subClassOf owl:NamedIndividual ; + rdfs:isDefinedBy ptr: . + +ptr:Subject + a ptr:StatementPartDescriptor ; + rdfs:label "Subject" ; + rdfs:isDefinedBy ptr: . + +ptr:Predicate + a ptr:StatementPartDescriptor ; + rdfs:label "Predicate" ; + rdfs:isDefinedBy ptr: . + +ptr:Object + a ptr:StatementPartDescriptor ; + rdfs:label "Object" ; + rdfs:isDefinedBy ptr: . + + +ptr:textRange + a owl:ObjectProperty ; + rdfs:label "text range" ; + rdfs:comment "Character range in the mapping text where the error occurs." ; + rdfs:domain ptr:StatementPart ; + rdfs:range ptr:Range ; + rdfs:isDefinedBy ptr: . + +ptr:Range + a owl:Class ; + rdfs:label "Range" ; + rdfs:comment "Text span defined by start and end points." ; + rdfs:isDefinedBy ptr: . + +ptr:start + a owl:ObjectProperty ; + rdfs:label "start" ; + rdfs:comment "Starting point of the text range." ; + rdfs:domain ptr:Range ; + rdfs:range ptr:Point ; + rdfs:isDefinedBy ptr: . + +ptr:end + a owl:ObjectProperty ; + rdfs:label "end" ; + rdfs:comment "Ending point of the text range." ; + rdfs:domain ptr:Range ; + rdfs:range ptr:Point ; + rdfs:isDefinedBy ptr: . + +ptr:Point + a owl:Class ; + rdfs:label "Point" ; + rdfs:comment "Line/column coordinates inside a text." ; + rdfs:isDefinedBy ptr: . + +ptr:line + a owl:DatatypeProperty ; + rdfs:label "line" ; + rdfs:comment "Line number for the point." ; + rdfs:domain ptr:Point ; + rdfs:range xsd:integer ; + rdfs:isDefinedBy ptr: . + +ptr:column + a owl:DatatypeProperty ; + rdfs:label "column" ; + rdfs:comment "Column number for the point." ; + rdfs:domain ptr:Point ; + rdfs:range xsd:integer ; + rdfs:isDefinedBy ptr: . + + +ptr:TextFilePointer + a owl:Class ; + rdfs:label "Text file pointer" ; + rdfs:comment "Pointer pointing to a specific location in a text file." ; + rdfs:isDefinedBy ptr: . + +ptr:path + a owl:DatatypeProperty ; + rdfs:label "path" ; + rdfs:comment "The path of the file containing the reference." ; + rdfs:domain ptr:TextFilePointer ; + rdfs:range xsd:string ; + rdfs:isDefinedBy ptr: . + +ptr:range + a owl:ObjectProperty ; + rdfs:label "range" ; + rdfs:comment "The character range in the text file." ; + rdfs:domain ptr:TextFilePointer ; + rdfs:range ptr:Range ; + rdfs:isDefinedBy ptr: . diff --git a/src/test/java/burp/ParseShaclViolationTest.java b/src/test/java/burp/ParseShaclViolationTest.java new file mode 100644 index 0000000..bb262ca --- /dev/null +++ b/src/test/java/burp/ParseShaclViolationTest.java @@ -0,0 +1,111 @@ +package burp; + +import burp.parse.Parse; +import burp.reporting.StatementParts; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.shacl.ShaclValidator; +import org.apache.jena.shacl.ValidationReport; +import org.apache.jena.shacl.validation.ReportEntry; +import org.apache.jena.vocabulary.RDF; +import org.junit.jupiter.api.Test; + +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ParseShaclViolationTest { + + @Test + public void testExtractStatementsFromShaclViolation() { + String shapesGraph = """ + @prefix sh: . + @prefix ex: . + @prefix xsd: . + + ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path ex:age ; + sh:datatype xsd:integer ; + ] . + """; + + String dataGraph = """ + @prefix ex: . + + ex:Alice a ex:Person ; + ex:age "twenty" . + """; + + Model shapesModel = ModelFactory.createDefaultModel(); + shapesModel.read(new ByteArrayInputStream(shapesGraph.getBytes(StandardCharsets.UTF_8)), null, "TURTLE"); + + Model dataModel = ModelFactory.createDefaultModel(); + dataModel.read(new ByteArrayInputStream(dataGraph.getBytes(StandardCharsets.UTF_8)), null, "TURTLE"); + + ValidationReport report = ShaclValidator.get().validate(shapesModel.getGraph(), dataModel.getGraph()); + Collection entries = report.getEntries(); + + assertEquals(1, entries.size(), "Should have 1 violation"); + ReportEntry vr = entries.iterator().next(); + + Parse parse = new Parse(); + List statements = parse.extractStatementsFromShaclViolation(vr, dataModel); + + assertEquals(1, statements.size(), "Should extract 1 relevant statement"); + Statement stmt = statements.getFirst().stmt(); + assertEquals("http://example.org/Alice", stmt.getSubject().getURI()); + assertEquals("http://example.org/age", stmt.getPredicate().getURI()); + assertEquals("twenty", stmt.getObject().asLiteral().getLexicalForm()); + } + + @Test + public void testExtractStatementsFromShaclViolation_minCount() { + String shapesGraph = """ + @prefix sh: . + @prefix ex: . + + ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path ex:name ; + sh:minCount 1 ; + ] . + """; + + String dataGraph = """ + @prefix ex: . + ex:Bob a ex:Person . + """; + + Model shapesModel = ModelFactory.createDefaultModel(); + shapesModel.read(new ByteArrayInputStream(shapesGraph.getBytes(StandardCharsets.UTF_8)), null, "TURTLE"); + + Model dataModel = ModelFactory.createDefaultModel(); + dataModel.read(new ByteArrayInputStream(dataGraph.getBytes(StandardCharsets.UTF_8)), null, "TURTLE"); + + ValidationReport report = ShaclValidator.get().validate(shapesModel.getGraph(), dataModel.getGraph()); + Collection entries = report.getEntries(); + + assertEquals(1, entries.size(), "Should have 1 violation"); + ReportEntry vr = entries.iterator().next(); + + Parse parse = new Parse(); + List statements = parse.extractStatementsFromShaclViolation(vr, dataModel); + + // In minCount, it looks for the statements with ex:name, but Bob has none. + // It should fallback to retrieving statements where Bob is involved. + assertEquals(1, statements.size(), "Should fallback to focus nodes statement"); + Statement stmt = statements.getFirst().stmt(); + assertEquals("http://example.org/Bob", stmt.getSubject().getURI()); + assertEquals(RDF.type.getURI(), stmt.getPredicate().getURI()); + assertEquals("http://example.org/Person", stmt.getObject().asResource().getURI()); + } +} diff --git a/src/test/java/turtleprov/TurtleParserTest.java b/src/test/java/turtleprov/TurtleParserTest.java index 2916416..8f9b597 100644 --- a/src/test/java/turtleprov/TurtleParserTest.java +++ b/src/test/java/turtleprov/TurtleParserTest.java @@ -273,9 +273,45 @@ public static Stream rmlMappingFiles() throws Exception { Path resourcesPath = Paths.get("src/test/resources"); if (!Files.exists(resourcesPath)) return Stream.empty(); - return Files.walk(resourcesPath) - .filter(p -> p.toString().contains("rml-")) - .filter(p -> p.toString().endsWith("mapping.ttl")) - .map(Arguments::of); + try (Stream walk = Files.walk(resourcesPath)) { + return walk + .filter(p -> p.toString().contains("rml-")) + .filter(p -> p.toString().endsWith("mapping.ttl")) + .map(Arguments::of) + .toList() + .stream(); + } + } + + @Test + public void testSyntaxErrorReportingPointRange() { + String invalidTurtle = "@prefix ex: .\nex:alice ex:knows ."; + ProvStore store = TurtleProvParser.parseTurtleFromString(invalidTurtle); + + Assertions.assertFalse(store.getSyntaxErrors().isEmpty()); + var error = store.getSyntaxErrors().getFirst(); + Assertions.assertNotNull(error.range); + + Assertions.assertEquals(1, error.range.start().line); + Assertions.assertEquals(18, error.range.start().column); + Assertions.assertNotNull(error.range.end()); + } + + @Test + public void testLexerSyntaxErrorReportingQuotedText() { + String invalidTurtle = "@prefix ex: .\nex:alice ex:knows \"http://example.com/{Name\\}\" ."; + ProvStore store = TurtleProvParser.parseTurtleFromString(invalidTurtle); + + Assertions.assertFalse(store.getSyntaxErrors().isEmpty()); + var error = store.getSyntaxErrors().getFirst(); + Assertions.assertNotNull(error.range); + + Assertions.assertEquals(1, error.range.start().line); + Assertions.assertEquals(18, error.range.start().column); + + // The extracted quoted text is "http://example.com/{Name\} (length 27) + Assertions.assertNotNull(error.range.end()); + Assertions.assertEquals(1, error.range.end().line); + Assertions.assertEquals(45, error.range.end().column); } } From c46bdaf891ef4340e4add8af38378d0040d7c55d Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 11 Jun 2026 16:24:33 +0200 Subject: [PATCH 09/45] refactor(submodules): integrate Git submodules for RML modules and clean up test resources --- .gitmodules | 18 + .idea/encodings.xml | 10 + pom.xml | 103 ++- rml-modules/rml-cc | 1 + rml-modules/rml-core | 1 + rml-modules/rml-fnml | 1 + rml-modules/rml-io | 1 + rml-modules/rml-io-registry | 1 + rml-modules/rml-lv | 1 + src/main/java/burp/parse/Parse.java | 7 +- src/main/resources/shapes/rml-cc/cc.ttl | 97 --- .../shapes/rml-cc/external_shapes.ttl | 24 - .../resources/shapes/rml-cc/gather_map.ttl | 90 -- .../resources/shapes/rml-cc/generate_shape.py | 79 -- .../shapes/rml-cc/mapping_validator.py | 40 - .../resources/shapes/rml-cc/requirements.txt | 3 - src/main/resources/shapes/rml-cc/shacl.ttl | 406 --------- src/main/resources/shapes/rml-cc/tests.py | 76 -- src/main/resources/shapes/rml-core/README.md | 7 - .../resources/shapes/rml-core/child_map.ttl | 46 - src/main/resources/shapes/rml-core/core.ttl | 784 ------------------ .../shapes/rml-core/datatype_map.ttl | 47 -- .../shapes/rml-core/expression_map.ttl | 159 ---- .../shapes/rml-core/external_shapes.ttl | 16 - .../shapes/rml-core/generate_shape.py | 79 -- .../resources/shapes/rml-core/graph_map.ttl | 55 -- .../resources/shapes/rml-core/iterable.ttl | 65 -- src/main/resources/shapes/rml-core/join.ttl | 93 --- .../shapes/rml-core/language_map.ttl | 50 -- .../shapes/rml-core/mapping_validator.py | 40 - .../resources/shapes/rml-core/object_map.ttl | 100 --- .../resources/shapes/rml-core/parent_map.ttl | 46 - .../shapes/rml-core/predicate_map.ttl | 52 -- .../shapes/rml-core/predicate_object_map.ttl | 107 --- .../shapes/rml-core/ref_object_map.ttl | 46 - .../shapes/rml-core/requirements.txt | 3 - src/main/resources/shapes/rml-core/shacl.ttl | 406 --------- .../shapes/rml-core/shared_properties.ttl | 198 ----- .../resources/shapes/rml-core/subject_map.ttl | 67 -- .../resources/shapes/rml-core/term_map.ttl | 43 - src/main/resources/shapes/rml-core/tests.py | 80 -- .../resources/shapes/rml-core/triples_map.ttl | 33 - src/main/resources/shapes/rml-fnml/README.md | 20 - .../shapes/rml-fnml/external_shapes.ttl | 20 - src/main/resources/shapes/rml-fnml/fnml.ttl | 173 ---- .../shapes/rml-fnml/function_execution.ttl | 74 -- .../shapes/rml-fnml/function_map.ttl | 28 - .../shapes/rml-fnml/generate_shape.py | 79 -- src/main/resources/shapes/rml-fnml/input.ttl | 107 --- .../shapes/rml-fnml/mapping_validator.py | 43 - .../shapes/rml-fnml/parameter_map.ttl | 28 - .../shapes/rml-fnml/requirements.txt | 3 - .../resources/shapes/rml-fnml/return_map.ttl | 28 - src/main/resources/shapes/rml-fnml/shacl.ttl | 406 --------- src/main/resources/shapes/rml-fnml/tests.py | 83 -- .../resources/shapes/rml-io/generate_shape.py | 79 -- src/main/resources/shapes/rml-io/io.ttl | 283 ------- .../shapes/rml-io/logical_source.ttl | 43 - .../shapes/rml-io/logical_target.ttl | 44 - .../shapes/rml-io/mapping_validator.py | 45 - .../shapes/rml-io/relative_path_source.ttl | 56 -- .../shapes/rml-io/relative_path_target.ttl | 56 -- .../resources/shapes/rml-io/requirements.txt | 3 - .../resources/shapes/rml-io/shapes_graph.ttl | 5 - src/main/resources/shapes/rml-io/source.ttl | 91 -- src/main/resources/shapes/rml-io/target.ttl | 92 -- src/main/resources/shapes/rml-io/tests.py | 72 -- src/main/resources/shapes/rml-io/utils.py | 25 - src/main/resources/shapes/rml-lv/lv.ttl | 361 -------- .../shapes/rml-lv/mapping_validator.py | 45 - .../resources/shapes/rml-lv/requirements.txt | 3 - src/main/resources/shapes/rml-lv/tests.py | 77 -- src/main/resources/shapes/rml-lv/utils.py | 25 - .../shapes/rml-star/assertedtriples_map.ttl | 38 - .../shapes/rml-star/external_shapes.ttl | 20 - .../shapes/rml-star/generate_shape.py | 79 -- .../shapes/rml-star/mapping_validator.py | 40 - .../rml-star/nonassertedtriples_map.ttl | 38 - .../shapes/rml-star/requirements.txt | 3 - src/main/resources/shapes/rml-star/shacl.ttl | 406 --------- .../shapes/rml-star/shared_properties.ttl | 48 -- src/main/resources/shapes/rml-star/star.ttl | 123 --- .../resources/shapes/rml-star/star_map.ttl | 61 -- src/main/resources/shapes/rml-star/tests.py | 77 -- src/test/java/burp/TestRMLCC.java | 2 +- src/test/java/burp/TestRMLCore.java | 2 +- src/test/java/burp/TestRMLFNML.java | 2 +- src/test/java/burp/TestRMLIO.java | 2 +- src/test/java/burp/TestRMLIORegistry.java | 2 +- src/test/java/burp/TestRMLLV.java | 2 +- src/test/java/burp/TestRMLModule.java | 14 +- 91 files changed, 156 insertions(+), 6881 deletions(-) create mode 160000 rml-modules/rml-cc create mode 160000 rml-modules/rml-core create mode 160000 rml-modules/rml-fnml create mode 160000 rml-modules/rml-io create mode 160000 rml-modules/rml-io-registry create mode 160000 rml-modules/rml-lv delete mode 100644 src/main/resources/shapes/rml-cc/cc.ttl delete mode 100644 src/main/resources/shapes/rml-cc/external_shapes.ttl delete mode 100644 src/main/resources/shapes/rml-cc/gather_map.ttl delete mode 100644 src/main/resources/shapes/rml-cc/generate_shape.py delete mode 100644 src/main/resources/shapes/rml-cc/mapping_validator.py delete mode 100644 src/main/resources/shapes/rml-cc/requirements.txt delete mode 100644 src/main/resources/shapes/rml-cc/shacl.ttl delete mode 100644 src/main/resources/shapes/rml-cc/tests.py delete mode 100644 src/main/resources/shapes/rml-core/README.md delete mode 100644 src/main/resources/shapes/rml-core/child_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/core.ttl delete mode 100644 src/main/resources/shapes/rml-core/datatype_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/expression_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/external_shapes.ttl delete mode 100644 src/main/resources/shapes/rml-core/generate_shape.py delete mode 100644 src/main/resources/shapes/rml-core/graph_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/iterable.ttl delete mode 100644 src/main/resources/shapes/rml-core/join.ttl delete mode 100644 src/main/resources/shapes/rml-core/language_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/mapping_validator.py delete mode 100644 src/main/resources/shapes/rml-core/object_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/parent_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/predicate_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/predicate_object_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/ref_object_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/requirements.txt delete mode 100644 src/main/resources/shapes/rml-core/shacl.ttl delete mode 100644 src/main/resources/shapes/rml-core/shared_properties.ttl delete mode 100644 src/main/resources/shapes/rml-core/subject_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/term_map.ttl delete mode 100644 src/main/resources/shapes/rml-core/tests.py delete mode 100644 src/main/resources/shapes/rml-core/triples_map.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/README.md delete mode 100644 src/main/resources/shapes/rml-fnml/external_shapes.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/fnml.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/function_execution.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/function_map.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/generate_shape.py delete mode 100644 src/main/resources/shapes/rml-fnml/input.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/mapping_validator.py delete mode 100644 src/main/resources/shapes/rml-fnml/parameter_map.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/requirements.txt delete mode 100644 src/main/resources/shapes/rml-fnml/return_map.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/shacl.ttl delete mode 100644 src/main/resources/shapes/rml-fnml/tests.py delete mode 100644 src/main/resources/shapes/rml-io/generate_shape.py delete mode 100644 src/main/resources/shapes/rml-io/io.ttl delete mode 100644 src/main/resources/shapes/rml-io/logical_source.ttl delete mode 100644 src/main/resources/shapes/rml-io/logical_target.ttl delete mode 100644 src/main/resources/shapes/rml-io/mapping_validator.py delete mode 100644 src/main/resources/shapes/rml-io/relative_path_source.ttl delete mode 100644 src/main/resources/shapes/rml-io/relative_path_target.ttl delete mode 100644 src/main/resources/shapes/rml-io/requirements.txt delete mode 100644 src/main/resources/shapes/rml-io/shapes_graph.ttl delete mode 100644 src/main/resources/shapes/rml-io/source.ttl delete mode 100644 src/main/resources/shapes/rml-io/target.ttl delete mode 100644 src/main/resources/shapes/rml-io/tests.py delete mode 100644 src/main/resources/shapes/rml-io/utils.py delete mode 100644 src/main/resources/shapes/rml-lv/lv.ttl delete mode 100644 src/main/resources/shapes/rml-lv/mapping_validator.py delete mode 100644 src/main/resources/shapes/rml-lv/requirements.txt delete mode 100644 src/main/resources/shapes/rml-lv/tests.py delete mode 100644 src/main/resources/shapes/rml-lv/utils.py delete mode 100644 src/main/resources/shapes/rml-star/assertedtriples_map.ttl delete mode 100644 src/main/resources/shapes/rml-star/external_shapes.ttl delete mode 100755 src/main/resources/shapes/rml-star/generate_shape.py delete mode 100755 src/main/resources/shapes/rml-star/mapping_validator.py delete mode 100644 src/main/resources/shapes/rml-star/nonassertedtriples_map.ttl delete mode 100644 src/main/resources/shapes/rml-star/requirements.txt delete mode 100644 src/main/resources/shapes/rml-star/shacl.ttl delete mode 100644 src/main/resources/shapes/rml-star/shared_properties.ttl delete mode 100644 src/main/resources/shapes/rml-star/star.ttl delete mode 100644 src/main/resources/shapes/rml-star/star_map.ttl delete mode 100755 src/main/resources/shapes/rml-star/tests.py diff --git a/.gitmodules b/.gitmodules index ff8e8c8..91683e0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,21 @@ [submodule "src/test/resources/rdf-tests"] path = src/test/resources/rdf-tests url = https://github.com/w3c/rdf-tests.git +[submodule "rml-modules/rml-core"] + path = rml-modules/rml-core + url = https://github.com/kg-construct/rml-core.git +[submodule "rml-modules/rml-cc"] + path = rml-modules/rml-cc + url = https://github.com/kg-construct/rml-cc.git +[submodule "rml-modules/rml-io"] + path = rml-modules/rml-io + url = https://github.com/kg-construct/rml-io.git +[submodule "rml-modules/rml-fnml"] + path = rml-modules/rml-fnml + url = https://github.com/kg-construct/rml-fnml.git +[submodule "rml-modules/rml-lv"] + path = rml-modules/rml-lv + url = https://github.com/kg-construct/rml-lv.git +[submodule "rml-modules/rml-io-registry"] + path = rml-modules/rml-io-registry + url = https://github.com/kg-construct/rml-io-registry.git diff --git a/.idea/encodings.xml b/.idea/encodings.xml index aa00ffa..051e40b 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,6 +1,16 @@ + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 2f26833..54a07c5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,10 +4,10 @@ 4.0.0 io.github.kg-construct - BURP + burp 0.1.7 - Basic and Unassuming RML Processor + BURP A Basic and Unassuming RML Processor (BURP) with RML Execution Report (RER) error handling https://github.com/kg-construct/BURP/ @@ -48,7 +48,6 @@ UTF-8 5.6.0 4.13.1 - ${env.CI_PROJECT_ID} @@ -67,8 +66,105 @@ **/*.ttl + + + + rml-modules/rml-core/shapes + shapes + + core.ttl + + + + rml-modules/rml-cc/shapes + shapes + + cc.ttl + + + + rml-modules/rml-lv/shapes + shapes + + lv.ttl + + + + rml-modules/rml-io/shapes + shapes + + io.ttl + + + + + + rml-modules/rml-core/ontology + vocabularies/rml + + *.owl + + + + rml-modules/rml-cc/ontology + vocabularies/rml + + *.owl + + + + rml-modules/rml-io/ontology + vocabularies/rml + + *.owl + + + + rml-modules/rml-fnml/ontology + vocabularies/rml + + *.owl + + + + rml-modules/rml-lv/ontology + vocabularies/rml + + *.owl + + + + + src/test/resources + + + rml-modules/rml-core/test-cases + rml-core + + + rml-modules/rml-cc/test-cases + rml-cc + + + rml-modules/rml-lv/test-cases + rml-lv + + + rml-modules/rml-io/test-cases + rml-io + + + rml-modules/rml-io-registry/test-cases + rml-io-registry + + + rml-modules/rml-fnml/test-cases + rml-fnml + + + maven-compiler-plugin @@ -430,6 +526,7 @@ + diff --git a/rml-modules/rml-cc b/rml-modules/rml-cc new file mode 160000 index 0000000..d97fddf --- /dev/null +++ b/rml-modules/rml-cc @@ -0,0 +1 @@ +Subproject commit d97fddf0f769f352d256a96b93544f3dfd192ffc diff --git a/rml-modules/rml-core b/rml-modules/rml-core new file mode 160000 index 0000000..82ab28d --- /dev/null +++ b/rml-modules/rml-core @@ -0,0 +1 @@ +Subproject commit 82ab28d46803ba66a83c133f1db371a60116f84d diff --git a/rml-modules/rml-fnml b/rml-modules/rml-fnml new file mode 160000 index 0000000..df68527 --- /dev/null +++ b/rml-modules/rml-fnml @@ -0,0 +1 @@ +Subproject commit df68527f945eea0ac4f31285dc2113048107cc2c diff --git a/rml-modules/rml-io b/rml-modules/rml-io new file mode 160000 index 0000000..980b906 --- /dev/null +++ b/rml-modules/rml-io @@ -0,0 +1 @@ +Subproject commit 980b90626d86394af91ed606f8493927d59d5e67 diff --git a/rml-modules/rml-io-registry b/rml-modules/rml-io-registry new file mode 160000 index 0000000..d008dbc --- /dev/null +++ b/rml-modules/rml-io-registry @@ -0,0 +1 @@ +Subproject commit d008dbc8ec44e6e1e9f48547e221b4b16d125be4 diff --git a/rml-modules/rml-lv b/rml-modules/rml-lv new file mode 160000 index 0000000..a6a23dd --- /dev/null +++ b/rml-modules/rml-lv @@ -0,0 +1 @@ +Subproject commit a6a23ddcd040f313d1ec7fe38668fc09a9ca07c0 diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index f306f28..2b58638 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -149,9 +149,10 @@ public List parseMappingFile(Path mappingPath, Path currentDirectory private boolean isValid(Model mapping) { Model core = ModelFactory.createDefaultModel(); - core.read(Parse.class.getResourceAsStream("/shapes/rml-core/core.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/rml-cc/cc.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/rml-lv/lv.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/core.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/cc.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/lv.ttl"), "urn:dummy", FileUtils.langTurtle); + core.read(Parse.class.getResourceAsStream("/shapes/io.ttl"), "urn:dummy", FileUtils.langTurtle); ValidationReport report = ShaclValidator.get().validate(core.getGraph(), mapping.getGraph()); if (!report.conforms()) { diff --git a/src/main/resources/shapes/rml-cc/cc.ttl b/src/main/resources/shapes/rml-cc/cc.ttl deleted file mode 100644 index a3888df..0000000 --- a/src/main/resources/shapes/rml-cc/cc.ttl +++ /dev/null @@ -1,97 +0,0 @@ -@prefix brick: . -@prefix csvw: . -@prefix dc: . -@prefix dcam: . -@prefix dcat: . -@prefix dcmitype: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix geo: . -@prefix odrl: . -@prefix org: . -@prefix owl: . -@prefix prof: . -@prefix prov: . -@prefix qb: . -@prefix rdf: . -@prefix rdfs: . -@prefix rml: . -@prefix : . -@prefix sh: . -@prefix skos: . -@prefix sosa: . -@prefix ssn: . -@prefix time: . -@prefix vann: . -@prefix void: . -@prefix wgs: . -@prefix xml: . -@prefix xsd: . - - a sh:NodeShape ; - sh:and ( [ rdfs:comment """ - rml:strategy specifies the collection strategy to use: rml:append - or rml:cartesianProduct. rml:append is the default strategy. - """ ; - sh:maxCount 1 ; - sh:message """ - Zero or one rml:strategy is required. - """ ; - sh:minCount 0 ; - rdfs:label "strategy" ; - sh:node ; - sh:nodeKind sh:IRI ; - sh:path rml:strategy ] [ rdfs:comment """ - rml:gatherAs specifies how to gather the collection e.g. a rdf:Alt, - rdf:List, rdf:Bag, or rdf:Seq. - """ ; - sh:in ( rdf:Alt rdf:List rdf:Bag rdf:Seq ) ; - sh:maxCount 1 ; - sh:message """ - One rml:gatherAs is required. - """ ; - sh:minCount 1 ; - rdfs:label "gatherAs" ; - sh:nodeKind sh:IRI ; - sh:path rml:gatherAs ] [ sh:datatype xsd:boolean ; - rdfs:comment """ - Defines the behavior when the collection is empty. True will generate - a rdf:nil for a RDF collection or a resource with no members for an RDF - container. False will not generate any collection or container. - Default is false. - """ ; - sh:maxCount 1 ; - sh:message """ - Zero or one rml:allowEmptyListAndContainer is required with datatype - xsd:boolean. - """ ; - sh:minCount 0 ; - rdfs:label "allowEmptyListAndContainer" ; - sh:nodeKind sh:Literal ; - sh:path rml:allowEmptyListAndContainer ] [ rdfs:comment """ - RML Term Maps to gather in the collection or container. - """ ; - sh:message """ - one or more rml:gather properties are needed, each pointing to a - RML Term Map. - """ ; - sh:minCount 1 ; - rdfs:label "gather" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:gather ] ) ; - rdfs:comment """ - Represents a Gather Map. - """ ; - sh:message """ - Gather Map requires one rml:strategy, one rml:gatherAs, and a list of - Term Map with rml:gather. - """ ; - rdfs:label "GatherMap" . - - a sh:NodeShape . - - a sh:NodeShape . - - a sh:NodeShape . - diff --git a/src/main/resources/shapes/rml-cc/external_shapes.ttl b/src/main/resources/shapes/rml-cc/external_shapes.ttl deleted file mode 100644 index 79e8304..0000000 --- a/src/main/resources/shapes/rml-cc/external_shapes.ttl +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################### -# RML FNML external resources shapes # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # -############################################################################### -@prefix sh: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Shapes are defined in the corresponding repositories of each specification -# Provide their IRI as stub to allow validation in CC. - -:RMLTermMapShape - a sh:NodeShape; -. - -:RMLLogicalTargetPropertiesShape - a sh:NodeShape; -. - -:RMLStrategyAppendShape - a sh:NodeShape; -. diff --git a/src/main/resources/shapes/rml-cc/gather_map.ttl b/src/main/resources/shapes/rml-cc/gather_map.ttl deleted file mode 100644 index cf053a7..0000000 --- a/src/main/resources/shapes/rml-cc/gather_map.ttl +++ /dev/null @@ -1,90 +0,0 @@ -############################################################################### -# RMLCC Gather Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLGatherMapShape - a sh:NodeShape ; - rdfs:label "GatherMap" ; - rdfs:comment """ - Represents a Gather Map. - """ ; - sh:message """ - Gather Map requires one rml:strategy, one rml:gatherAs, and a list of - Term Map with rml:gather. - """ ; - - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLLogicalTargetPropertiesShape - # Gather Map specific shapes - [ - sh:path rml:strategy ; - rdfs:label "strategy" ; - rdfs:comment """ - rml:strategy specifies the collection strategy to use: rml:append - or rml:cartesianProduct. rml:append is the default strategy. - """ ; - sh:message """ - Zero or one rml:strategy is required. - """ ; - sh:node :RMLStrategyAppendShape ; - sh:nodeKind sh:IRI ; - sh:minCount 0 ; - sh:maxCount 1 ; - ] - [ - sh:path rml:gatherAs ; - rdfs:label "gatherAs" ; - rdfs:comment """ - rml:gatherAs specifies how to gather the collection e.g. a rdf:Alt, - rdf:List, rdf:Bag, or rdf:Seq. - """ ; - sh:message """ - One rml:gatherAs is required. - """ ; - sh:in (rdf:Alt rdf:List rdf:Bag rdf:Seq) ; - sh:nodeKind sh:IRI; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - [ - sh:path rml:allowEmptyListAndContainer ; - rdfs:label "allowEmptyListAndContainer" ; - rdfs:comment """ - Defines the behavior when the collection is empty. True will generate - a rdf:nil for a RDF collection or a resource with no members for an RDF - container. False will not generate any collection or container. - Default is false. - """ ; - sh:message """ - Zero or one rml:allowEmptyListAndContainer is required with datatype - xsd:boolean. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:nodeKind sh:Literal ; - sh:datatype xsd:boolean ; - ] - [ - sh:path rml:gather ; - rdfs:label "gather" ; - rdfs:comment """ - RML Term Maps to gather in the collection or container. - """ ; - sh:message """ - one or more rml:gather properties are needed, each pointing to a - RML Term Map. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:minCount 1 ; - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-cc/generate_shape.py b/src/main/resources/shapes/rml-cc/generate_shape.py deleted file mode 100644 index 5d4db63..0000000 --- a/src/main/resources/shapes/rml-cc/generate_shape.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -import argparse -import sys -from os import path -from glob import glob -from rdflib import Graph, Namespace -from rdflib.plugins.serializers.turtle import TurtleSerializer -from rdflib import plugin - -SUBSHAPE_FORMAT = 'turtle' -SUBSHAPE_GLOB_PATTERN = '*.ttl' -SHACL = Namespace('http://www.w3.org/ns/shacl#') -RML = Namespace('http://w3id.org/rml/') - - -class TurtleWithPrefixes(TurtleSerializer): - """ - A turtle serializer that always emits prefixes - Workaround for https://github.com/RDFLib/rdflib/issues/1048 - """ - roundtrip_prefixes = True # Undocumented, forces to write all prefixes - - -class ShapeGenerator: - """ - Generates a complete SHACL shape of all the SHACL subshapes. - Useful for using the shapes in the shacl.org Playground. - """ - def __init__(self, glob_pattern: str, rdf_format: str, - destination: str) -> None: - self._glob_pattern: str = glob_pattern - self._rdf_format: str = rdf_format - self._destination: str = destination - self._shape = Graph() - self._shape.bind('sh', SHACL) - self._shape.bind('rml', RML) - # Register TurtleWithPrefixes serializer as 'tortoise' format - plugin.register('tortoise', - plugin.Serializer, - 'generate_shape', - 'TurtleWithPrefixes') - - def generate(self) -> None: - """ - Generate a full shape from the sub shapes. - """ - print('Reading subshapes:') - for sub_shape in glob(self._glob_pattern): - if 'cc' in sub_shape or 'shacl' in sub_shape: - continue - print(f"\t{sub_shape}") - g = Graph() - g.bind('sh', SHACL) - g.bind('rml', RML) - self._shape += g.parse(sub_shape, format=self._rdf_format) - - print(f'Writing shape to {self._destination}') - self._shape.serialize(destination=self._destination, format='tortoise') - - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' - 'from the subshapes.') - p.add_argument('destination', type=str, help='Location to write the ' - 'complete SHACL shape as Turtle.') - # Arguments parsing - args = p.parse_args() - if not path.exists(args.destination): - print(f'{args.destination} file path does not exist!') - sys.exit(1) - - if path.isdir(args.destination): - args.destination = path.join(args.destination, 'cc.ttl') - - # Generate shape - generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, - args.destination) - generator.generate() diff --git a/src/main/resources/shapes/rml-cc/mapping_validator.py b/src/main/resources/shapes/rml-cc/mapping_validator.py deleted file mode 100644 index f239f59..0000000 --- a/src/main/resources/shapes/rml-cc/mapping_validator.py +++ /dev/null @@ -1,40 +0,0 @@ -from logging import debug, info, critical -from pyshacl import validate -from rdflib import Graph -from shutil import get_terminal_size - - -class MappingValidator: - def __init__(self, shape: str) -> None: - g = Graph() - g.parse(shape, format='turtle') - self._shape = g - - def validate(self, rules: Graph, print_report: bool = True) -> None: - valid: bool - report_graph: Graph - report_text: str - valid, report_graph, report_text = validate(rules, - shacl_graph=self._shape) - debug(f'RML rules valid: {valid}') - debug(f'SHACL validation report: {report_text}') - - # If mapping rules are invalid, print SHACL report and raise exception - if not valid and print_report: - self._print_report(report_text) - msg = 'RML mapping rules are invalid, a detailed explanation' \ - ' is available in the report' - critical(msg) - raise ValueError(msg) - - def _print_report(self, report_text: str) -> None: - tty_columns: int - tty_columns, _ = get_terminal_size() - info('-' * tty_columns) - title: str = 'RML rules validation report' - white_space: int = int((tty_columns - len(title)) / 2) - title = ' ' * white_space + title + ' ' * white_space - info(title) - info('-' * tty_columns) - info(report_text) - info('-' * tty_columns) \ No newline at end of file diff --git a/src/main/resources/shapes/rml-cc/requirements.txt b/src/main/resources/shapes/rml-cc/requirements.txt deleted file mode 100644 index e9fdd84..0000000 --- a/src/main/resources/shapes/rml-cc/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -parameterized -rdflib -pyshacl \ No newline at end of file diff --git a/src/main/resources/shapes/rml-cc/shacl.ttl b/src/main/resources/shapes/rml-cc/shacl.ttl deleted file mode 100644 index e37856a..0000000 --- a/src/main/resources/shapes/rml-cc/shacl.ttl +++ /dev/null @@ -1,406 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - -@prefix shsh: . - -shsh: - rdfs:label "SHACL for SHACL"@en ; - rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; - sh:declare [ - sh:prefix "shsh" ; - sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; - ] . - - -shsh:ListShape - a sh:NodeShape ; - rdfs:label "List shape"@en ; - rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath rdf:rest ] ; - rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; - sh:hasValue rdf:nil ; - sh:node shsh:ListNodeShape ; - ] . - -shsh:ListNodeShape - a sh:NodeShape ; - rdfs:label "List node shape"@en ; - rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; - sh:or ( [ - sh:hasValue rdf:nil ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 0 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 0 ; - ] ; - ] - [ - sh:not [ sh:hasValue rdf:nil ] ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - ] ) . - -shsh:ShapeShape - a sh:NodeShape ; - rdfs:label "Shape shape"@en ; - rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; - - # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape - sh:targetClass sh:NodeShape ; - sh:targetClass sh:PropertyShape ; - sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; - sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, - sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, - sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, - sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, - sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; - - sh:targetObjectsOf sh:node ; # node-node - sh:targetObjectsOf sh:not ; # not-node - sh:targetObjectsOf sh:property ; # property-node - sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node - - # Shapes are either node shapes or property shapes - sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; - - sh:property [ - sh:path sh:targetNode ; - sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind - ] ; - sh:property [ - sh:path sh:targetClass ; - sh:nodeKind sh:IRI ; # targetClass-nodeKind - ] ; - sh:property [ - sh:path sh:targetSubjectsOf ; - sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind - ] ; - sh:property [ - sh:path sh:targetObjectsOf ; - sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind - ] ; - sh:or ( [ sh:not [ - sh:class rdfs:Class ; - sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) - ] ] - [ sh:nodeKind sh:IRI ] - ) ; # implicit-targetClass-nodeKind - - sh:property [ - sh:path sh:severity ; - sh:maxCount 1 ; # severity-maxCount - sh:nodeKind sh:IRI ; # severity-nodeKind - ] ; - sh:property [ - sh:path sh:message ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype - ] ; - sh:property [ - sh:path sh:deactivated ; - sh:maxCount 1 ; # deactivated-maxCount - sh:in ( true false ) ; # deactivated-datatype - ] ; - - sh:property [ - sh:path sh:and ; - sh:node shsh:ListShape ; # and-node - ] ; - sh:property [ - sh:path sh:class ; - sh:nodeKind sh:IRI ; # class-nodeKind - ] ; - sh:property [ - sh:path sh:closed ; - sh:datatype xsd:boolean ; # closed-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:ignoredProperties ; - sh:node shsh:ListShape ; # ignoredProperties-node - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind - ] ; - sh:property [ - sh:path sh:datatype ; - sh:nodeKind sh:IRI ; # datatype-nodeKind - sh:maxCount 1 ; # datatype-maxCount - ] ; - sh:property [ - sh:path sh:disjoint ; - sh:nodeKind sh:IRI ; # disjoint-nodeKind - ] ; - sh:property [ - sh:path sh:equals ; - sh:nodeKind sh:IRI ; # equals-nodeKind - ] ; - sh:property [ - sh:path sh:in ; - sh:maxCount 1 ; # in-maxCount - sh:node shsh:ListShape ; # in-node - ] ; - sh:property [ - sh:path sh:languageIn ; - sh:maxCount 1 ; # languageIn-maxCount - sh:node shsh:ListShape ; # languageIn-node - ] ; - sh:property [ - sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:datatype xsd:string ; # languageIn-members-datatype - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:nodeKind sh:IRI ; # lessThan-nodeKind - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:datatype xsd:integer ; # maxCount-datatype - sh:maxCount 1 ; # maxCount-maxCount - ] ; - sh:property [ - sh:path sh:maxExclusive ; - sh:maxCount 1 ; # maxExclusive-maxCount - sh:nodeKind sh:Literal ; # maxExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxInclusive ; - sh:maxCount 1 ; # maxInclusive-maxCount - sh:nodeKind sh:Literal ; # maxInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxLength ; - sh:datatype xsd:integer ; # maxLength-datatype - sh:maxCount 1 ; # maxLength-maxCount - ] ; - sh:property [ - sh:path sh:minCount ; - sh:datatype xsd:integer ; # minCount-datatype - sh:maxCount 1 ; # minCount-maxCount - ] ; - sh:property [ - sh:path sh:minExclusive ; - sh:maxCount 1 ; # minExclusive-maxCount - sh:nodeKind sh:Literal ; # minExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minInclusive ; - sh:maxCount 1 ; # minInclusive-maxCount - sh:nodeKind sh:Literal ; # minInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minLength ; - sh:datatype xsd:integer ; # minLength-datatype - sh:maxCount 1 ; # minLength-maxCount - ] ; - sh:property [ - sh:path sh:nodeKind ; - sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in - sh:maxCount 1 ; # nodeKind-maxCount - ] ; - sh:property [ - sh:path sh:or ; - sh:node shsh:ListShape ; # or-node - ] ; - sh:property [ - sh:path sh:pattern ; - sh:datatype xsd:string ; # pattern-datatype - sh:maxCount 1 ; # multiple-parameters - # Not implemented: syntax rule pattern-regex - ] ; - sh:property [ - sh:path sh:flags ; - sh:datatype xsd:string ; # flags-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMaxCount ; - sh:datatype xsd:integer ; # qualifiedMaxCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMinCount ; - sh:datatype xsd:integer ; # qualifiedMinCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShapesDisjoint ; - sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:datatype xsd:boolean ; # uniqueLang-datatype - sh:maxCount 1 ; # uniqueLang-maxCount - ] ; - sh:property [ - sh:path sh:xone ; - sh:node shsh:ListShape ; # xone-node - ] . - -shsh:NodeShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:node ; # node-node - sh:property [ - sh:path sh:path ; - sh:maxCount 0 ; # NodeShape-path-maxCount - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:maxCount 0 ; # lessThan-scope - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:maxCount 0 ; # lessThanOrEquals-scope - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:maxCount 0 ; # maxCount-scope - ] ; - sh:property [ - sh:path sh:minCount ; - sh:maxCount 0 ; # minCount-scope - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 0 ; # qualifiedValueShape-scope - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:maxCount 0 ; # uniqueLang-scope - ] . - -shsh:PropertyShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:property ; # property-node - sh:property [ - sh:path sh:path ; - sh:maxCount 1 ; # path-maxCount - sh:minCount 1 ; # PropertyShape-path-minCount - sh:node shsh:PathShape ; # path-node - ] . - -# Values of sh:and, sh:or and sh:xone must be lists of shapes -shsh:ShapesListShape - a sh:NodeShape ; - sh:targetObjectsOf sh:and ; # and-members-node - sh:targetObjectsOf sh:or ; # or-members-node - sh:targetObjectsOf sh:xone ; # xone-members-node - sh:property [ - sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:node shsh:ShapeShape ; - ] . - - -# A path of blank node path syntax, used to simulate recursion -_:PathPath - sh:alternativePath ( - ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - sh:inversePath - sh:zeroOrMorePath - sh:oneOrMorePath - sh:zeroOrOnePath - ) . - -shsh:PathShape - a sh:NodeShape ; - rdfs:label "Path shape"@en ; - rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath _:PathPath ] ; - sh:node shsh:PathNodeShape ; - ] . - -shsh:PathNodeShape - sh:xone ( # path-metarule - [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path - [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path - sh:node shsh:PathListWithAtLeast2Members ; - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path - sh:closed true ; - sh:property [ - sh:path sh:alternativePath ; - sh:node shsh:PathListWithAtLeast2Members ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path - sh:closed true ; - sh:property [ - sh:path sh:inversePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path - sh:closed true ; - sh:property [ - sh:path sh:oneOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrOnePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - ) . - -shsh:PathListWithAtLeast2Members - a sh:NodeShape ; - sh:node shsh:ListShape ; - sh:property [ - sh:path [ sh:oneOrMorePath rdf:rest ] ; - sh:minCount 2 ; # 1 other list node plus rdf:nil - ] . - -shsh:ShapesGraphShape - a sh:NodeShape ; - sh:targetObjectsOf sh:shapesGraph ; - sh:nodeKind sh:IRI . # shapesGraph-nodeKind - -shsh:EntailmentShape - a sh:NodeShape ; - sh:targetObjectsOf sh:entailment ; - sh:nodeKind sh:IRI . # entailment-nodeKind - diff --git a/src/main/resources/shapes/rml-cc/tests.py b/src/main/resources/shapes/rml-cc/tests.py deleted file mode 100644 index 91dfdde..0000000 --- a/src/main/resources/shapes/rml-cc/tests.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python -# -# (c) Dylan Van Assche (2020 - 2023) -# IDLab - Ghent University - imec -# MIT license -# - -import os -import argparse -import unittest -import logging -from parameterized import parameterized -from glob import glob -from rdflib import Graph - -from mapping_validator import MappingValidator - -TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), - '*/mapping.ttl') -CC_SHAPE_FILE = os.path.abspath('cc.ttl') -SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') - - -class MappingValidatorTests(unittest.TestCase): - def _validate_rules(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(CC_SHAPE_FILE) - mapping_validator.validate(rules) - - def _validate_shapes(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(SHACL_SHAPE_FILE) - mapping_validator.validate(rules) - - def test_non_existing_mapping_rules(self) -> None: - with self.assertRaises(FileNotFoundError): - p = os.path.abspath('does_not_exist.ttl') - self._validate_rules(p) - - @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], - skip_on_empty=True) - def test_validation_rules(self, path: str) -> None: - """ - Test if our SHACL shapes are able to validate our validation mapping - rules test cases. - """ - print(f'Testing validation with: {path}') - self._validate_rules(path) - - def test_validation_shapes(self) -> None: - """ - Test if our SHACL shapes are valid according to the W3C Recommdendation - of SHACL. Validation with the official SHACL shapes for SHACL. - - See https://www.w3.org/TR/shacl/#shacl-shacl - """ - path = './cc.ttl' - print(f'Testing shape with: {path}') - self._validate_shapes(path) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Execute tests for SHACL ' - 'shapes on RML mapping rules.') - parser.add_argument('--verbose', '-v', action='count', default=1, - help='Set verbosity level of messages. Example: -vvv') - args = parser.parse_args() - - args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 - logging.basicConfig(level=args.verbose, - format='%(asctime)s %(levelname)s: %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - - print(TEST_CASES_DIR) - unittest.main(failfast=True) - diff --git a/src/main/resources/shapes/rml-core/README.md b/src/main/resources/shapes/rml-core/README.md deleted file mode 100644 index 54f1239..0000000 --- a/src/main/resources/shapes/rml-core/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# SHACL shapes for RML mapping rules - -SHACL shapes to validate RML mapping rules. - -## License - -This code is copyrighted by [IDLab – Ghent University – imec](http://idlab.ugent.be/) and released under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/src/main/resources/shapes/rml-core/child_map.ttl b/src/main/resources/shapes/rml-core/child_map.ttl deleted file mode 100644 index a867cea..0000000 --- a/src/main/resources/shapes/rml-core/child_map.ttl +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################### -# RML Child Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLChildMapShape - a sh:NodeShape ; - sh:targetClass rml:ChildMap ; - sh:targetObjectsOf rml:childMap ; - rdfs:label "ChildMap" ; - rdfs:comment """ - Represents a Child Map. - """ ; - sh:message """ - rml:ChildMap must specify a literal referencing data in the child data - source. - """ ; - - sh:and ( - # Inherited shapes - :RMLExpressionMapShape - # Child Map specific shapes - [ - ] - ) ; -. - -:RMLchildShape - a sh:NodeShape ; - sh:targetObjectsOf rml:child ; - rdfs:label "child" ; - rdfs:comment """ - A Literal reference to use as reference to the child data source. - """ ; - sh:message """ - rml:child shortcut for rml:ChildMap must be a Literal. - """ ; - sh:nodeKind sh:Literal ; - sh:datatype xsd:string ; -. diff --git a/src/main/resources/shapes/rml-core/core.ttl b/src/main/resources/shapes/rml-core/core.ttl deleted file mode 100644 index 75df289..0000000 --- a/src/main/resources/shapes/rml-core/core.ttl +++ /dev/null @@ -1,784 +0,0 @@ -@prefix brick: . -@prefix csvw: . -@prefix dc: . -@prefix dcam: . -@prefix dcat: . -@prefix dcmitype: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix geo: . -@prefix odrl: . -@prefix org: . -@prefix owl: . -@prefix prof: . -@prefix prov: . -@prefix qb: . -@prefix rdf: . -@prefix rdfs: . -@prefix rml: . -@prefix schema: . -@prefix sh: . -@prefix skos: . -@prefix sosa: . -@prefix ssn: . -@prefix time: . -@prefix vann: . -@prefix void: . -@prefix wgs: . -@prefix xml: . -@prefix xsd: . - - a sh:NodeShape ; - rdfs:label "ChildMap" ; - rdfs:comment """ - Represents a Child Map. - """ ; - sh:and ( [ ] ) ; - sh:message """ - rml:ChildMap must specify a literal referencing data in the child data - source. - """ ; - sh:targetClass ; - sh:targetObjectsOf . - - a sh:NodeShape ; - rdfs:label "DatatypeMap" ; - rdfs:comment """ - Represents a Datatype Map. - """ ; - sh:and ( [ ] ) ; - sh:message """ - rml:DatatypeMap must specify an rml:template, rml:reference, or rml:constant - with the IRI of the datatype. - """ ; - sh:targetClass rml:DatatypeMap ; - sh:targetObjectsOf rml:datatypeMap . - - a sh:NodeShape ; - rdfs:label "GraphMap" ; - rdfs:comment """ - Represents a Graph Map. - """ ; - sh:and ( [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode ) ; - sh:message """ - rml:termType must be an rml:IRI, rml:UnsafeIRI, rml:URI, - rml:UnsafeURI, or rml:BlankNode for a Graph Map. - """ ; - sh:path rml:termType ] ) ; - sh:message """ - rml:GraphMap must specify an rml:template, rml:reference or rml:constant - with the IRI of the Named Graph. - """ ; - sh:targetClass rml:GraphMap ; - sh:targetObjectsOf rml:graphMap . - - a sh:NodeShape ; - rdfs:label "Join" ; - rdfs:comment """ - Represents a Join. - """ ; - sh:message """ - rml:Join must specify exactly one rml:parent/rml:parentMap - and rml:child/rml:childMap. - """ ; - sh:property [ rdfs:label "parentMap/parent" ; - rdfs:comment """ - rml:parent/rml:parentMap may only be provided once and - not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:parentMap rml:parent ) ] ], - [ rdfs:label "childMap" ; - rdfs:comment """ - Specifies the child of the object component for joining. - """ ; - sh:message """ - rml:childMap must point to a rml:ChildMap specifying the - child of the Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:childMap ; - sh:targetSubjectsOf rml:childMap ], - [ rdfs:label "child" ; - rdfs:comment """ - Specifies the child of the object component for joining. - """ ; - sh:nodeKind sh:Literal ; - sh:path rml:child ; - sh:targetSubjectsOf rml:child ], - [ rdfs:label "parentMap" ; - rdfs:comment """ - Specifies the parent of the object component for joining. - """ ; - sh:message """ - rml:parentMap must point to a rml:ParentMap specifying the - parent tag of the string Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:parentMap ; - sh:targetSubjectsOf rml:parentMap ], - [ rdfs:label "parent" ; - rdfs:comment """ - Specifies the parent of the object component for joining. - """ ; - sh:nodeKind sh:Literal ; - sh:path rml:parent ; - sh:targetSubjectsOf rml:parent ], - [ rdfs:label "childMap/child" ; - rdfs:comment """ - rml:child/rml:childMap may only be provided once and - not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:childMap rml:child ) ] ] ; - sh:targetClass rml:Join ; - sh:targetObjectsOf rml:joinCondition . - - a sh:NodeShape ; - rdfs:label "LanguageMap" ; - rdfs:comment """ - Represents a Language Map. - """ ; - sh:and ( [ sh:path rml:constant ; - sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ] ) ; - sh:message """ - rml:LanguageMap must specify an rml:template, rml:reference, or rml:constant - with the BCP47 name of the language as string. - """ ; - sh:targetClass rml:LanguageMap ; - sh:targetObjectsOf rml:languageMap . - - a sh:NodeShape ; - rdfs:label "ParentMap" ; - rdfs:comment """ - Represents a Parent Map. - """ ; - sh:and ( [ ] ) ; - sh:message """ - rml:ParentMap must specify a literal referencing data in the parent data - source. - """ ; - sh:targetClass rml:ParentMap ; - sh:targetObjectsOf rml:parentMap . - - a sh:NodeShape ; - rdfs:label "PredicateMap" ; - rdfs:comment """ - Represents a Predicate Map. - """ ; - sh:and ( [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI ) ; - sh:message """ - rml:termType for Predicate Map can only be a rml:IRI, rml:UnsafeIRI, - rml:URI, or rml:UnsafeURI; - """ ; - sh:path rml:termType ] ) ; - sh:message """ - Predicate Object Map must generate an IRI representing the predicate of an - RDF triple. - """ ; - sh:targetClass rml:PredicateMap ; - sh:targetObjectsOf rml:predicateMap . - - a sh:NodeShape ; - rdfs:label "PredicateObjectMap" ; - rdfs:comment """ - Represents a Predicate Object Map. - """ ; - sh:and ( [ rdfs:label "predicate/predicateMap" ; - rdfs:comment """ - At least one rml:predicate or rml:predicateMap must be provided. - """ ; - sh:message """ - At least one rml:predicate or rml:predicateMap must be provided. - """ ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:predicate rml:predicateMap ) ] ; - sh:targetSubjectsOf rml:predicate, - rml:predicateMap ] [ rdfs:label "predicateMap" ; - rdfs:comment """ - A PredicateMap element to generate the predicate component of the - (predicate, object) pair from a logical table row or iterator. - """ ; - sh:message """ - rml:predicateMap must be an IRI or blank node and be provided once. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:predicateMap ; - sh:targetSubjectsOf rml:predicateMap ] [ rdfs:label "predicate" ; - rdfs:comment """ - Specifies the predicate for the generated triple from the logical table - row or iterator. - """ ; - sh:message """ - rml:predicate must be an IRI and be provided once. - """ ; - sh:nodeKind sh:IRI ; - sh:path rml:predicate ; - sh:targetSubjectsOf rml:predicate ] [ rdfs:label "object/objectMap/quotedTriplesMap" ; - rdfs:comment """ - Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple. - """ ; - sh:message """ - Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple - """ ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:object rml:objectMap rml:quotedTriplesMap ) ] ; - sh:targetSubjectsOf rml:object, - rml:objectMap, - rml:quotedTriplesMap ] [ rdfs:label "objectMap" ; - rdfs:comment """ - An ObjectMap element to generate the object component of the - (predicate, object) pair from a logical table row or iterator. - """ ; - sh:message """ - rml:objectMap must be an IRI or blank node and be provided once. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( [ sh:node ] [ sh:node ] [ sh:node ] ) ; - sh:path rml:objectMap ; - sh:targetSubjectsOf rml:objectMap ] [ rdfs:label "object" ; - rdfs:comment """ - Specifies the object for the generated RDF triples. - """ ; - sh:message """ - rml:object must be an IRI and be provided once. - """ ; - sh:path rml:object ; - sh:targetSubjectsOf rml:object ] ) ; - sh:targetClass rml:PredicateObjectMap ; - sh:targetObjectsOf rml:predicateObjectMap . - - a sh:NodeShape ; - rdfs:label "Strategy" ; - rdfs:comment """ - Strategy to follow when generating RDF triples. - """ ; - sh:in ( rml:append rml:cartesianProduct ) ; - sh:message """ - Strategy must be either rml:append or rml:cartesianProduct. - """ ; - sh:targetObjectsOf rml:strategy . - - a sh:NodeShape ; - rdfs:label "TriplesMap" ; - rdfs:comment """ - Represents a Triples Map. - """ ; - sh:and ( [ ] ) ; - sh:message """ - Triples Map requires exactly one rml:subject or one rml:subjectMap and zero - or more rml:predicateObjectMaps. - """ ; - sh:targetClass rml:TriplesMap ; - sh:targetObjectsOf rml:parentTriplesMap . - - a sh:NodeShape ; - rdfs:label "child" ; - rdfs:comment """ - A Literal reference to use as reference to the child data source. - """ ; - sh:datatype xsd:string ; - sh:message """ - rml:child shortcut for rml:ChildMap must be a Literal. - """ ; - sh:nodeKind sh:Literal ; - sh:targetObjectsOf . - - a sh:NodeShape ; - rdfs:label "datatype" ; - rdfs:comment """ - An IRI reference for use as the graph name of all triples generated with - the datatype. - """ ; - sh:message """ - rml:datatype must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - sh:targetObjectsOf rml:datatype . - - a sh:NodeShape ; - rdfs:label "graph" ; - rdfs:comment """ - An IRI reference for use as the graph name of all triples generated with - the Graph Map. - """ ; - sh:message """ - rml:graph must be an IRI or blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:targetObjectsOf rml:graph . - - a sh:NodeShape ; - rdfs:label "language" ; - rdfs:comment """ - Specified the language for the generated Literal. - """ ; - sh:message """ - rml:language must be a valid language tag according to BCP47 and may - only be provided once as string. - """ ; - sh:nodeKind sh:Literal ; - sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ; - sh:targetObjectsOf rml:language . - - a sh:NodeShape ; - rdfs:label "object" ; - rdfs:comment """ - An IRI, Blank Node, or Literal to use as object for all the RDF triples. - """ ; - sh:message """ - rml:object shortcut for rml:objectMap must be an IRI, Blank Node, - or Literal. - """ ; - sh:targetObjectsOf rml:object . - - a sh:NodeShape ; - rdfs:label "parent" ; - rdfs:comment """ - A Literal reference to use as reference to the parent data source. - """ ; - sh:datatype xsd:string ; - sh:message """ - rml:parent shortcut for rml:ParentMap must be a Literal. - """ ; - sh:nodeKind sh:Literal ; - sh:targetObjectsOf rml:parent . - - a sh:NodeShape ; - rdfs:label "predicate" ; - rdfs:comment """ - Specifies the predicate for the generated triple. - """ ; - sh:message """ - rml:predicate must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - sh:targetObjectsOf rml:predicate . - - a sh:NodeShape ; - rdfs:label "subject" ; - rdfs:comment """ - An IRI reference to use as subject for all the RDF triples. - """ ; - sh:message """ - rml:subject shortcut for rml:SubjectMap must be a IRI or BlankNode. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:targetObjectsOf rml:subject . - - a sh:NodeShape ; - rdfs:label "Abstract Logical Source" ; - rdfs:comment """ - A sub-class of iterable that can be associated with a triples map such that a data source can be mapped to RDF triples. - """ ; - sh:message """ - rml:AbstractLogicalSource must specify how to generate logical iterations on a data source for a triples map. - """ ; - sh:node ; - sh:targetClass rml:AbstractLogicalSource ; - sh:targetObjectsOf rml:logicalSource . - - a sh:NodeShape ; - rdfs:label "Iterable" ; - rdfs:comment """ - An abstract construct to describe data access and iteration for a data source. - """ ; - sh:message """ - Iterable must specify how to generate logical iterations on a data source. - """ ; - sh:property [ rdfs:label "rml:referenceFormulation" ; - rdfs:comment """ - The reference formulation (rml:referenceFormulation) defines how to - reference to elements of the data of the input source. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:referenceFormulation must be a blank node or IRI specifying the - reference formulation on how to reference elements of a data source, - and may be provided at most once. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:referenceFormulation ], - [ rdfs:label "rml:iterator" ; - rdfs:comment """ - The logical iterator (rml:iterator) defines the iteration loop used to - map the data of the input source. Depends on the reference formulation - if an iterator is necessary. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:iterator specifies the iterator to iterate over - the data source, and may be provided at most once. - """ ; - sh:path rml:iterator ] ; - sh:targetClass rml:Iterable . - - a sh:PropertyShape ; - rdfs:label "joinCondition" ; - rdfs:comment """ - Specifies the join condition for joining a child data source with - a parent data source of the foreign key constraint. - """ ; - sh:message """ - rml:joinCondition must specify an rml:parent and rml:child. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:joinCondition ; - sh:targetSubjectsOf rml:joinCondition . - - a sh:NodeShape ; - rdfs:label "ObjectMap" ; - rdfs:comment """ - Represents an Object Map. - """ ; - sh:and ( [ rdfs:label "languageMap/datatypeMap/language/datatype" ; - rdfs:comment """ - rml:language/rml:languageMap and rml:datatype/rml:datatypeMap - may only be provided once and not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 0 ; - sh:path [ sh:alternativePath ( rml:languageMap rml:datatypeMap rml:language rml:datatype ) ] ] [ rdfs:label "languageMap" ; - rdfs:comment """ - Specified the language map for the object component for the - generated RDF triples. - """ ; - sh:message """ - rml:languageMap must point to a rml:LanguageMap specifying the - language tag of the string Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:languageMap ; - sh:targetSubjectsOf rml:languageMap ] [ rdfs:label "datatypeMap" ; - rdfs:comment """ - Specifies the datatype of the object component for the generated - RDF triples. - """ ; - sh:message """ - rml:datatypeMap must point to a rml:DatatypeMap specifying the - datatype of the Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:datatypeMap ; - sh:targetSubjectsOf rml:datatypeMap ] [ rdfs:label "language" ; - rdfs:comment """ - Language tag for the object. - """ ; - sh:nodeKind sh:Literal ; - sh:path rml:language ] [ rdfs:label "datatype" ; - rdfs:comment """ - Datatype for the object. - """ ; - sh:nodeKind sh:IRI ; - sh:path rml:datatype ; - sh:targetSubjectsOf rml:datatype ] ) ; - sh:message """ - Object Map must generate a IRI, Blank Node, or Literal which has optionally - a language tag or datatype. - """ ; - sh:targetClass rml:ObjectMap . - - a sh:NodeShape ; - rdfs:label "RefObjectMap" ; - rdfs:comment """ - Represents a Reference Object Map. - """ ; - sh:and ( [ rdfs:label "parentTriplesMap" ; - rdfs:comment """ - Specifies the Triples Map element corresponding to the parent data - source of the foreign key constraint. - """ ; - sh:class rml:TriplesMap ; - sh:maxCount 1 ; - sh:message """ - rml:parentTriplesMap may only be provided once and must be an IRI - or Blank Node referring to a Triples Map. - """ ; - sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:parentTriplesMap ; - sh:targetSubjectsOf rml:parentTriplesMap ] ) ; - sh:message """ - rml:RefObjectMap must specify a rml:parentTriplesMap and zero or more - rml:joinConditions. - """ ; - sh:targetClass rml:RefObjectMap . - - a sh:NodeShape ; - rdfs:label "SubjectMap" ; - rdfs:comment """ - Represents a Subject Map. - """ ; - sh:and ( [ rdfs:label "class" ; - rdfs:comment """ - The subject value generated will be asserted as an instance of this - RDFS class. - """ ; - sh:message """ - rml:class must be an IRI and may be specified multiple times. - """ ; - sh:nodeKind sh:IRI ; - sh:path rml:class ; - sh:targetSubjectsOf rml:class ] [ sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode ) ; - sh:message """ - rml:termType must be a rml:IRI, rml:UnsafeIRI, rml:URI, - rml:UnsafeURI, or rml:BlankNode for a Subject Map. - """ ; - sh:path rml:termType ] ) ; - sh:message """ - Subject Map must generate a resource representing the subject of - an RDF triple. - """ ; - sh:targetClass rml:SubjectMap ; - sh:targetObjectsOf rml:subjectMap . - - a sh:NodeShape ; - sh:property [ rdfs:label "logicalSource" ; - rdfs:comment """ - A logical source is any source that is mapped to RDF triples. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:logicalSource is required to access the data source. - """ ; - sh:minCount 1 ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:logicalSource ; - sh:targetSubjectsOf rml:logicalSource ], - [ rdfs:label "subject" ; - rdfs:comment """ - An IRI reference for use as subject for all generated RDF triples. - """ ; - sh:message """ - rml:subject must be an IRI or blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:subject ; - sh:targetSubjectsOf rml:subject ], - [ rdfs:label "predicateObjectMap" ; - rdfs:comment """ - A Predicate Object Map element to generate a (predicate, object) pair. - """ ; - sh:message """ - rml:PredicateObjectMap must be an IRI or blank node. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:predicateObjectMap ; - sh:targetSubjectsOf rml:predicateObjectMap ], - [ sh:description """ - Base IRI to use for generating RDF triples or quads. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:baseIRI must be an IRI. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:IRI ; - sh:path rml:baseIRI ], - [ rdfs:label "subjectMap/subject/quotedTriplesMap" ; - rdfs:comment """ - Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. - """ ; - sh:maxCount 1 ; - sh:message """ - Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. - """ ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:subjectMap rml:subject rml:quotedTriplesMap ) ] ; - sh:targetSubjectsOf rml:quotedTriplesMap, - rml:subject, - rml:subjectMap ], - [ rdfs:label "subjectMap" ; - rdfs:comment """ - A Subject Map element to generate a subject for generated RDF triples. - """ ; - sh:message """ - rml:SubjectMap must be an IRI or blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( [ sh:node ] [ sh:node ] ) ; - sh:path rml:subjectMap ; - sh:targetSubjectsOf rml:subjectMap ] ; - sh:targetClass rml:NonAssertedTriplesMap, - rml:TriplesMap . - - a sh:NodeShape ; - sh:property [ rdfs:label "graph/graphMap" ; - rdfs:comment """ - Either an rml:graph or rml:graphMap may be optionally be provided, - but not both. - """ ; - sh:maxCount 1 ; - sh:message """ - Either an rml:graph or rml:graphMap may be optionally be provided, - but not both. - """ ; - sh:minCount 0 ; - sh:path [ sh:alternativePath ( rml:graph rml:graphMap ) ] ], - [ rdfs:label "graphMap" ; - rdfs:comment """ - Specifies a Graph Map. When used with a Subject Map element, all the - RDF triples generated will be stored in the specified named graph. - Otherwise, the RDF triple generated using the (predicate, object) - pair will be stored in the specified named graph. - """ ; - sh:message """ - rml:graphMap must be either an IRI or blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:graphMap ], - [ rdfs:label "graph" ; - rdfs:comment """ - An IRI reference to use as the named graph of all generated triples. - """ ; - sh:message """ - rml:graphMap must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - sh:path rml:graph ] ; - sh:targetSubjectsOf rml:graph, - rml:graphMap . - - a sh:NodeShape . - - a sh:NodeShape ; - rdfs:label "TermMap" ; - rdfs:comment """ - Represents a Term Map. - """ ; - sh:and ( [ rdfs:label "termType" ; - rdfs:comment """ - An IRI indicating whether a generated term should be an IRI, - Blank Node, or a Literal. - """ ; - sh:in ( rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:Literal rml:BlankNode ) ; - sh:maxCount 1 ; - sh:message """ - rml:termType must be either rml:IRI, rml:UnsafeIRI, - rml:URI, rml:UnsafeURI, rml:Literal, or rml:BlankNode for a Term Map. - May only be provided once. - """ ; - sh:nodeKind sh:IRI ; - sh:path rml:termType ; - sh:targetSubjectsOf rml:termType ] ) ; - sh:message """ - Term Map is an Expression Map with optionally a term type specified. - """ . - - a sh:NodeShape ; - rdfs:label "ExpressionMap" ; - rdfs:comment """ - Represents a Expression Map. - """ ; - sh:message """ - Expression Map may require one rml:template or one rml:constant or one - rml:reference. - """ ; - sh:or ( [ sh:not [ sh:property [ sh:minCount 1 ; - sh:path rml:returnMap ] ] ] [ sh:property [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:path rml:returnMap ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:path rml:functionExecution ] ] ) ; - sh:property [ rdfs:label "template/constant/reference/functionExecution" ; - rdfs:comment """ - Only one rml:template, one rml:constant, one rml:reference, - or one rml:functionExecution is allowed. rml:returnMap is only allowed if rml:functionExecution is present. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:template, one rml:constant, one rml:reference, - one rml:returnMap, or one rml:functionExecution is required. - """ ; - sh:path [ sh:alternativePath ( rml:template rml:constant rml:reference rml:functionExecution ) ] ; - sh:targetSubjectsOf rml:constant, - rml:functionExecution, - rml:reference, - rml:template ], - [ rdfs:label "returnMap" ; - rdfs:comment """ - A Return Map rml:returnMap is used to define the return values of a FnO - function from the RML-FNML specification. RML Core only validates if the - property is present and has the right node kind. The actual validation - happens with RML-FNML SHACL shapes. - """ ; - sh:message """ - rml:returnMap must be an IRI; - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:returnMap ; - sh:targetSubjectsOf rml:returnMap ], - [ rdfs:label "functionExecution" ; - rdfs:comment """ - A Function Execution rml:functionExecution is used to define the FnO - function to execute from the RML-FNML specification. RML Core only - validates if the property is present and has the right node kind. - The actual validation happens with RML-FNML SHACL shapes. - """ ; - sh:message """ - rml:functionExecution must be an IRI; - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:functionExecution ; - sh:targetSubjectsOf rml:functionExecution ], - [ rdfs:label "template" ; - rdfs:comment """ - A template (format string) to specify how to generate a value for a - subject, predicate, or object, using one or more columns from a logical - table row or iterator. - """ ; - sh:datatype xsd:string ; - sh:message """ - rml:template must be a string. - """ ; - sh:nodeKind sh:Literal ; - sh:path rml:template ], - [ rdfs:label "constant" ; - rdfs:comment """ - A property for indicating whether a term map is a constant-valued term - map. - """ ; - sh:message """ - rml:constant must be an IRI or Literal. - """ ; - sh:path rml:constant ; - sh:targetSubjectsOf rml:constant ], - [ rdfs:label "reference" ; - rdfs:comment """ - A reference rml:reference is used to refer to a column in case of - databases, a record in case of CSV or TSV data source, an element in - case of XML data source, an object in case of a JSON data source, etc. - - A reference must be a valid identifier, considering the reference - formulation (rml:referenceFormulation) specified. The reference can be - an absolute path, or a path relative to the iterator specified at the - logical source. - """ ; - sh:datatype xsd:string ; - sh:message """ - rml:reference must be a string. - """ ; - sh:nodeKind sh:Literal ; - sh:path rml:reference ; - sh:targetSubjectsOf rml:reference ] . - - a sh:PropertyShape ; - rdfs:label "logicalTarget" ; - rdfs:comment """ - A logical target is any target to where generated RDF triples are - exported to. - """ ; - sh:message """ - Zero or more rml:logicalTarget is required to export RDF triples. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:logicalTarget ; - sh:targetSubjectsOf rml:logicalTarget . - diff --git a/src/main/resources/shapes/rml-core/datatype_map.ttl b/src/main/resources/shapes/rml-core/datatype_map.ttl deleted file mode 100644 index b56da66..0000000 --- a/src/main/resources/shapes/rml-core/datatype_map.ttl +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################### -# RML Datatype Map and datatype shortcut shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLDatatypeMapShape - a sh:NodeShape ; - sh:targetClass rml:DatatypeMap ; - sh:targetObjectsOf rml:datatypeMap ; - rdfs:label "DatatypeMap" ; - rdfs:comment """ - Represents a Datatype Map. - """ ; - sh:message """ - rml:DatatypeMap must specify an rml:template, rml:reference, or rml:constant - with the IRI of the datatype. - """ ; - - sh:and ( - # Inherited shapes - :RMLExpressionMapShape - # Datatype Map specific shapes - [ - ] - ) ; -. - - -:RMLdatatypeShape - a sh:NodeShape ; - sh:targetObjectsOf rml:datatype ; - rdfs:label "datatype" ; - rdfs:comment """ - An IRI reference for use as the graph name of all triples generated with - the datatype. - """ ; - sh:message """ - rml:datatype must be an IRI. - """ ; - sh:nodeKind sh:IRI ; -. diff --git a/src/main/resources/shapes/rml-core/expression_map.ttl b/src/main/resources/shapes/rml-core/expression_map.ttl deleted file mode 100644 index 35e23db..0000000 --- a/src/main/resources/shapes/rml-core/expression_map.ttl +++ /dev/null @@ -1,159 +0,0 @@ -############################################################################### -# RML Expression Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLExpressionMapShape - a sh:NodeShape ; - rdfs:label "ExpressionMap" ; - rdfs:comment """ - Represents a Expression Map. - """ ; - sh:message """ - Expression Map may require one rml:template or one rml:constant or one - rml:reference. - """ ; - - # Exactly one rml:template, one rml:constant, one rml:reference, - # one rml:returnMap, or one rml:functionExecution is required. - sh:property [ - sh:targetSubjectsOf rml:template ; - sh:targetSubjectsOf rml:constant ; - sh:targetSubjectsOf rml:reference ; - sh:targetSubjectsOf rml:functionExecution ; - sh:path [sh:alternativePath (rml:template - rml:constant - rml:reference - rml:functionExecution)] ; - rdfs:label "template/constant/reference/functionExecution" ; - rdfs:comment """ - Only one rml:template, one rml:constant, one rml:reference, - or one rml:functionExecution is allowed. rml:returnMap is only allowed if rml:functionExecution is present. - """ ; - sh:message """ - Exactly one rml:template, one rml:constant, one rml:reference, - one rml:returnMap, or one rml:functionExecution is required. - """ ; - sh:maxCount 1 ; - ] ; - - # rml:template - sh:property [ - sh:path rml:template ; - rdfs:label "template" ; - rdfs:comment """ - A template (format string) to specify how to generate a value for a - subject, predicate, or object, using one or more columns from a logical - table row or iterator. - """ ; - sh:message """ - rml:template must be a string. - """ ; - sh:nodeKind sh:Literal ; - sh:datatype xsd:string ; - ] ; - - # rml:constant - sh:property [ - sh:targetSubjectsOf rml:constant ; - sh:path rml:constant ; - rdfs:label "constant" ; - rdfs:comment """ - A property for indicating whether a term map is a constant-valued term - map. - """ ; - sh:message """ - rml:constant must be an IRI or Literal. - """ ; - # Allow BlankNodes so ex:Student works as well for rml:constant - ] ; - - # rml:reference - sh:property [ - sh:targetSubjectsOf rml:reference ; - sh:path rml:reference ; - rdfs:label "reference" ; - rdfs:comment """ - A reference rml:reference is used to refer to a column in case of - databases, a record in case of CSV or TSV data source, an element in - case of XML data source, an object in case of a JSON data source, etc. - - A reference must be a valid identifier, considering the reference - formulation (rml:referenceFormulation) specified. The reference can be - an absolute path, or a path relative to the iterator specified at the - logical source. - """ ; - sh:message """ - rml:reference must be a string. - """ ; - sh:nodeKind sh:Literal ; - sh:datatype xsd:string ; - ] ; - - # rml:returnMap - sh:property [ - sh:targetSubjectsOf rml:returnMap ; - sh:path rml:returnMap ; - rdfs:label "returnMap" ; - rdfs:comment """ - A Return Map rml:returnMap is used to define the return values of a FnO - function from the RML-FNML specification. RML Core only validates if the - property is present and has the right node kind. The actual validation - happens with RML-FNML SHACL shapes. - """ ; - sh:message """ - rml:returnMap must be an IRI; - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - # Allow BlankNodes so nested structurces works as well for rml:returnMap - ] ; - - # rml:functionExecution - sh:property [ - sh:targetSubjectsOf rml:functionExecution ; - sh:path rml:functionExecution ; - rdfs:label "functionExecution" ; - rdfs:comment """ - A Function Execution rml:functionExecution is used to define the FnO - function to execute from the RML-FNML specification. RML Core only - validates if the property is present and has the right node kind. - The actual validation happens with RML-FNML SHACL shapes. - """ ; - sh:message """ - rml:functionExecution must be an IRI; - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - # Allow BlankNodes so nested structurces works as well for rml:returnMap - ] ; - # If returnMap appears, then functionExecution must also appear - sh:or ( - - [ - sh:not [ - sh:property [ - sh:path rml:returnMap ; - sh:minCount 1 - ] - ] - ] - - [ - sh:property [ - sh:path rml:returnMap ; - sh:minCount 1 ; - sh:maxCount 1 - ] ; - sh:property [ - sh:path rml:functionExecution ; - sh:minCount 1 ; - sh:maxCount 1 - ] - ] - ) -. diff --git a/src/main/resources/shapes/rml-core/external_shapes.ttl b/src/main/resources/shapes/rml-core/external_shapes.ttl deleted file mode 100644 index 066b10e..0000000 --- a/src/main/resources/shapes/rml-core/external_shapes.ttl +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################### -# RML external resources shapes # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # -############################################################################### -@prefix sh: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Shapes are defined in the corresponding repositories of each specification -# Provide their IRI as stub to allow validation in Core. - -:RMLStarMapShape - a sh:NodeShape; -. diff --git a/src/main/resources/shapes/rml-core/generate_shape.py b/src/main/resources/shapes/rml-core/generate_shape.py deleted file mode 100644 index a480b20..0000000 --- a/src/main/resources/shapes/rml-core/generate_shape.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -import argparse -import sys -from os import path -from glob import glob -from rdflib import Graph, Namespace -from rdflib.plugins.serializers.turtle import TurtleSerializer -from rdflib import plugin - -SUBSHAPE_FORMAT = 'turtle' -SUBSHAPE_GLOB_PATTERN = '*.ttl' -SHACL = Namespace('http://www.w3.org/ns/shacl#') -RML = Namespace('http://w3id.org/rml/') - - -class TurtleWithPrefixes(TurtleSerializer): - """ - A turtle serializer that always emits prefixes - Workaround for https://github.com/RDFLib/rdflib/issues/1048 - """ - roundtrip_prefixes = True # Undocumented, forces to write all prefixes - - -class ShapeGenerator: - """ - Generates a complete SHACL shape of all the SHACL subshapes. - Useful for using the shapes in the shacl.org Playground. - """ - def __init__(self, glob_pattern: str, rdf_format: str, - destination: str) -> None: - self._glob_pattern: str = glob_pattern - self._rdf_format: str = rdf_format - self._destination: str = destination - self._shape = Graph() - self._shape.bind('sh', SHACL) - self._shape.bind('rml', RML) - # Register TurtleWithPrefixes serializer as 'tortoise' format - plugin.register('tortoise', - plugin.Serializer, - 'generate_shape', - 'TurtleWithPrefixes') - - def generate(self) -> None: - """ - Generate a full shape from the sub shapes. - """ - print('Reading subshapes:') - for sub_shape in glob(self._glob_pattern): - if 'core' in sub_shape or 'shacl' in sub_shape: - continue - print(f"\t{sub_shape}") - g = Graph() - g.bind('sh', SHACL) - g.bind('rml', RML) - self._shape += g.parse(sub_shape, format=self._rdf_format) - - print(f'Writing shape to {self._destination}') - self._shape.serialize(destination=self._destination, format='tortoise') - - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' - 'from the subshapes.') - p.add_argument('destination', type=str, help='Location to write the ' - 'complete SHACL shape as Turtle.') - # Arguments parsing - args = p.parse_args() - if not path.exists(args.destination): - print(f'{args.destination} file path does not exist!') - sys.exit(1) - - if path.isdir(args.destination): - args.destination = path.join(args.destination, 'core.ttl') - - # Generate shape - generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, - args.destination) - generator.generate() diff --git a/src/main/resources/shapes/rml-core/graph_map.ttl b/src/main/resources/shapes/rml-core/graph_map.ttl deleted file mode 100644 index 6b7d691..0000000 --- a/src/main/resources/shapes/rml-core/graph_map.ttl +++ /dev/null @@ -1,55 +0,0 @@ -############################################################################### -# RML Graph Map and graph shortcut shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLGraphMapShape - a sh:NodeShape ; - sh:targetClass rml:GraphMap ; - sh:targetObjectsOf rml:graphMap ; - rdfs:label "GraphMap" ; - rdfs:comment """ - Represents a Graph Map. - """ ; - sh:message """ - rml:GraphMap must specify an rml:template, rml:reference or rml:constant - with the IRI of the Named Graph. - """ ; - - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLLogicalTargetPropertiesShape - # Graph Map specific shapes - [ - sh:path rml:termType; - sh:message """ - rml:termType must be an rml:IRI, rml:UnsafeIRI, rml:URI, - rml:UnsafeURI, or rml:BlankNode for a Graph Map. - """; - sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode); - ] - ) ; -. - - -:RMLgraphShape - a sh:NodeShape ; - sh:targetObjectsOf rml:graph ; - rdfs:label "graph" ; - rdfs:comment """ - An IRI reference for use as the graph name of all triples generated with - the Graph Map. - """ ; - sh:message """ - rml:graph must be an IRI or blank node. - """ ; - # Allow blank nodes because SHACL sees ex:PersonGraph also as blank node. - sh:nodeKind sh:BlankNodeOrIRI ; -. diff --git a/src/main/resources/shapes/rml-core/iterable.ttl b/src/main/resources/shapes/rml-core/iterable.ttl deleted file mode 100644 index 7a81f3a..0000000 --- a/src/main/resources/shapes/rml-core/iterable.ttl +++ /dev/null @@ -1,65 +0,0 @@ -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLIterableShape - a sh:NodeShape ; - sh:targetClass rml:Iterable ; - rdfs:label "Iterable" ; - rdfs:comment """ - An abstract construct to describe data access and iteration for a data source. - """ ; - sh:message """ - Iterable must specify how to generate logical iterations on a data source. - """ ; - - # rml:referenceFormulation - sh:property [ - sh:path rml:referenceFormulation ; - rdfs:label "rml:referenceFormulation" ; - rdfs:comment """ - The reference formulation (rml:referenceFormulation) defines how to - reference to elements of the data of the input source. - """ ; - sh:message """ - rml:referenceFormulation must be a blank node or IRI specifying the - reference formulation on how to reference elements of a data source, - and may be provided at most once. - """ ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; - - # rml:iterator - sh:property [ - sh:path rml:iterator ; - rdfs:label "rml:iterator" ; - rdfs:comment """ - The logical iterator (rml:iterator) defines the iteration loop used to - map the data of the input source. Depends on the reference formulation - if an iterator is necessary. - """ ; - sh:message """ - rml:iterator specifies the iterator to iterate over - the data source, and may be provided at most once. - """ ; - sh:maxCount 1 - ] ; -. - -:RMLAbstractLogicalSourceShape - a sh:NodeShape ; - sh:targetClass rml:AbstractLogicalSource ; - sh:targetObjectsOf rml:logicalSource ; - rdfs:label "Abstract Logical Source" ; - rdfs:comment """ - A sub-class of iterable that can be associated with a triples map such that a data source can be mapped to RDF triples. - """ ; - sh:message """ - rml:AbstractLogicalSource must specify how to generate logical iterations on a data source for a triples map. - """ ; - sh:node :RMLIterableShape ; -. diff --git a/src/main/resources/shapes/rml-core/join.ttl b/src/main/resources/shapes/rml-core/join.ttl deleted file mode 100644 index 4e2dbf8..0000000 --- a/src/main/resources/shapes/rml-core/join.ttl +++ /dev/null @@ -1,93 +0,0 @@ -############################################################################### -# RML Join shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023i - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLJoinShape - a sh:NodeShape ; - sh:targetClass rml:Join ; - sh:targetObjectsOf rml:joinCondition ; - rdfs:label "Join" ; - rdfs:comment """ - Represents a Join. - """ ; - sh:message """ - rml:Join must specify exactly one rml:parent/rml:parentMap - and rml:child/rml:childMap. - """ ; - - sh:property [ - sh:path [ sh:alternativePath ( rml:parentMap rml:parent ) ]; - rdfs:label "parentMap/parent" ; - rdfs:comment """ - rml:parent/rml:parentMap may only be provided once and - not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:targetSubjectsOf rml:parentMap ; - sh:path rml:parentMap ; - rdfs:label "parentMap" ; - rdfs:comment """ - Specifies the parent of the object component for joining. - """ ; - sh:message """ - rml:parentMap must point to a rml:ParentMap specifying the - parent tag of the string Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; - - sh:property [ - sh:targetSubjectsOf rml:parent ; - sh:path rml:parent ; - rdfs:label "parent" ; - rdfs:comment """ - Specifies the parent of the object component for joining. - """ ; - sh:nodeKind sh:Literal ; - ] ; - - sh:property [ - sh:path [ sh:alternativePath ( rml:childMap rml:child ) ]; - rdfs:label "childMap/child" ; - rdfs:comment """ - rml:child/rml:childMap may only be provided once and - not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - - sh:property [ - sh:targetSubjectsOf rml:childMap ; - sh:path rml:childMap ; - rdfs:label "childMap" ; - rdfs:comment """ - Specifies the child of the object component for joining. - """ ; - sh:message """ - rml:childMap must point to a rml:ChildMap specifying the - child of the Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; - - sh:property [ - sh:targetSubjectsOf rml:child ; - sh:path rml:child ; - rdfs:label "child" ; - rdfs:comment """ - Specifies the child of the object component for joining. - """ ; - sh:nodeKind sh:Literal ; - ] ; -. diff --git a/src/main/resources/shapes/rml-core/language_map.ttl b/src/main/resources/shapes/rml-core/language_map.ttl deleted file mode 100644 index 6ed2369..0000000 --- a/src/main/resources/shapes/rml-core/language_map.ttl +++ /dev/null @@ -1,50 +0,0 @@ -############################################################################### -# RML Language Map and language shortcut shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023i - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLLanguageMapShape - a sh:NodeShape ; - sh:targetClass rml:LanguageMap ; - sh:targetObjectsOf rml:languageMap ; - rdfs:label "LanguageMap" ; - rdfs:comment """ - Represents a Language Map. - """ ; - sh:message """ - rml:LanguageMap must specify an rml:template, rml:reference, or rml:constant - with the BCP47 name of the language as string. - """ ; - - sh:and ( - # Inherited shapes - :RMLExpressionMapShape - # Language Map specific shapes - [ - sh:path rml:constant ; - sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ; - ] - ) ; -. - - -:RMLlanguageShape - a sh:NodeShape ; - sh:targetObjectsOf rml:language ; - rdfs:label "language" ; - rdfs:comment """ - Specified the language for the generated Literal. - """ ; - sh:message """ - rml:language must be a valid language tag according to BCP47 and may - only be provided once as string. - """ ; - sh:pattern "^((?:(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?:([A-Za-z]{2,3}(-(?:[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4})(-(?:[A-Za-z]{4}))?(-(?:[A-Za-z]{2}|[0-9]{3}))?(-(?:[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?:[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?:x(-[A-Za-z0-9]{1,8})+))?)|(?:x(-[A-Za-z0-9]{1,8})+))$" ; - sh:nodeKind sh:Literal ; -. diff --git a/src/main/resources/shapes/rml-core/mapping_validator.py b/src/main/resources/shapes/rml-core/mapping_validator.py deleted file mode 100644 index dabb1d2..0000000 --- a/src/main/resources/shapes/rml-core/mapping_validator.py +++ /dev/null @@ -1,40 +0,0 @@ -from logging import debug, info, critical -from pyshacl import validate -from rdflib import Graph -from shutil import get_terminal_size - - -class MappingValidator: - def __init__(self, shape: str) -> None: - g = Graph() - g.parse(shape, format='turtle') - self._shape = g - - def validate(self, rules: Graph, print_report: bool = True) -> None: - valid: bool - report_graph: Graph - report_text: str - valid, report_graph, report_text = validate(rules, - shacl_graph=self._shape) - debug(f'RML rules valid: {valid}') - debug(f'SHACL validation report: {report_text}') - - # If mapping rules are invalid, print SHACL report and raise exception - if not valid and print_report: - self._print_report(report_text) - msg = 'RML mapping rules are invalid, a detailed explanation' \ - ' is available in the report' - critical(msg) - raise ValueError(msg) - - def _print_report(self, report_text: str) -> None: - tty_columns: int - tty_columns, _ = get_terminal_size() - info('-' * tty_columns) - title: str = 'RML rules validation report' - white_space: int = int((tty_columns - len(title)) / 2) - title = ' ' * white_space + title + ' ' * white_space - info(title) - info('-' * tty_columns) - info(report_text) - info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-core/object_map.ttl b/src/main/resources/shapes/rml-core/object_map.ttl deleted file mode 100644 index e10ae13..0000000 --- a/src/main/resources/shapes/rml-core/object_map.ttl +++ /dev/null @@ -1,100 +0,0 @@ -############################################################################### -# RML Object Map and object shortcut shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLObjectMapShape - a sh:NodeShape ; - sh:targetClass rml:ObjectMap ; - rdfs:label "ObjectMap" ; - rdfs:comment """ - Represents an Object Map. - """ ; - sh:message """ - Object Map must generate a IRI, Blank Node, or Literal which has optionally - a language tag or datatype. - """ ; - - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLLogicalTargetPropertiesShape - # Object Map specific shapes - [ - sh:path [ sh:alternativePath (rml:languageMap rml:datatypeMap - rml:language rml:datatype) ] ; - rdfs:label "languageMap/datatypeMap/language/datatype" ; - rdfs:comment """ - rml:language/rml:languageMap and rml:datatype/rml:datatypeMap - may only be provided once and not at the same time. - """ ; - sh:maxCount 1 ; - sh:minCount 0 ; - ] - [ - sh:path rml:languageMap ; - sh:targetSubjectsOf rml:languageMap ; - rdfs:label "languageMap" ; - rdfs:comment """ - Specified the language map for the object component for the - generated RDF triples. - """ ; - sh:message """ - rml:languageMap must point to a rml:LanguageMap specifying the - language tag of the string Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] - [ - sh:path rml:datatypeMap ; - sh:targetSubjectsOf rml:datatypeMap ; - rdfs:label "datatypeMap" ; - rdfs:comment """ - Specifies the datatype of the object component for the generated - RDF triples. - """ ; - sh:message """ - rml:datatypeMap must point to a rml:DatatypeMap specifying the - datatype of the Literal. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] - [ - sh:path rml:language ; - rdfs:label "language" ; - rdfs:comment """ - Language tag for the object. - """ ; - sh:nodeKind sh:Literal ; - ] - [ - sh:path rml:datatype ; - sh:targetSubjectsOf rml:datatype ; - rdfs:label "datatype" ; - rdfs:comment """ - Datatype for the object. - """ ; - sh:nodeKind sh:IRI ; - ] - ) ; -. - - -:RMLobjectShape - a sh:NodeShape ; - sh:targetObjectsOf rml:object ; - rdfs:label "object" ; - rdfs:comment """ - An IRI, Blank Node, or Literal to use as object for all the RDF triples. - """ ; - sh:message """ - rml:object shortcut for rml:objectMap must be an IRI, Blank Node, - or Literal. - """ ; -. diff --git a/src/main/resources/shapes/rml-core/parent_map.ttl b/src/main/resources/shapes/rml-core/parent_map.ttl deleted file mode 100644 index 9e338ce..0000000 --- a/src/main/resources/shapes/rml-core/parent_map.ttl +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################### -# RML Parent Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLParentMapShape - a sh:NodeShape ; - sh:targetClass rml:ParentMap ; - sh:targetObjectsOf rml:parentMap ; - rdfs:label "ParentMap" ; - rdfs:comment """ - Represents a Parent Map. - """ ; - sh:message """ - rml:ParentMap must specify a literal referencing data in the parent data - source. - """ ; - - sh:and ( - # Inherited shapes - :RMLExpressionMapShape - # Parent Map specific shapes - [ - ] - ) ; -. - -:RMLparentShape - a sh:NodeShape ; - sh:targetObjectsOf rml:parent ; - rdfs:label "parent" ; - rdfs:comment """ - A Literal reference to use as reference to the parent data source. - """ ; - sh:message """ - rml:parent shortcut for rml:ParentMap must be a Literal. - """ ; - sh:nodeKind sh:Literal ; - sh:datatype xsd:string ; -. diff --git a/src/main/resources/shapes/rml-core/predicate_map.ttl b/src/main/resources/shapes/rml-core/predicate_map.ttl deleted file mode 100644 index feb37bb..0000000 --- a/src/main/resources/shapes/rml-core/predicate_map.ttl +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################### -# RML Predicate Map and predicate shortcut shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLPredicateMapShape - a sh:NodeShape ; - sh:targetClass rml:PredicateMap ; - sh:targetObjectsOf rml:predicateMap ; - rdfs:label "PredicateMap" ; - rdfs:comment """ - Represents a Predicate Map. - """ ; - sh:message """ - Predicate Object Map must generate an IRI representing the predicate of an - RDF triple. - """ ; - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLLogicalTargetPropertiesShape - # Predicate Map specific shapes - [ - sh:path rml:termType; - sh:message """ - rml:termType for Predicate Map can only be a rml:IRI, rml:UnsafeIRI, - rml:URI, or rml:UnsafeURI; - """; - sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI); - ] - ) ; -. - - -:RMLpredicateShape - a sh:NodeShape ; - sh:targetObjectsOf rml:predicate ; - rdfs:label "predicate" ; - rdfs:comment """ - Specifies the predicate for the generated triple. - """ ; - sh:message """ - rml:predicate must be an IRI. - """ ; - sh:nodeKind sh:IRI ; -. diff --git a/src/main/resources/shapes/rml-core/predicate_object_map.ttl b/src/main/resources/shapes/rml-core/predicate_object_map.ttl deleted file mode 100644 index 56a6cfb..0000000 --- a/src/main/resources/shapes/rml-core/predicate_object_map.ttl +++ /dev/null @@ -1,107 +0,0 @@ -############################################################################### -# RML Predicate Object Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLPredicateObjectMapShape - a sh:NodeShape ; - sh:targetClass rml:PredicateObjectMap ; - sh:targetObjectsOf rml:predicateObjectMap ; - rdfs:label "PredicateObjectMap" ; - rdfs:comment """ - Represents a Predicate Object Map. - """; - - sh:and ( - # Inherited shapes - :RMLGraphMapPropertiesShape - :RMLLogicalTargetPropertiesShape - # Predicate Map specific shapes - [ - sh:targetSubjectsOf rml:predicate ; - sh:targetSubjectsOf rml:predicateMap ; - sh:path [sh:alternativePath (rml:predicate rml:predicateMap)] ; - rdfs:label "predicate/predicateMap" ; - rdfs:comment """ - At least one rml:predicate or rml:predicateMap must be provided. - """ ; - sh:message """ - At least one rml:predicate or rml:predicateMap must be provided. - """ ; - sh:minCount 1 ; - ] - [ - sh:targetSubjectsOf rml:predicateMap ; - sh:path rml:predicateMap ; - rdfs:label "predicateMap" ; - rdfs:comment """ - A PredicateMap element to generate the predicate component of the - (predicate, object) pair from a logical table row or iterator. - """ ; - sh:message """ - rml:predicateMap must be an IRI or blank node and be provided once. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] - [ - sh:targetSubjectsOf rml:predicate ; - sh:path rml:predicate ; - rdfs:label "predicate" ; - rdfs:comment """ - Specifies the predicate for the generated triple from the logical table - row or iterator. - """ ; - sh:message """ - rml:predicate must be an IRI and be provided once. - """ ; - sh:nodeKind sh:IRI ; - ] - [ - sh:targetSubjectsOf rml:object ; - sh:targetSubjectsOf rml:objectMap ; - sh:targetSubjectsOf rml:quotedTriplesMap ; - sh:path [sh:alternativePath (rml:object rml:objectMap rml:quotedTriplesMap)] ; - rdfs:label "object/objectMap/quotedTriplesMap" ; - rdfs:comment """ - Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple. - """ ; - sh:message """ - Either an rml:object, rml:objectMap, or rml:quotedTriplesMap must be provided, not multiple - """ ; - sh:minCount 1 ; - ] - [ - sh:targetSubjectsOf rml:objectMap ; - sh:path rml:objectMap ; - rdfs:label "objectMap" ; - rdfs:comment """ - An ObjectMap element to generate the object component of the - (predicate, object) pair from a logical table row or iterator. - """ ; - sh:message """ - rml:objectMap must be an IRI or blank node and be provided once. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ([sh:node :RMLObjectMapShape] - [sh:node :RMLRefObjectMapShape] - [sh:node :RMLStarMapShape]) ; - ] - [ - sh:targetSubjectsOf rml:object ; - sh:path rml:object ; - rdfs:label "object" ; - rdfs:comment """ - Specifies the object for the generated RDF triples. - """ ; - sh:message """ - rml:object must be an IRI and be provided once. - """ ; - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-core/ref_object_map.ttl b/src/main/resources/shapes/rml-core/ref_object_map.ttl deleted file mode 100644 index d4086c5..0000000 --- a/src/main/resources/shapes/rml-core/ref_object_map.ttl +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################### -# RML RefObjectMap shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLRefObjectMapShape - a sh:NodeShape ; - sh:targetClass rml:RefObjectMap ; - rdfs:label "RefObjectMap" ; - rdfs:comment """ - Represents a Reference Object Map. - """ ; - sh:message """ - rml:RefObjectMap must specify a rml:parentTriplesMap and zero or more - rml:joinConditions. - """ ; - - sh:and ( - # Inherited shapes - :RMLJoinConditionPropertiesShape - # RefObjectMap specific shapes - [ - sh:targetSubjectsOf rml:parentTriplesMap ; - sh:path rml:parentTriplesMap ; - rdfs:label "parentTriplesMap" ; - rdfs:comment """ - Specifies the Triples Map element corresponding to the parent data - source of the foreign key constraint. - """ ; - sh:message """ - rml:parentTriplesMap may only be provided once and must be an IRI - or Blank Node referring to a Triples Map. - """ ; - sh:class rml:TriplesMap ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-core/requirements.txt b/src/main/resources/shapes/rml-core/requirements.txt deleted file mode 100644 index 3d264b8..0000000 --- a/src/main/resources/shapes/rml-core/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -parameterized -rdflib -pyshacl diff --git a/src/main/resources/shapes/rml-core/shacl.ttl b/src/main/resources/shapes/rml-core/shacl.ttl deleted file mode 100644 index e37856a..0000000 --- a/src/main/resources/shapes/rml-core/shacl.ttl +++ /dev/null @@ -1,406 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - -@prefix shsh: . - -shsh: - rdfs:label "SHACL for SHACL"@en ; - rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; - sh:declare [ - sh:prefix "shsh" ; - sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; - ] . - - -shsh:ListShape - a sh:NodeShape ; - rdfs:label "List shape"@en ; - rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath rdf:rest ] ; - rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; - sh:hasValue rdf:nil ; - sh:node shsh:ListNodeShape ; - ] . - -shsh:ListNodeShape - a sh:NodeShape ; - rdfs:label "List node shape"@en ; - rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; - sh:or ( [ - sh:hasValue rdf:nil ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 0 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 0 ; - ] ; - ] - [ - sh:not [ sh:hasValue rdf:nil ] ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - ] ) . - -shsh:ShapeShape - a sh:NodeShape ; - rdfs:label "Shape shape"@en ; - rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; - - # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape - sh:targetClass sh:NodeShape ; - sh:targetClass sh:PropertyShape ; - sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; - sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, - sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, - sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, - sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, - sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; - - sh:targetObjectsOf sh:node ; # node-node - sh:targetObjectsOf sh:not ; # not-node - sh:targetObjectsOf sh:property ; # property-node - sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node - - # Shapes are either node shapes or property shapes - sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; - - sh:property [ - sh:path sh:targetNode ; - sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind - ] ; - sh:property [ - sh:path sh:targetClass ; - sh:nodeKind sh:IRI ; # targetClass-nodeKind - ] ; - sh:property [ - sh:path sh:targetSubjectsOf ; - sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind - ] ; - sh:property [ - sh:path sh:targetObjectsOf ; - sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind - ] ; - sh:or ( [ sh:not [ - sh:class rdfs:Class ; - sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) - ] ] - [ sh:nodeKind sh:IRI ] - ) ; # implicit-targetClass-nodeKind - - sh:property [ - sh:path sh:severity ; - sh:maxCount 1 ; # severity-maxCount - sh:nodeKind sh:IRI ; # severity-nodeKind - ] ; - sh:property [ - sh:path sh:message ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype - ] ; - sh:property [ - sh:path sh:deactivated ; - sh:maxCount 1 ; # deactivated-maxCount - sh:in ( true false ) ; # deactivated-datatype - ] ; - - sh:property [ - sh:path sh:and ; - sh:node shsh:ListShape ; # and-node - ] ; - sh:property [ - sh:path sh:class ; - sh:nodeKind sh:IRI ; # class-nodeKind - ] ; - sh:property [ - sh:path sh:closed ; - sh:datatype xsd:boolean ; # closed-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:ignoredProperties ; - sh:node shsh:ListShape ; # ignoredProperties-node - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind - ] ; - sh:property [ - sh:path sh:datatype ; - sh:nodeKind sh:IRI ; # datatype-nodeKind - sh:maxCount 1 ; # datatype-maxCount - ] ; - sh:property [ - sh:path sh:disjoint ; - sh:nodeKind sh:IRI ; # disjoint-nodeKind - ] ; - sh:property [ - sh:path sh:equals ; - sh:nodeKind sh:IRI ; # equals-nodeKind - ] ; - sh:property [ - sh:path sh:in ; - sh:maxCount 1 ; # in-maxCount - sh:node shsh:ListShape ; # in-node - ] ; - sh:property [ - sh:path sh:languageIn ; - sh:maxCount 1 ; # languageIn-maxCount - sh:node shsh:ListShape ; # languageIn-node - ] ; - sh:property [ - sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:datatype xsd:string ; # languageIn-members-datatype - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:nodeKind sh:IRI ; # lessThan-nodeKind - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:datatype xsd:integer ; # maxCount-datatype - sh:maxCount 1 ; # maxCount-maxCount - ] ; - sh:property [ - sh:path sh:maxExclusive ; - sh:maxCount 1 ; # maxExclusive-maxCount - sh:nodeKind sh:Literal ; # maxExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxInclusive ; - sh:maxCount 1 ; # maxInclusive-maxCount - sh:nodeKind sh:Literal ; # maxInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxLength ; - sh:datatype xsd:integer ; # maxLength-datatype - sh:maxCount 1 ; # maxLength-maxCount - ] ; - sh:property [ - sh:path sh:minCount ; - sh:datatype xsd:integer ; # minCount-datatype - sh:maxCount 1 ; # minCount-maxCount - ] ; - sh:property [ - sh:path sh:minExclusive ; - sh:maxCount 1 ; # minExclusive-maxCount - sh:nodeKind sh:Literal ; # minExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minInclusive ; - sh:maxCount 1 ; # minInclusive-maxCount - sh:nodeKind sh:Literal ; # minInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minLength ; - sh:datatype xsd:integer ; # minLength-datatype - sh:maxCount 1 ; # minLength-maxCount - ] ; - sh:property [ - sh:path sh:nodeKind ; - sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in - sh:maxCount 1 ; # nodeKind-maxCount - ] ; - sh:property [ - sh:path sh:or ; - sh:node shsh:ListShape ; # or-node - ] ; - sh:property [ - sh:path sh:pattern ; - sh:datatype xsd:string ; # pattern-datatype - sh:maxCount 1 ; # multiple-parameters - # Not implemented: syntax rule pattern-regex - ] ; - sh:property [ - sh:path sh:flags ; - sh:datatype xsd:string ; # flags-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMaxCount ; - sh:datatype xsd:integer ; # qualifiedMaxCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMinCount ; - sh:datatype xsd:integer ; # qualifiedMinCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShapesDisjoint ; - sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:datatype xsd:boolean ; # uniqueLang-datatype - sh:maxCount 1 ; # uniqueLang-maxCount - ] ; - sh:property [ - sh:path sh:xone ; - sh:node shsh:ListShape ; # xone-node - ] . - -shsh:NodeShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:node ; # node-node - sh:property [ - sh:path sh:path ; - sh:maxCount 0 ; # NodeShape-path-maxCount - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:maxCount 0 ; # lessThan-scope - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:maxCount 0 ; # lessThanOrEquals-scope - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:maxCount 0 ; # maxCount-scope - ] ; - sh:property [ - sh:path sh:minCount ; - sh:maxCount 0 ; # minCount-scope - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 0 ; # qualifiedValueShape-scope - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:maxCount 0 ; # uniqueLang-scope - ] . - -shsh:PropertyShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:property ; # property-node - sh:property [ - sh:path sh:path ; - sh:maxCount 1 ; # path-maxCount - sh:minCount 1 ; # PropertyShape-path-minCount - sh:node shsh:PathShape ; # path-node - ] . - -# Values of sh:and, sh:or and sh:xone must be lists of shapes -shsh:ShapesListShape - a sh:NodeShape ; - sh:targetObjectsOf sh:and ; # and-members-node - sh:targetObjectsOf sh:or ; # or-members-node - sh:targetObjectsOf sh:xone ; # xone-members-node - sh:property [ - sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:node shsh:ShapeShape ; - ] . - - -# A path of blank node path syntax, used to simulate recursion -_:PathPath - sh:alternativePath ( - ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - sh:inversePath - sh:zeroOrMorePath - sh:oneOrMorePath - sh:zeroOrOnePath - ) . - -shsh:PathShape - a sh:NodeShape ; - rdfs:label "Path shape"@en ; - rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath _:PathPath ] ; - sh:node shsh:PathNodeShape ; - ] . - -shsh:PathNodeShape - sh:xone ( # path-metarule - [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path - [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path - sh:node shsh:PathListWithAtLeast2Members ; - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path - sh:closed true ; - sh:property [ - sh:path sh:alternativePath ; - sh:node shsh:PathListWithAtLeast2Members ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path - sh:closed true ; - sh:property [ - sh:path sh:inversePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path - sh:closed true ; - sh:property [ - sh:path sh:oneOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrOnePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - ) . - -shsh:PathListWithAtLeast2Members - a sh:NodeShape ; - sh:node shsh:ListShape ; - sh:property [ - sh:path [ sh:oneOrMorePath rdf:rest ] ; - sh:minCount 2 ; # 1 other list node plus rdf:nil - ] . - -shsh:ShapesGraphShape - a sh:NodeShape ; - sh:targetObjectsOf sh:shapesGraph ; - sh:nodeKind sh:IRI . # shapesGraph-nodeKind - -shsh:EntailmentShape - a sh:NodeShape ; - sh:targetObjectsOf sh:entailment ; - sh:nodeKind sh:IRI . # entailment-nodeKind - diff --git a/src/main/resources/shapes/rml-core/shared_properties.ttl b/src/main/resources/shapes/rml-core/shared_properties.ttl deleted file mode 100644 index e757772..0000000 --- a/src/main/resources/shapes/rml-core/shared_properties.ttl +++ /dev/null @@ -1,198 +0,0 @@ -############################################################################### -# RML shared properties among resources shapes # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - - -:RMLTriplesMapPropertiesShape - a sh:NodeShape; - sh:targetClass rml:TriplesMap; - sh:targetClass rml:NonAssertedTriplesMap; - - sh:property [ - sh:targetSubjectsOf rml:logicalSource ; - sh:path rml:logicalSource ; - rdfs:label "logicalSource" ; - rdfs:comment """ - A logical source is any source that is mapped to RDF triples. - """ ; - sh:message """ - Exactly one rml:logicalSource is required to access the data source. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:node :RMLAbstractLogicalSourceShape ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - - sh:property [ - sh:targetSubjectsOf rml:subjectMap ; - sh:targetSubjectsOf rml:subject ; - sh:targetSubjectsOf rml:quotedTriplesMap ; - sh:path [sh:alternativePath (rml:subjectMap rml:subject rml:quotedTriplesMap)] ; - rdfs:label "subjectMap/subject/quotedTriplesMap" ; - rdfs:comment """ - Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. - """ ; - sh:message """ - Either a rml:subject, rml:subjectMap or a rml:quotedTriplesMap is required, not multiple. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - - sh:property [ - sh:targetSubjectsOf rml:subjectMap ; - sh:path rml:subjectMap ; - rdfs:label "subjectMap" ; - rdfs:comment """ - A Subject Map element to generate a subject for generated RDF triples. - """ ; - sh:message """ - rml:SubjectMap must be an IRI or blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ([sh:node :RMLSubjectMapShape] - [sh:node :RMLStarMapShape]) ; - ] ; - - # rml:subject - sh:property [ - sh:targetSubjectsOf rml:subject ; - sh:path rml:subject ; - rdfs:label "subject" ; - rdfs:comment """ - An IRI reference for use as subject for all generated RDF triples. - """ ; - sh:message """ - rml:subject must be an IRI or blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; - - # rml:predicateObjectMap - sh:property [ - sh:targetSubjectsOf rml:predicateObjectMap ; - sh:path rml:predicateObjectMap ; - rdfs:label "predicateObjectMap" ; - rdfs:comment """ - A Predicate Object Map element to generate a (predicate, object) pair. - """ ; - sh:message """ - rml:PredicateObjectMap must be an IRI or blank node. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; - - # rml:baseIRI - sh:property [ - sh:path rml:baseIRI ; - sh:description """ - Base IRI to use for generating RDF triples or quads. - """ ; - sh:message """ - rml:baseIRI must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - sh:minCount 0 ; - sh:maxCount 1 ; - ] ; -. - -:RMLGraphMapPropertiesShape - a sh:NodeShape; - sh:targetSubjectsOf rml:graphMap ; - sh:targetSubjectsOf rml:graph ; - - sh:property [ - sh:path [sh:alternativePath (rml:graph rml:graphMap)] ; - rdfs:label "graph/graphMap" ; - rdfs:comment """ - Either an rml:graph or rml:graphMap may be optionally be provided, - but not both. - """ ; - sh:message """ - Either an rml:graph or rml:graphMap may be optionally be provided, - but not both. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path rml:graphMap ; - rdfs:label "graphMap" ; - rdfs:comment """ - Specifies a Graph Map. When used with a Subject Map element, all the - RDF triples generated will be stored in the specified named graph. - Otherwise, the RDF triple generated using the (predicate, object) - pair will be stored in the specified named graph. - """ ; - sh:message """ - rml:graphMap must be either an IRI or blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; - sh:property [ - sh:path rml:graph ; - rdfs:label "graph" ; - rdfs:comment """ - An IRI reference to use as the named graph of all generated triples. - """ ; - sh:message """ - rml:graphMap must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - ] ; -. - -:RMLJoinConditionPropertiesShape - a sh:PropertyShape; - sh:path rml:joinCondition ; - sh:targetSubjectsOf rml:joinCondition ; - rdfs:label "joinCondition" ; - rdfs:comment """ - Specifies the join condition for joining a child data source with - a parent data source of the foreign key constraint. - """ ; - sh:message """ - rml:joinCondition must specify an rml:parent and rml:child. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; -. - -:RMLLogicalTargetPropertiesShape - a sh:PropertyShape ; - sh:path rml:logicalTarget ; - sh:targetSubjectsOf rml:logicalTarget ; - sh:path rml:logicalTarget ; - rdfs:label "logicalTarget" ; - rdfs:comment """ - A logical target is any target to where generated RDF triples are - exported to. - """ ; - sh:message """ - Zero or more rml:logicalTarget is required to export RDF triples. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:minCount 0 ; -. - -:RMLStrategyAppendShape - a sh:NodeShape ; - sh:targetObjectsOf rml:strategy ; - rdfs:label "Strategy" ; - rdfs:comment """ - Strategy to follow when generating RDF triples. - """ ; - sh:message """ - Strategy must be either rml:append or rml:cartesianProduct. - """ ; - sh:in (rml:append rml:cartesianProduct) ; -. diff --git a/src/main/resources/shapes/rml-core/subject_map.ttl b/src/main/resources/shapes/rml-core/subject_map.ttl deleted file mode 100644 index 4de0b24..0000000 --- a/src/main/resources/shapes/rml-core/subject_map.ttl +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################### -# RML Subject Map and subject shortcut shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - - -:RMLSubjectMapShape - a sh:NodeShape ; - sh:targetClass rml:SubjectMap ; - sh:targetObjectsOf rml:subjectMap ; - rdfs:label "SubjectMap" ; - rdfs:comment """ - Represents a Subject Map. - """ ; - sh:message """ - Subject Map must generate a resource representing the subject of - an RDF triple. - """ ; - - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLGraphMapPropertiesShape - :RMLLogicalTargetPropertiesShape - # Subject Map specific shapes - [ - sh:targetSubjectsOf rml:class ; - sh:path rml:class ; - rdfs:label "class" ; - rdfs:comment """ - The subject value generated will be asserted as an instance of this - RDFS class. - """ ; - sh:message """ - rml:class must be an IRI and may be specified multiple times. - """ ; - sh:nodeKind sh:IRI ; - ] - [ - sh:path rml:termType ; - sh:message """ - rml:termType must be a rml:IRI, rml:UnsafeIRI, rml:URI, - rml:UnsafeURI, or rml:BlankNode for a Subject Map. - """ ; - sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:BlankNode); - ] - ) ; -. - -:RMLsubjectShape - a sh:NodeShape ; - sh:targetObjectsOf rml:subject ; - rdfs:label "subject" ; - rdfs:comment """ - An IRI reference to use as subject for all the RDF triples. - """ ; - sh:message """ - rml:subject shortcut for rml:SubjectMap must be a IRI or BlankNode. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; -. diff --git a/src/main/resources/shapes/rml-core/term_map.ttl b/src/main/resources/shapes/rml-core/term_map.ttl deleted file mode 100644 index a7bdcba..0000000 --- a/src/main/resources/shapes/rml-core/term_map.ttl +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################### -# RML Expression Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLTermMapShape - a sh:NodeShape ; - rdfs:label "TermMap" ; - rdfs:comment """ - Represents a Term Map. - """ ; - sh:message """ - Term Map is an Expression Map with optionally a term type specified. - """ ; - - # Inherit Expression Map shape and add rml:termType - sh:and ( - :RMLExpressionMapShape - [ - sh:targetSubjectsOf rml:termType ; - sh:path rml:termType ; - rdfs:label "termType" ; - rdfs:comment """ - An IRI indicating whether a generated term should be an IRI, - Blank Node, or a Literal. - """ ; - sh:message """ - rml:termType must be either rml:IRI, rml:UnsafeIRI, - rml:URI, rml:UnsafeURI, rml:Literal, or rml:BlankNode for a Term Map. - May only be provided once. - """ ; - sh:maxCount 1 ; - sh:in (rml:IRI rml:UnsafeIRI rml:URI rml:UnsafeURI rml:Literal rml:BlankNode) ; - sh:nodeKind sh:IRI ; - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-core/tests.py b/src/main/resources/shapes/rml-core/tests.py deleted file mode 100644 index 2102e28..0000000 --- a/src/main/resources/shapes/rml-core/tests.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python -# -# (c) Dylan Van Assche (2020 - 2023) -# IDLab - Ghent University - imec -# MIT license -# - -import os -import argparse -import unittest -import logging -from parameterized import parameterized -from glob import glob -from rdflib import Graph - -from mapping_validator import MappingValidator - -TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), - '*/mapping.ttl') -CORE_SHAPE_FILE = os.path.abspath('core.ttl') -SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') - - -class MappingValidatorTests(unittest.TestCase): - def _validate_rules(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(CORE_SHAPE_FILE) - mapping_validator.validate(rules) - - def _validate_shapes(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(SHACL_SHAPE_FILE) - mapping_validator.validate(rules) - - def test_non_existing_mapping_rules(self) -> None: - with self.assertRaises(FileNotFoundError): - p = os.path.abspath('does_not_exist.ttl') - self._validate_rules(p) - - @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], - skip_on_empty=True) - def test_validation_rules(self, path: str) -> None: - """ - Test if our SHACL shapes are able to validate our validation mapping - rules test cases. - """ - print(f'Testing validation with: {path}') - if 'RMLTC0004b' in path or 'RMLTC0007h' in path or \ - 'RMLTC0012c' in path or 'RMLTC0012d' in path or \ - 'RMLTC0015b' in path or 'RMLTC0023c' in path: - with self.assertRaises(Exception): - self._validate_rules(path) - else: - self._validate_rules(path) - - @unittest.skip('pySHACL validation is broken for Core') - def test_validation_shapes(self) -> None: - """ - Test if our SHACL shapes are valid according to the W3C Recommdendation - of SHACL. Validation with the official SHACL shapes for SHACL. - - See https://www.w3.org/TR/shacl/#shacl-shacl - """ - self._validate_shapes('./core.ttl') - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Execute tests for SHACL ' - 'shapes on RML mapping rules.') - parser.add_argument('--verbose', '-v', action='count', default=1, - help='Set verbosity level of messages. Example: -vvv') - args = parser.parse_args() - - args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 - logging.basicConfig(level=args.verbose, - format='%(asctime)s %(levelname)s: %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - - print(TEST_CASES_DIR) - unittest.main(failfast=True) diff --git a/src/main/resources/shapes/rml-core/triples_map.ttl b/src/main/resources/shapes/rml-core/triples_map.ttl deleted file mode 100644 index a05bc10..0000000 --- a/src/main/resources/shapes/rml-core/triples_map.ttl +++ /dev/null @@ -1,33 +0,0 @@ -############################################################################### -# RML Triples Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix : . -@prefix rdfs: . -@prefix sh: . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Validate an RML Triples Map -:RMLTriplesMapShape - a sh:NodeShape ; - sh:targetClass rml:TriplesMap ; - sh:targetObjectsOf rml:parentTriplesMap ; - rdfs:label "TriplesMap" ; - rdfs:comment """ - Represents a Triples Map. - """ ; - sh:message """ - Triples Map requires exactly one rml:subject or one rml:subjectMap and zero - or more rml:predicateObjectMaps. - """ ; - - sh:and ( - # Inherited shapes - :RMLTriplesMapPropertiesShape - # Triples Map specific shapes - [ - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-fnml/README.md b/src/main/resources/shapes/rml-fnml/README.md deleted file mode 100644 index 6b8f0dd..0000000 --- a/src/main/resources/shapes/rml-fnml/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Shape editing - -## Setup - -`pip install -r requirements.txt` - -## Editing - -Edit following subshapes: - -- external_shapes.ttl -- function_execution.ttl -- function_map.ttl -- input.ttl -- parameter_map.ttl -- return_map.ttl - -## Generating - -./generate_shape.py fnml.ttl diff --git a/src/main/resources/shapes/rml-fnml/external_shapes.ttl b/src/main/resources/shapes/rml-fnml/external_shapes.ttl deleted file mode 100644 index 9e70679..0000000 --- a/src/main/resources/shapes/rml-fnml/external_shapes.ttl +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# RML FNML external resources shapes # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # -############################################################################### -@prefix sh: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Shapes are defined in the corresponding repositories of each specification -# Provide their IRI as stub to allow validation in FNML. - -:RMLTermMapShape - a sh:NodeShape; -. - -:RMLLogicalTargetPropertiesShape - a sh:NodeShape; -. diff --git a/src/main/resources/shapes/rml-fnml/fnml.ttl b/src/main/resources/shapes/rml-fnml/fnml.ttl deleted file mode 100644 index e5bc9eb..0000000 --- a/src/main/resources/shapes/rml-fnml/fnml.ttl +++ /dev/null @@ -1,173 +0,0 @@ -@prefix brick: . -@prefix csvw: . -@prefix dc: . -@prefix dcam: . -@prefix dcat: . -@prefix dcmitype: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix geo: . -@prefix odrl: . -@prefix org: . -@prefix owl: . -@prefix prof: . -@prefix prov: . -@prefix qb: . -@prefix rdf: . -@prefix rdfs: . -@prefix rml: . -@prefix schema: . -@prefix sh: . -@prefix skos: . -@prefix sosa: . -@prefix ssn: . -@prefix time: . -@prefix vann: . -@prefix void: . -@prefix wgs: . -@prefix xml: . -@prefix xsd: . - - a sh:NodeShape ; - rdfs:label "rml:FunctionExecution" ; - rdfs:comment """ - Represents a Function Execution. - """ ; - sh:property [ rdfs:label "rml:function/rml:functionMap" ; - rdfs:comment """ - Exactly one rml:function or rml:functionMap is required. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:function or rml:functionMap is required. - """ ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:function rml:functionMap ) ] ], - [ rdfs:label "rml:functionMap" ; - rdfs:comment """ - FnO function to execute. - """ ; - sh:message """ - rml:functionMap must be an IRI or Blank node. - """ ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:functionMap ], - [ rdfs:label "rml:function" ; - rdfs:comment """ - FnO function to execute. - """ ; - sh:message """ - rml:function must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - sh:path rml:function ], - [ rdfs:label "rml:input" ; - rdfs:comment """ - Input parameters for the function. - """ ; - sh:message """ - rml:input must be an IRI or Blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:input ] ; - sh:targetObjectsOf rml:functionExecution . - - a sh:NodeShape ; - rdfs:label "FunctionMap" ; - rdfs:comment """ - Represents a Function Map. - """ ; - sh:and ( [ ] ) ; - sh:targetObjectsOf rml:functionMap . - - a sh:NodeShape ; - rdfs:label "rml:Input" ; - rdfs:comment """ - Represents an Input for a function. - """ ; - sh:property [ rdfs:label "rml:parameter/rml:parameterMap" ; - rdfs:comment """ - Exactly one rml:parameter or rml:parameterMap is required. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:parameter or rml:parameterMap is required. - """ ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:parameter rml:parameterMap ) ] ], - [ rdfs:label "rml:inputValueMap" ; - rdfs:comment """ - Values of the parameters. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:inputValueMap must be an IRI or Blank node, provided once. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:inputValueMap ], - [ rdfs:label "rml:inputValue" ; - rdfs:comment """ - Parameters to supply to FnO function. - """ ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:message """ - rml:inputValue must be a string Literal. - """ ; - sh:nodeKind sh:Literal ; - sh:path rml:inputValue ], - [ rdfs:label "rml:parameterMap" ; - rdfs:comment """ - Parameters to supply to FnO function. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:parameterMap must be an IRI or Blank node. - """ ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:parameterMap ], - [ rdfs:label "rml:parameter" ; - rdfs:comment """ - Parameters to supply to FnO function. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:parameter must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - sh:path rml:parameter ], - [ rdfs:label "rml:inputValue/rml:inputValueMap" ; - rdfs:comment """ - Exactly one rml:inputValue or rml:inputValueMap is required. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:inputValue or rml:inputValueMap is required. - """ ; - sh:minCount 1 ; - sh:path [ sh:alternativePath ( rml:inputValue rml:inputValueMap ) ] ] ; - sh:targetObjectsOf rml:input . - - a sh:NodeShape ; - rdfs:label "ParameterMap" ; - rdfs:comment """ - Represents a Parameter Map of a function. - """ ; - sh:and ( [ ] ) ; - sh:targetObjectsOf rml:parameterMap . - - a sh:NodeShape ; - rdfs:label "ReturnMap" ; - rdfs:comment """ - Represents a Return Map. - """ ; - sh:and ( [ ] ) ; - sh:targetObjectsOf rml:returnMap . - - a sh:NodeShape . - - a sh:NodeShape . - diff --git a/src/main/resources/shapes/rml-fnml/function_execution.ttl b/src/main/resources/shapes/rml-fnml/function_execution.ttl deleted file mode 100644 index 275e767..0000000 --- a/src/main/resources/shapes/rml-fnml/function_execution.ttl +++ /dev/null @@ -1,74 +0,0 @@ -############################################################################### -# RML FunctionExecution shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLFunctionExecutionShape - a sh:NodeShape ; - rdfs:label "rml:FunctionExecution" ; - rdfs:comment """ - Represents a Function Execution. - """ ; - sh:targetObjectsOf rml:functionExecution ; - - # Exactly one rml:function or rml:functionMap is required - sh:property [ - sh:path [sh:alternativePath (rml:function - rml:functionMap)] ; - rdfs:label "rml:function/rml:functionMap" ; - rdfs:comment """ - Exactly one rml:function or rml:functionMap is required. - """ ; - sh:message """ - Exactly one rml:function or rml:functionMap is required. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - - # rml:functionMap non-shortcut - sh:property [ - sh:path rml:functionMap ; - rdfs:label "rml:functionMap" ; - rdfs:comment """ - FnO function to execute. - """ ; - sh:message """ - rml:functionMap must be an IRI or Blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:node :RMLFunctionMap; - ] ; - - # rml:function shortcut - sh:property [ - sh:path rml:function ; - rdfs:label "rml:function" ; - rdfs:comment """ - FnO function to execute. - """ ; - sh:message """ - rml:function must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - ] ; - - # rml:input - sh:property [ - sh:path rml:input ; - rdfs:label "rml:input" ; - rdfs:comment """ - Input parameters for the function. - """ ; - sh:message """ - rml:input must be an IRI or Blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; -. diff --git a/src/main/resources/shapes/rml-fnml/function_map.ttl b/src/main/resources/shapes/rml-fnml/function_map.ttl deleted file mode 100644 index 0c37a50..0000000 --- a/src/main/resources/shapes/rml-fnml/function_map.ttl +++ /dev/null @@ -1,28 +0,0 @@ -############################################################################### -# RML Function Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLFunctionMapShape - a sh:NodeShape ; - rdfs:label "FunctionMap" ; - rdfs:comment """ - Represents a Function Map. - """ ; - sh:targetObjectsOf rml:functionMap ; - - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLLogicalTargetPropertiesShape - # Function Map specific shapes - [ - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-fnml/generate_shape.py b/src/main/resources/shapes/rml-fnml/generate_shape.py deleted file mode 100644 index f6c20d6..0000000 --- a/src/main/resources/shapes/rml-fnml/generate_shape.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -import argparse -import sys -from os import path -from glob import glob -from rdflib import Graph, Namespace -from rdflib.plugins.serializers.turtle import TurtleSerializer -from rdflib import plugin - -SUBSHAPE_FORMAT = 'turtle' -SUBSHAPE_GLOB_PATTERN = '*.ttl' -SHACL = Namespace('http://www.w3.org/ns/shacl#') -RML = Namespace('http://w3id.org/rml/') - - -class TurtleWithPrefixes(TurtleSerializer): - """ - A turtle serializer that always emits prefixes - Workaround for https://github.com/RDFLib/rdflib/issues/1048 - """ - roundtrip_prefixes = True # Undocumented, forces to write all prefixes - - -class ShapeGenerator: - """ - Generates a complete SHACL shape of all the SHACL subshapes. - Useful for using the shapes in the shacl.org Playground. - """ - def __init__(self, glob_pattern: str, rdf_format: str, - destination: str) -> None: - self._glob_pattern: str = glob_pattern - self._rdf_format: str = rdf_format - self._destination: str = destination - self._shape = Graph() - self._shape.bind('sh', SHACL) - self._shape.bind('rml', RML) - # Register TurtleWithPrefixes serializer as 'tortoise' format - plugin.register('tortoise', - plugin.Serializer, - 'generate_shape', - 'TurtleWithPrefixes') - - def generate(self) -> None: - """ - Generate a full shape from the sub shapes. - """ - print('Reading subshapes:') - for sub_shape in glob(self._glob_pattern): - if 'fnml' in sub_shape or 'shacl' in sub_shape: - continue - print(f"\t{sub_shape}") - g = Graph() - g.bind('sh', SHACL) - g.bind('rml', RML) - self._shape += g.parse(sub_shape, format=self._rdf_format) - - print(f'Writing shape to {self._destination}') - self._shape.serialize(destination=self._destination, format='tortoise') - - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' - 'from the subshapes.') - p.add_argument('destination', type=str, help='Location to write the ' - 'complete SHACL shape as Turtle.') - # Arguments parsing - args = p.parse_args() - if not path.exists(args.destination): - print(f'{args.destination} file path does not exist!') - sys.exit(1) - - if path.isdir(args.destination): - args.destination = path.join(args.destination, 'fnml.ttl') - - # Generate shape - generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, - args.destination) - generator.generate() diff --git a/src/main/resources/shapes/rml-fnml/input.ttl b/src/main/resources/shapes/rml-fnml/input.ttl deleted file mode 100644 index bb791ee..0000000 --- a/src/main/resources/shapes/rml-fnml/input.ttl +++ /dev/null @@ -1,107 +0,0 @@ -############################################################################### -# RML Input shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLInputShape - a sh:NodeShape ; - rdfs:label "rml:Input" ; - rdfs:comment """ - Represents an Input for a function. - """ ; - sh:targetObjectsOf rml:input ; - - # Exactly one rml:parameter or rml:parameterMap is required - sh:property [ - sh:path [sh:alternativePath (rml:parameter - rml:parameterMap)] ; - rdfs:label "rml:parameter/rml:parameterMap" ; - rdfs:comment """ - Exactly one rml:parameter or rml:parameterMap is required. - """ ; - sh:message """ - Exactly one rml:parameter or rml:parameterMap is required. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - - # rml:parameterMap non-shortcut - sh:property [ - sh:path rml:parameterMap ; - rdfs:label "rml:parameterMap" ; - rdfs:comment """ - Parameters to supply to FnO function. - """ ; - sh:message """ - rml:parameterMap must be an IRI or Blank node. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:node :RMLParameterMap; - sh:maxCount 1 ; - ] ; - - # rml:parameter shortcut - sh:property [ - sh:path rml:parameter ; - rdfs:label "rml:parameter" ; - rdfs:comment """ - Parameters to supply to FnO function. - """ ; - sh:message """ - rml:parameter must be an IRI. - """ ; - sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - ] ; - - # Exactly one rml:inputValue or rml:inputValueMap is required - sh:property [ - sh:path [sh:alternativePath (rml:inputValue - rml:inputValueMap)] ; - rdfs:label "rml:inputValue/rml:inputValueMap" ; - rdfs:comment """ - Exactly one rml:inputValue or rml:inputValueMap is required. - """ ; - sh:message """ - Exactly one rml:inputValue or rml:inputValueMap is required. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - - # rml:inputValueMap - sh:property [ - sh:path rml:inputValueMap ; - rdfs:label "rml:inputValueMap" ; - rdfs:comment """ - Values of the parameters. - """ ; - sh:message """ - rml:inputValueMap must be an IRI or Blank node, provided once. - """ ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] ; - - # rml:inputValue shortcut - sh:property [ - sh:path rml:inputValue ; - rdfs:label "rml:inputValue" ; - rdfs:comment """ - Parameters to supply to FnO function. - """ ; - sh:message """ - rml:inputValue must be a string Literal. - """ ; - sh:nodeKind sh:Literal ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - ] ; -. diff --git a/src/main/resources/shapes/rml-fnml/mapping_validator.py b/src/main/resources/shapes/rml-fnml/mapping_validator.py deleted file mode 100644 index efaf440..0000000 --- a/src/main/resources/shapes/rml-fnml/mapping_validator.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# - -from logging import debug, info, critical -from pyshacl import validate -from rdflib import Graph -from shutil import get_terminal_size - - -class MappingValidator: - def __init__(self, shape: str) -> None: - g = Graph() - g.parse(shape, format='turtle') - self._shape = g - - def validate(self, rules: Graph, print_report: bool = True) -> None: - valid: bool - report_graph: Graph - report_text: str - valid, report_graph, report_text = validate(rules, - shacl_graph=self._shape) - debug(f'RML rules valid: {valid}') - debug(f'SHACL validation report: {report_text}') - - # If mapping rules are invalid, print SHACL report and raise exception - if not valid and print_report: - self._print_report(report_text) - msg = 'RML mapping rules are invalid, a detailed explanation' \ - ' is available in the report' - critical(msg) - raise ValueError(msg) - - def _print_report(self, report_text: str) -> None: - tty_columns: int - tty_columns, _ = get_terminal_size() - info('-' * tty_columns) - title: str = 'RML rules validation report' - white_space: int = int((tty_columns - len(title)) / 2) - title = ' ' * white_space + title + ' ' * white_space - info(title) - info('-' * tty_columns) - info(report_text) - info('-' * tty_columns) \ No newline at end of file diff --git a/src/main/resources/shapes/rml-fnml/parameter_map.ttl b/src/main/resources/shapes/rml-fnml/parameter_map.ttl deleted file mode 100644 index 25bc52c..0000000 --- a/src/main/resources/shapes/rml-fnml/parameter_map.ttl +++ /dev/null @@ -1,28 +0,0 @@ -############################################################################### -# RML Parameter Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLParameterMapShape - a sh:NodeShape ; - rdfs:label "ParameterMap" ; - rdfs:comment """ - Represents a Parameter Map of a function. - """ ; - sh:targetObjectsOf rml:parameterMap ; - - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLLogicalTargetPropertiesShape - # Parameter Map specific shapes - [ - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-fnml/requirements.txt b/src/main/resources/shapes/rml-fnml/requirements.txt deleted file mode 100644 index e9fdd84..0000000 --- a/src/main/resources/shapes/rml-fnml/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -parameterized -rdflib -pyshacl \ No newline at end of file diff --git a/src/main/resources/shapes/rml-fnml/return_map.ttl b/src/main/resources/shapes/rml-fnml/return_map.ttl deleted file mode 100644 index 2e5b044..0000000 --- a/src/main/resources/shapes/rml-fnml/return_map.ttl +++ /dev/null @@ -1,28 +0,0 @@ -############################################################################### -# RML Return Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLReturnMapShape - a sh:NodeShape ; - rdfs:label "ReturnMap" ; - rdfs:comment """ - Represents a Return Map. - """ ; - sh:targetObjectsOf rml:returnMap ; - - sh:and ( - # Inherited shapes - :RMLTermMapShape - :RMLLogicalTargetPropertiesShape - # Return Map specific shapes - [ - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-fnml/shacl.ttl b/src/main/resources/shapes/rml-fnml/shacl.ttl deleted file mode 100644 index e37856a..0000000 --- a/src/main/resources/shapes/rml-fnml/shacl.ttl +++ /dev/null @@ -1,406 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - -@prefix shsh: . - -shsh: - rdfs:label "SHACL for SHACL"@en ; - rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; - sh:declare [ - sh:prefix "shsh" ; - sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; - ] . - - -shsh:ListShape - a sh:NodeShape ; - rdfs:label "List shape"@en ; - rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath rdf:rest ] ; - rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; - sh:hasValue rdf:nil ; - sh:node shsh:ListNodeShape ; - ] . - -shsh:ListNodeShape - a sh:NodeShape ; - rdfs:label "List node shape"@en ; - rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; - sh:or ( [ - sh:hasValue rdf:nil ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 0 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 0 ; - ] ; - ] - [ - sh:not [ sh:hasValue rdf:nil ] ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - ] ) . - -shsh:ShapeShape - a sh:NodeShape ; - rdfs:label "Shape shape"@en ; - rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; - - # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape - sh:targetClass sh:NodeShape ; - sh:targetClass sh:PropertyShape ; - sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; - sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, - sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, - sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, - sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, - sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; - - sh:targetObjectsOf sh:node ; # node-node - sh:targetObjectsOf sh:not ; # not-node - sh:targetObjectsOf sh:property ; # property-node - sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node - - # Shapes are either node shapes or property shapes - sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; - - sh:property [ - sh:path sh:targetNode ; - sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind - ] ; - sh:property [ - sh:path sh:targetClass ; - sh:nodeKind sh:IRI ; # targetClass-nodeKind - ] ; - sh:property [ - sh:path sh:targetSubjectsOf ; - sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind - ] ; - sh:property [ - sh:path sh:targetObjectsOf ; - sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind - ] ; - sh:or ( [ sh:not [ - sh:class rdfs:Class ; - sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) - ] ] - [ sh:nodeKind sh:IRI ] - ) ; # implicit-targetClass-nodeKind - - sh:property [ - sh:path sh:severity ; - sh:maxCount 1 ; # severity-maxCount - sh:nodeKind sh:IRI ; # severity-nodeKind - ] ; - sh:property [ - sh:path sh:message ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype - ] ; - sh:property [ - sh:path sh:deactivated ; - sh:maxCount 1 ; # deactivated-maxCount - sh:in ( true false ) ; # deactivated-datatype - ] ; - - sh:property [ - sh:path sh:and ; - sh:node shsh:ListShape ; # and-node - ] ; - sh:property [ - sh:path sh:class ; - sh:nodeKind sh:IRI ; # class-nodeKind - ] ; - sh:property [ - sh:path sh:closed ; - sh:datatype xsd:boolean ; # closed-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:ignoredProperties ; - sh:node shsh:ListShape ; # ignoredProperties-node - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind - ] ; - sh:property [ - sh:path sh:datatype ; - sh:nodeKind sh:IRI ; # datatype-nodeKind - sh:maxCount 1 ; # datatype-maxCount - ] ; - sh:property [ - sh:path sh:disjoint ; - sh:nodeKind sh:IRI ; # disjoint-nodeKind - ] ; - sh:property [ - sh:path sh:equals ; - sh:nodeKind sh:IRI ; # equals-nodeKind - ] ; - sh:property [ - sh:path sh:in ; - sh:maxCount 1 ; # in-maxCount - sh:node shsh:ListShape ; # in-node - ] ; - sh:property [ - sh:path sh:languageIn ; - sh:maxCount 1 ; # languageIn-maxCount - sh:node shsh:ListShape ; # languageIn-node - ] ; - sh:property [ - sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:datatype xsd:string ; # languageIn-members-datatype - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:nodeKind sh:IRI ; # lessThan-nodeKind - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:datatype xsd:integer ; # maxCount-datatype - sh:maxCount 1 ; # maxCount-maxCount - ] ; - sh:property [ - sh:path sh:maxExclusive ; - sh:maxCount 1 ; # maxExclusive-maxCount - sh:nodeKind sh:Literal ; # maxExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxInclusive ; - sh:maxCount 1 ; # maxInclusive-maxCount - sh:nodeKind sh:Literal ; # maxInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxLength ; - sh:datatype xsd:integer ; # maxLength-datatype - sh:maxCount 1 ; # maxLength-maxCount - ] ; - sh:property [ - sh:path sh:minCount ; - sh:datatype xsd:integer ; # minCount-datatype - sh:maxCount 1 ; # minCount-maxCount - ] ; - sh:property [ - sh:path sh:minExclusive ; - sh:maxCount 1 ; # minExclusive-maxCount - sh:nodeKind sh:Literal ; # minExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minInclusive ; - sh:maxCount 1 ; # minInclusive-maxCount - sh:nodeKind sh:Literal ; # minInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minLength ; - sh:datatype xsd:integer ; # minLength-datatype - sh:maxCount 1 ; # minLength-maxCount - ] ; - sh:property [ - sh:path sh:nodeKind ; - sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in - sh:maxCount 1 ; # nodeKind-maxCount - ] ; - sh:property [ - sh:path sh:or ; - sh:node shsh:ListShape ; # or-node - ] ; - sh:property [ - sh:path sh:pattern ; - sh:datatype xsd:string ; # pattern-datatype - sh:maxCount 1 ; # multiple-parameters - # Not implemented: syntax rule pattern-regex - ] ; - sh:property [ - sh:path sh:flags ; - sh:datatype xsd:string ; # flags-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMaxCount ; - sh:datatype xsd:integer ; # qualifiedMaxCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMinCount ; - sh:datatype xsd:integer ; # qualifiedMinCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShapesDisjoint ; - sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:datatype xsd:boolean ; # uniqueLang-datatype - sh:maxCount 1 ; # uniqueLang-maxCount - ] ; - sh:property [ - sh:path sh:xone ; - sh:node shsh:ListShape ; # xone-node - ] . - -shsh:NodeShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:node ; # node-node - sh:property [ - sh:path sh:path ; - sh:maxCount 0 ; # NodeShape-path-maxCount - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:maxCount 0 ; # lessThan-scope - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:maxCount 0 ; # lessThanOrEquals-scope - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:maxCount 0 ; # maxCount-scope - ] ; - sh:property [ - sh:path sh:minCount ; - sh:maxCount 0 ; # minCount-scope - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 0 ; # qualifiedValueShape-scope - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:maxCount 0 ; # uniqueLang-scope - ] . - -shsh:PropertyShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:property ; # property-node - sh:property [ - sh:path sh:path ; - sh:maxCount 1 ; # path-maxCount - sh:minCount 1 ; # PropertyShape-path-minCount - sh:node shsh:PathShape ; # path-node - ] . - -# Values of sh:and, sh:or and sh:xone must be lists of shapes -shsh:ShapesListShape - a sh:NodeShape ; - sh:targetObjectsOf sh:and ; # and-members-node - sh:targetObjectsOf sh:or ; # or-members-node - sh:targetObjectsOf sh:xone ; # xone-members-node - sh:property [ - sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:node shsh:ShapeShape ; - ] . - - -# A path of blank node path syntax, used to simulate recursion -_:PathPath - sh:alternativePath ( - ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - sh:inversePath - sh:zeroOrMorePath - sh:oneOrMorePath - sh:zeroOrOnePath - ) . - -shsh:PathShape - a sh:NodeShape ; - rdfs:label "Path shape"@en ; - rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath _:PathPath ] ; - sh:node shsh:PathNodeShape ; - ] . - -shsh:PathNodeShape - sh:xone ( # path-metarule - [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path - [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path - sh:node shsh:PathListWithAtLeast2Members ; - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path - sh:closed true ; - sh:property [ - sh:path sh:alternativePath ; - sh:node shsh:PathListWithAtLeast2Members ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path - sh:closed true ; - sh:property [ - sh:path sh:inversePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path - sh:closed true ; - sh:property [ - sh:path sh:oneOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrOnePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - ) . - -shsh:PathListWithAtLeast2Members - a sh:NodeShape ; - sh:node shsh:ListShape ; - sh:property [ - sh:path [ sh:oneOrMorePath rdf:rest ] ; - sh:minCount 2 ; # 1 other list node plus rdf:nil - ] . - -shsh:ShapesGraphShape - a sh:NodeShape ; - sh:targetObjectsOf sh:shapesGraph ; - sh:nodeKind sh:IRI . # shapesGraph-nodeKind - -shsh:EntailmentShape - a sh:NodeShape ; - sh:targetObjectsOf sh:entailment ; - sh:nodeKind sh:IRI . # entailment-nodeKind - diff --git a/src/main/resources/shapes/rml-fnml/tests.py b/src/main/resources/shapes/rml-fnml/tests.py deleted file mode 100644 index 1cfba5c..0000000 --- a/src/main/resources/shapes/rml-fnml/tests.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -# -# (c) Dylan Van Assche (2020 - 2023) -# IDLab - Ghent University - imec -# MIT license -# - -import os -import argparse -import unittest -import logging -from parameterized import parameterized -from glob import glob -from rdflib import Graph - -from mapping_validator import MappingValidator - -TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), '*/mapping.ttl') -RESOURCES_DIR = os.path.join(os.path.abspath('../spec'), 'resources/*.ttl') -FNML_SHAPE_FILE = os.path.abspath('fnml.ttl') -SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') - - -class MappingValidatorTests(unittest.TestCase): - def _validate_rules(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(FNML_SHAPE_FILE) - mapping_validator.validate(rules) - - def _validate_shapes(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(SHACL_SHAPE_FILE) - mapping_validator.validate(rules) - - def test_non_existing_mapping_rules(self) -> None: - with self.assertRaises(FileNotFoundError): - p = os.path.abspath('does_not_exist.ttl') - self._validate_rules(p) - - @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], skip_on_empty=True) - def test_validation_rules(self, path: str) -> None: - """ - Test if our SHACL shapes are able to validate our validation mapping - rules test cases. - """ - print(f'Testing validation with: {path}') - self._validate_rules(path) - - # @parameterized.expand([(p,) for p in sorted(glob(RESOURCES_DIR))], skip_on_empty=True) - # def test_resource_rules(self, path: str) -> None: - # """ - # Test if our SHACL shapes are able to validate our validation mapping - # rules resources. - # """ - # print(f'Testing validation with: {path}') - # self._validate_rules(path) - - def test_validation_shapes(self) -> None: - """ - Test if our SHACL shapes are valid according to the W3C Recommdendation - of SHACL. Validation with the official SHACL shapes for SHACL. - - See https://www.w3.org/TR/shacl/#shacl-shacl - """ - path = './fnml.ttl' - print(f'Testing shape with: {path}') - self._validate_shapes(path) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Execute tests for SHACL shapes on RML mapping rules.') - parser.add_argument('--verbose', '-v', action='count', default=1, - help='Set verbosity level of messages. Example: -vvv') - args = parser.parse_args() - - args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 - logging.basicConfig(level=args.verbose, - format='%(asctime)s %(levelname)s: %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - - print(TEST_CASES_DIR) - unittest.main(failfast=True) - diff --git a/src/main/resources/shapes/rml-io/generate_shape.py b/src/main/resources/shapes/rml-io/generate_shape.py deleted file mode 100644 index ab6f2f5..0000000 --- a/src/main/resources/shapes/rml-io/generate_shape.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -import argparse -import sys -from os import path -from glob import glob -from rdflib import Graph, Namespace -from rdflib.plugins.serializers.turtle import TurtleSerializer -from rdflib import plugin - -SUBSHAPE_FORMAT = 'turtle' -SUBSHAPE_GLOB_PATTERN = '*.ttl' -SHACL = Namespace('http://www.w3.org/ns/shacl#') -RML = Namespace('http://w3id.org/rml/') - - -class TurtleWithPrefixes(TurtleSerializer): - """ - A turtle serializer that always emits prefixes - Workaround for https://github.com/RDFLib/rdflib/issues/1048 - """ - roundtrip_prefixes = True # Undocumented, forces to write all prefixes - - -class ShapeGenerator: - """ - Generates a complete SHACL shape of all the SHACL subshapes. - Useful for using the shapes in the shacl.org Playground. - """ - def __init__(self, glob_pattern: str, rdf_format: str, - destination: str) -> None: - self._glob_pattern: str = glob_pattern - self._rdf_format: str = rdf_format - self._destination: str = destination - self._shape = Graph() - self._shape.bind('sh', SHACL) - self._shape.bind('rml', RML) - # Register TurtleWithPrefixes serializer as 'tortoise' format - plugin.register('tortoise', - plugin.Serializer, - 'generate_shape', - 'TurtleWithPrefixes') - - def generate(self) -> None: - """ - Generate a full shape from the sub shapes. - """ - print('Reading subshapes:') - for sub_shape in glob(self._glob_pattern): - if 'io' in sub_shape: - continue - print(f"\t{sub_shape}") - g = Graph() - g.bind('sh', SHACL) - g.bind('rml', RML) - self._shape += g.parse(sub_shape, format=self._rdf_format) - - print(f'Writing shape to {self._destination}') - self._shape.serialize(destination=self._destination, format='tortoise') - - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' - 'from the subshapes.') - p.add_argument('destination', type=str, help='Location to write the ' - 'complete SHACL shape as Turtle.') - # Arguments parsing - args = p.parse_args() - if not path.exists(args.destination): - print(f'{args.destination} file path does not exist!') - sys.exit(1) - - if path.isdir(args.destination): - args.destination = path.join(args.destination, 'io.ttl') - - # Generate shape - generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, - args.destination) - generator.generate() diff --git a/src/main/resources/shapes/rml-io/io.ttl b/src/main/resources/shapes/rml-io/io.ttl deleted file mode 100644 index caef0b4..0000000 --- a/src/main/resources/shapes/rml-io/io.ttl +++ /dev/null @@ -1,283 +0,0 @@ -@prefix brick: . -@prefix csvw: . -@prefix dc: . -@prefix dcam: . -@prefix dcat: . -@prefix dcmitype: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix geo: . -@prefix odrl: . -@prefix org: . -@prefix owl: . -@prefix prof: . -@prefix prov: . -@prefix qb: . -@prefix rdf: . -@prefix rdfs: . -@prefix rml: . -@prefix schema: . -@prefix sh: . -@prefix skos: . -@prefix sosa: . -@prefix ssn: . -@prefix time: . -@prefix vann: . -@prefix void: . -@prefix wgs: . -@prefix xml: . -@prefix xsd: . - - a owl:Ontology ; - owl:imports . - - a sh:NodeShape ; - rdfs:label "RML Logical Source" ; - rdfs:comment """ - A logical source is any source that is mapped to RDF triples. - """ ; - sh:message """ - RML Logical Source requires one rml:source and requires everyting - an Abstract Logical Source requires. - """ ; - sh:property [ rdfs:label "rml:source" ; - rdfs:comment """ - The source (rml:source) locates the input data source. It is a URI - that represents the data source where the data source is. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:source must be provided to locate the data source. - rml:source must be provided exactly once as an URI. - """ ; - sh:minCount 1 ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:source ] ; - sh:targetClass rml:LogicalSource ; - sh:targetSubjectsOf rml:source . - - a sh:NodeShape ; - rdfs:label "RML Logical Target" ; - rdfs:comment """ - A logical target is any target to where generated RDF triples are exported - to. - """ ; - sh:message """ - RML Logical Target requires one rml:target. - """ ; - sh:property [ rdfs:label "rml:target" ; - rdfs:comment """ - The target (rml:target) locates the output target. It is a URI - that represents the target where it must export generated RDF triples - to. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:target must be provided to locate the target. rml:target must - be provided exactly once as an URI. - """ ; - sh:minCount 1 ; - sh:node ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:target ] ; - sh:targetClass rml:LogicalTarget ; - sh:targetObjectsOf rml:logicalTarget . - - a sh:NodeShape ; - rdfs:label "RML Relative Path Source" ; - rdfs:comment """ - A RML Relative Path Source provides a source with relative paths which is - not provided by existing vocabularies such as DCAT without a base IRI. - """ ; - sh:message """ - RML Relative Path Source accepts one rml:root, and one rml:path. - rml:root is optional and defaults to rml:CurrentWorkingDirectory. - """ ; - sh:property [ rdfs:label "rml:root" ; - rdfs:comment """ - rml:root defines the root directory against which relative paths are - resolved. If not provided, defaults to the current working directory. - """ ; - sh:in ( rml:CurrentWorkingDirectory rml:MappingDirectory ) ; - sh:maxCount 1 ; - sh:message """ - rml:root must be either rml:CurrentWorkingDirectory or - rml:MappingDirectory. - """ ; - sh:minCount 0 ; - sh:path rml:root ], - [ rdfs:label "rml:path" ; - rdfs:comment """ - rml:path specifies the relative path to access for the source. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:path must be a string Literal. - """ ; - sh:minCount 1 ; - sh:nodeKind sh:Literal ; - sh:path rml:path ] ; - sh:targetClass rml:RelativePathSource . - - a sh:NodeShape ; - rdfs:label "RML Relative Path Target" ; - rdfs:comment """ - A RML Relative Path Target provides a target with relative paths which is - not provided by existing vocabularies such as DCAT without a base IRI. - """ ; - sh:message """ - RML Relative Path Target accepts one rml:root, and one rml:path. - rml:root is optional and defaults to rml:CurrentWorkingDirectory. - """ ; - sh:property [ rdfs:label "rml:root" ; - rdfs:comment """ - rml:root defines the root directory against which relative paths are - resolved. If not provided, defaults to the current working directory. - """ ; - sh:in ( rml:CurrentWorkingDirectory rml:MappingDirectory ) ; - sh:maxCount 1 ; - sh:message """ - rml:root must be either rml:CurrentWorkingDirectory or - rml:MappingDirectory. - """ ; - sh:minCount 0 ; - sh:path rml:root ], - [ rdfs:label "rml:path" ; - rdfs:comment """ - rml:path specifies the relative path to access for the target. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:path must be a string Literal. - """ ; - sh:minCount 1 ; - sh:nodeKind sh:Literal ; - sh:path rml:path ] ; - sh:targetClass rml:RelativePathTarget . - - a sh:NodeShape ; - rdfs:label "RML Source" ; - rdfs:comment """ - A source describes access to a data source. Any data access description - is allowed, but rml:Source provides additional properties to complete - such descriptions. - """ ; - sh:message """ - RML Source accepts one or multiple rml:null, one rml:compression, - and one rml:encoding. All of them are optional. - """ ; - sh:property [ rdfs:label "rml:null" ; - rdfs:comment """ - rml:null specifies how NULL or empty values are exposed by the data - source. - """ ; - sh:datatype xsd:string ; - sh:message """ - rml:source must be provided as a string Literal. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:Literal ; - sh:path rml:null ], - [ rdfs:label "rml:compression" ; - rdfs:comment """ - rml:compression specifies the compression algorithm to use when - accessing the data source. By default, no compression is applied. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:compression must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:IRI ; - sh:path rml:compression ], - [ rdfs:label "rml:encoding" ; - rdfs:comment """ - rml:encoding specifies the encoding to use when accessing the data - source. By default, UTF-8 is used. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:encoding must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:IRI ; - sh:path rml:encoding ], - [ rdfs:label "rml:null" ; - rdfs:comment """ - rml:null specifies which data values inside the source should be - considered as NULL. Defaults to the default NULL character of a source, - if available. - """ ; - sh:message """ - rml:null must be provided as a Literal. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:Literal ; - sh:path rml:null ] ; - sh:targetClass rml:Source ; - sh:targetObjectsOf rml:source . - - a sh:NodeShape ; - rdfs:label "RML Target" ; - rdfs:comment """ - A target describes access to a data target. Any data access description - is allowed, but rml:Target provides additional properties to complete - such descriptions. - """ ; - sh:message """ - RML Target accepts one rml:compression, and one rml:encoding. - All of them are optional. - """ ; - sh:property [ rdfs:label "rml:compression" ; - rdfs:comment """ - rml:compression specifies the compression algorithm to use when - accessing the data target. By default, no compression is applied. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:compression must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:IRI ; - sh:path rml:compression ], - [ rdfs:label "rml:encoding" ; - rdfs:comment """ - rml:encoding specifies the encoding to use when accessing the data - target. By default, UTF-8 is used. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:encoding must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:IRI ; - sh:path rml:encoding ], - [ rdfs:label "rml:serialization" ; - rdfs:comment """ - rml:serialization specifies the serialization format to use when - exporting the generated RDF to a target. By default N-Quads is used. - """ ; - sh:maxCount 1 ; - sh:message """ - rml:serialization must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:IRI ; - sh:path rml:serialization ], - [ rdfs:label "rml:mode" ; - rdfs:comment """ - rml:mode specifies in which mode the target is opened such as read-only, - write-only, both, etc. - """ ; - sh:in ( rml:Read rml:ReadWrite rml:Write rml:WriteRead rml:Append rml:AppendRead ) ; - sh:maxCount 1 ; - sh:message """ - rml:mode must be specified by any of the modes from rml:Mode class. - """ ; - sh:minCount 0 ; - sh:path rml:mode ] ; - sh:targetClass rml:Target ; - sh:targetObjectsOf rml:target . - diff --git a/src/main/resources/shapes/rml-io/logical_source.ttl b/src/main/resources/shapes/rml-io/logical_source.ttl deleted file mode 100644 index b185fdf..0000000 --- a/src/main/resources/shapes/rml-io/logical_source.ttl +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################### -# RML Logical Source shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2020 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLLogicalSourceShape - a sh:NodeShape ; - sh:targetSubjectsOf rml:source ; - sh:targetClass rml:LogicalSource ; # Used as a class - # Already targets 'rml:logicalSource' - rdfs:label "RML Logical Source" ; - rdfs:comment """ - A logical source is any source that is mapped to RDF triples. - """ ; - sh:message """ - RML Logical Source requires one rml:source and requires everyting - an Abstract Logical Source requires. - """ ; - - # rml:source - sh:property [ - sh:path rml:source ; - rdfs:label "rml:source" ; - rdfs:comment """ - The source (rml:source) locates the input data source. It is a URI - that represents the data source where the data source is. - """ ; - sh:message """ - rml:source must be provided to locate the data source. - rml:source must be provided exactly once as an URI. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI; - sh:node :RMLSourceShape; - ] ; -. diff --git a/src/main/resources/shapes/rml-io/logical_target.ttl b/src/main/resources/shapes/rml-io/logical_target.ttl deleted file mode 100644 index c411644..0000000 --- a/src/main/resources/shapes/rml-io/logical_target.ttl +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################### -# RML Logical Target shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLLogicalTargetShape - a sh:NodeShape ; - sh:targetObjectsOf rml:logicalTarget ; # Object of rml:TriplesMap - sh:targetClass rml:LogicalTarget ; # Used as a class - # Already targets 'rml:logicalTarget' - rdfs:label "RML Logical Target" ; - rdfs:comment """ - A logical target is any target to where generated RDF triples are exported - to. - """ ; - sh:message """ - RML Logical Target requires one rml:target. - """ ; - - # rml:target - sh:property [ - sh:path rml:target ; - rdfs:label "rml:target" ; - rdfs:comment """ - The target (rml:target) locates the output target. It is a URI - that represents the target where it must export generated RDF triples - to. - """ ; - sh:message """ - rml:target must be provided to locate the target. rml:target must - be provided exactly once as an URI. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI; - sh:node :RMLTargetShape; - ] ; -. diff --git a/src/main/resources/shapes/rml-io/mapping_validator.py b/src/main/resources/shapes/rml-io/mapping_validator.py deleted file mode 100644 index 033c8b8..0000000 --- a/src/main/resources/shapes/rml-io/mapping_validator.py +++ /dev/null @@ -1,45 +0,0 @@ -from logging import debug, info, critical -from pyshacl import validate -from rdflib import Graph -from shutil import get_terminal_size - - -class MappingValidator: - def __init__(self, shape: str, ontology: str) -> None: - sg = Graph() - sg.parse(shape, format='turtle') - self._shape = sg - og = Graph() - og.parse(ontology, format='turtle') - self._ont = og - - def validate(self, rules: Graph, print_report: bool = True) -> None: - valid: bool - report_graph: Graph - report_text: str - valid, report_graph, report_text = validate(rules, - shacl_graph=self._shape, - ont_graph=self._ont, - do_owl_imports=True) - debug(f'RML rules valid: {valid}') - debug(f'SHACL validation report: {report_text}') - - # If mapping rules are invalid, print SHACL report and raise exception - if not valid and print_report: - self._print_report(report_text) - msg = 'RML mapping rules are invalid, a detailed explanation' \ - ' is available in the report' - critical(msg) - raise ValueError(msg) - - def _print_report(self, report_text: str) -> None: - tty_columns: int - tty_columns, _ = get_terminal_size() - info('-' * tty_columns) - title: str = 'RML rules validation report' - white_space: int = int((tty_columns - len(title)) / 2) - title = ' ' * white_space + title + ' ' * white_space - info(title) - info('-' * tty_columns) - info(report_text) - info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-io/relative_path_source.ttl b/src/main/resources/shapes/rml-io/relative_path_source.ttl deleted file mode 100644 index 0bf5d2b..0000000 --- a/src/main/resources/shapes/rml-io/relative_path_source.ttl +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################### -# RML Relative Path Source shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLRelativePathSourceShape - a sh:NodeShape ; - sh:targetClass rml:RelativePathSource ; # Used as a class - rdfs:label "RML Relative Path Source" ; - rdfs:comment """ - A RML Relative Path Source provides a source with relative paths which is - not provided by existing vocabularies such as DCAT without a base IRI. - """ ; - sh:message """ - RML Relative Path Source accepts one rml:root, and one rml:path. - rml:root is optional and defaults to rml:CurrentWorkingDirectory. - """ ; - - # rml:root - sh:property [ - sh:path rml:root ; - rdfs:label "rml:root" ; - rdfs:comment """ - rml:root defines the root directory against which relative paths are - resolved. If not provided, defaults to the current working directory. - """ ; - sh:message """ - rml:root must be either rml:CurrentWorkingDirectory or - rml:MappingDirectory. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:in (rml:CurrentWorkingDirectory rml:MappingDirectory) ; - ] ; - - # rml:path - sh:property [ - sh:path rml:path ; - rdfs:label "rml:path" ; - rdfs:comment """ - rml:path specifies the relative path to access for the source. - """ ; - sh:message """ - rml:path must be a string Literal. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:Literal ; - ] ; -. diff --git a/src/main/resources/shapes/rml-io/relative_path_target.ttl b/src/main/resources/shapes/rml-io/relative_path_target.ttl deleted file mode 100644 index 980d537..0000000 --- a/src/main/resources/shapes/rml-io/relative_path_target.ttl +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################### -# RML Relative Path Target shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLRelativePathTargetShape - a sh:NodeShape ; - sh:targetClass rml:RelativePathTarget ; # Used as a class - rdfs:label "RML Relative Path Target" ; - rdfs:comment """ - A RML Relative Path Target provides a target with relative paths which is - not provided by existing vocabularies such as DCAT without a base IRI. - """ ; - sh:message """ - RML Relative Path Target accepts one rml:root, and one rml:path. - rml:root is optional and defaults to rml:CurrentWorkingDirectory. - """ ; - - # rml:root - sh:property [ - sh:path rml:root ; - rdfs:label "rml:root" ; - rdfs:comment """ - rml:root defines the root directory against which relative paths are - resolved. If not provided, defaults to the current working directory. - """ ; - sh:message """ - rml:root must be either rml:CurrentWorkingDirectory or - rml:MappingDirectory. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:in (rml:CurrentWorkingDirectory rml:MappingDirectory) ; - ] ; - - # rml:path - sh:property [ - sh:path rml:path ; - rdfs:label "rml:path" ; - rdfs:comment """ - rml:path specifies the relative path to access for the target. - """ ; - sh:message """ - rml:path must be a string Literal. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:Literal ; - ] ; -. diff --git a/src/main/resources/shapes/rml-io/requirements.txt b/src/main/resources/shapes/rml-io/requirements.txt deleted file mode 100644 index 3d264b8..0000000 --- a/src/main/resources/shapes/rml-io/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -parameterized -rdflib -pyshacl diff --git a/src/main/resources/shapes/rml-io/shapes_graph.ttl b/src/main/resources/shapes/rml-io/shapes_graph.ttl deleted file mode 100644 index 40f733c..0000000 --- a/src/main/resources/shapes/rml-io/shapes_graph.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix owl: . - - a owl:Ontology ; - owl:imports ; -. diff --git a/src/main/resources/shapes/rml-io/source.ttl b/src/main/resources/shapes/rml-io/source.ttl deleted file mode 100644 index 9a29e45..0000000 --- a/src/main/resources/shapes/rml-io/source.ttl +++ /dev/null @@ -1,91 +0,0 @@ -############################################################################### -# RML Source shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLSourceShape - a sh:NodeShape ; - sh:targetObjectsOf rml:source ; # Object of rml:LogicalSource - sh:targetClass rml:Source ; # Used as a class - # Already targets 'rml:source' - rdfs:label "RML Source" ; - rdfs:comment """ - A source describes access to a data source. Any data access description - is allowed, but rml:Source provides additional properties to complete - such descriptions. - """ ; - sh:message """ - RML Source accepts one or multiple rml:null, one rml:compression, - and one rml:encoding. All of them are optional. - """ ; - - # rml:null - sh:property [ - sh:path rml:null ; - rdfs:label "rml:null" ; - rdfs:comment """ - rml:null specifies how NULL or empty values are exposed by the data - source. - """ ; - sh:message """ - rml:source must be provided as a string Literal. - """ ; - sh:minCount 0 ; - sh:nodeKind sh:Literal; - sh:datatype xsd:string ; - ] ; - - # rml:compression - sh:property [ - sh:path rml:compression ; - rdfs:label "rml:compression" ; - rdfs:comment """ - rml:compression specifies the compression algorithm to use when - accessing the data source. By default, no compression is applied. - """ ; - sh:message """ - rml:compression must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:nodeKind sh:IRI; - ] ; - - # rml:encoding - sh:property [ - sh:path rml:encoding ; - rdfs:label "rml:encoding" ; - rdfs:comment """ - rml:encoding specifies the encoding to use when accessing the data - source. By default, UTF-8 is used. - """ ; - sh:message """ - rml:encoding must be provided as an IRI. - """ ; - sh:minCount 0; - sh:maxCount 1 ; - sh:nodeKind sh:IRI ; - ] ; - - # rml:null - sh:property [ - sh:path rml:null ; - rdfs:label "rml:null" ; - rdfs:comment """ - rml:null specifies which data values inside the source should be - considered as NULL. Defaults to the default NULL character of a source, - if available. - """ ; - sh:message """ - rml:null must be provided as a Literal. - """ ; - sh:minCount 0; - sh:nodeKind sh:Literal ; - ] ; -. diff --git a/src/main/resources/shapes/rml-io/target.ttl b/src/main/resources/shapes/rml-io/target.ttl deleted file mode 100644 index 82b55a0..0000000 --- a/src/main/resources/shapes/rml-io/target.ttl +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################### -# RML Target shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2024) # -############################################################################### -@prefix sh: . -@prefix rdfs: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -:RMLTargetShape - a sh:NodeShape ; - sh:targetObjectsOf rml:target ; # Object of rml:LogicalTarget - sh:targetClass rml:Target ; # Used as a class - # Already targets 'rml:target' - rdfs:label "RML Target" ; - rdfs:comment """ - A target describes access to a data target. Any data access description - is allowed, but rml:Target provides additional properties to complete - such descriptions. - """ ; - sh:message """ - RML Target accepts one rml:compression, and one rml:encoding. - All of them are optional. - """ ; - - # rml:compression - sh:property [ - sh:path rml:compression ; - rdfs:label "rml:compression" ; - rdfs:comment """ - rml:compression specifies the compression algorithm to use when - accessing the data target. By default, no compression is applied. - """ ; - sh:message """ - rml:compression must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:nodeKind sh:IRI; - ] ; - - # rml:encoding - sh:property [ - sh:path rml:encoding ; - rdfs:label "rml:encoding" ; - rdfs:comment """ - rml:encoding specifies the encoding to use when accessing the data - target. By default, UTF-8 is used. - """ ; - sh:message """ - rml:encoding must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:nodeKind sh:IRI ; - ] ; - - # rml:serialization - sh:property [ - sh:path rml:serialization ; - rdfs:label "rml:serialization" ; - rdfs:comment """ - rml:serialization specifies the serialization format to use when - exporting the generated RDF to a target. By default N-Quads is used. - """ ; - sh:message """ - rml:serialization must be provided as an IRI. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:nodeKind sh:IRI ; - ] ; - - # rml:mode - sh:property [ - sh:path rml:mode ; - rdfs:label "rml:mode" ; - rdfs:comment """ - rml:mode specifies in which mode the target is opened such as read-only, - write-only, both, etc. - """ ; - sh:message """ - rml:mode must be specified by any of the modes from rml:Mode class. - """ ; - sh:minCount 0 ; - sh:maxCount 1 ; - sh:in (rml:Read rml:ReadWrite rml:Write rml:WriteRead rml:Append - rml:AppendRead) ; - ] ; -. diff --git a/src/main/resources/shapes/rml-io/tests.py b/src/main/resources/shapes/rml-io/tests.py deleted file mode 100644 index ef6666a..0000000 --- a/src/main/resources/shapes/rml-io/tests.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -# (c) Dylan Van Assche (2020 - 2023) -# IDLab - Ghent University - imec -# MIT license -# - -import os -import argparse -import unittest -import logging -from parameterized import parameterized -from glob import glob -from rdflib import Graph - -from mapping_validator import MappingValidator -from utils import replace_strings_in_file, cleanup_tmp_folder - -TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), '*/*.ttl') -SHAPE_FILE_LOCATION = 'io.ttl' -ONTOLOGY_FILE_LOCATION = '../ontology/documentation/ontology.ttl' - - -class MappingValidatorTests(unittest.TestCase): - def _validate_rules(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - - # Replace import statements - shapes = replace_strings_in_file(SHAPE_FILE_LOCATION, { - '': '' - }) - ontology = replace_strings_in_file(ONTOLOGY_FILE_LOCATION, { - '': '' - }) - - mapping_validator = MappingValidator(shapes, ontology) - mapping_validator.validate(rules) - - cleanup_tmp_folder(shapes) - cleanup_tmp_folder(ontology) - - def test_non_existing_mapping_rules(self) -> None: - with self.assertRaises(FileNotFoundError): - p = os.path.abspath('does_not_exist.ttl') - self._validate_rules(p) - - @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], - skip_on_empty=True) - def test_validation_rules(self, path: str) -> None: - """ - Test if our SHACL shapes are able to validate our validation mapping - rules test cases. - """ - print(f'Testing validation with: {path}') - self._validate_rules(path) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Execute tests for SHACL ' - 'shapes on RML mapping rules.') - parser.add_argument('--verbose', '-v', action='count', default=1, - help='Set verbosity level of messages. Example: -vvv') - args = parser.parse_args() - - args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 - logging.basicConfig(level=args.verbose, - format='%(asctime)s %(levelname)s: %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - - print(TEST_CASES_DIR) - unittest.main(failfast=False) - diff --git a/src/main/resources/shapes/rml-io/utils.py b/src/main/resources/shapes/rml-io/utils.py deleted file mode 100644 index 437871a..0000000 --- a/src/main/resources/shapes/rml-io/utils.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -import shutil - -def replace_strings_in_file(file_path: str, replacements: dict) -> str: - abs_path = os.path.abspath(file_path) - tmp_dir = os.path.join(os.path.dirname(abs_path), 'tmp') - os.makedirs(tmp_dir, exist_ok=True) - tmp_file_path = os.path.join(tmp_dir, os.path.basename(abs_path)) - - with open(abs_path, 'r') as file: - file_data = file.read() - - for old_string, new_string in replacements.items(): - file_data = file_data.replace(old_string, new_string) - - with open(tmp_file_path, 'w') as file: - file.write(file_data) - - return tmp_file_path - -def cleanup_tmp_folder(file_path: str) -> None: - abs_path = os.path.abspath(file_path) - tmp_dir = os.path.dirname(abs_path) - if os.path.exists(tmp_dir): - shutil.rmtree(tmp_dir) diff --git a/src/main/resources/shapes/rml-lv/lv.ttl b/src/main/resources/shapes/rml-lv/lv.ttl deleted file mode 100644 index 1d1e9fe..0000000 --- a/src/main/resources/shapes/rml-lv/lv.ttl +++ /dev/null @@ -1,361 +0,0 @@ -@prefix owl: . -@prefix rml: . -@prefix rmlsh: . -@prefix sh: . -@prefix xsd: . -@prefix rdfs: . - - a owl:Ontology ; - owl:imports ; -. - -# rml:LogicalView -rmlsh:LogicalViewShape a sh:NodeShape ; - rdfs:label "LogicalView" ; - rdfs:comment """ - A logical view (rml:LogicalView) is a type of abstract logical source that is derived from another abstract logical source by defining fields with data from said abstract logical source. - """ ; - sh:message """ - Node must have a valid rml:LogicalView description. - rml:LogicalView requires - - exactly one rml:viewOn property, with a rml:AbstractLogicalSource as its value. - - at least one rml:field property, with a rml:Field as its value. - """ ; - sh:targetClass rml:LogicalView ; - sh:targetSubjectsOf rml:viewOn ; - sh:targetObjectsOf rml:parentLogicalView ; - sh:property [ - sh:description """ - The source of the logical view. This is the logical source from which the logical view is derived. - """ ; - sh:message """ - Exactly one rml:viewOn property must be specified for a rml:LogicalView, with a rml:AbstractLogicalSource as its value. - """ ; - sh:path rml:viewOn ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:node rmlsh:RMLAbstractLogicalSourceShape ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] , [ - sh:description """ - A field of the logical view. - """ ; - sh:message """ - At least one rml:field property must be specified for a rml:LogicalView, with either an rml:ExpressionField or an rml:IterableField its value. - """ ; - sh:path rml:field ; - sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( - [ sh:node rmlsh:ExpressionFieldShape ] - [ sh:node rmlsh:IterableFieldShape ] - ) - ] , [ - sh:description """ - A left join of the logical view. - """ ; - sh:message """ - The value of a rml:leftJoin property for a rml:LogicalView must be a resource. - """ ; - sh:path rml:leftJoin ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] , [ - sh:description """ - An inner join of the logical view. - """ ; - sh:message """ - The value of a rml:innerJoin property for a rml:LogicalView must be a resource. - """ ; - sh:path rml:innerJoin ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] , - [ - sh:description """ - A structural annotation of the logical view. - """ ; - sh:message """ - The value of a rml:structuralAnnotation property must be a resource. - """ ; - sh:path rml:structuralAnnotation ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] -. - -rmlsh:FieldShape a sh:NodeShape ; - rdfs:label "Field" ; - rdfs:comment """ - A field is a construct that gives a name to data derived from an abstract logical source. - """ ; - sh:message """ - Node must have a valid rml:Field description. - rml:Field requires a rml:fieldName and may have zero or more rml:field properties. - Furthermore, subclass rml:ExpressionField requires what an rml:ExpressionMap requires, subclass rml:IterableField requires what an rml:Iterable requires,. - """ ; - sh:targetClass rml:Field ; - sh:targetObjectsOf rml:field ; - sh:property [ - sh:description """ - The name of the field. - """ ; - sh:message """ - Exactly one rml:fieldName property must be specified for a rml:Field, with a string as its value. - """ ; - sh:path rml:fieldName ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:datatype xsd:string ; - sh:nodeKind sh:Literal ; - ] , [ - sh:description """ - A child field of the field. - """ ; - sh:message """ - The value of a rml:field property for a rml:Field must be a resource. - """ ; - sh:path rml:field ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( - [ sh:node rmlsh:ExpressionFieldShape ] - [ sh:node rmlsh:IterableFieldShape ] - ) - ] . - -rmlsh:ExpressionFieldShape a sh:NodeShape ; - rdfs:label "Expression Field" ; - rdfs:comment """ - A expression field is an expression map that gives a name to an expression. - """ ; - sh:message """ - Node must have a valid rml:ExpressionField description. - rml:ExpressionField requires what an rml:ExpressionMap and rml:Field requires. - """ ; - sh:targetClass rml:ExpressionField ; - sh:node rmlsh:RMLExpressionMapShape ; - ## Not using sh:node rmlsh:Field here due to shape recursion problem https://github.com/RDFLib/pySHACL/issues/154 - sh:property [ - sh:description """ - The name of the field. - """ ; - sh:message """ - Exactly one rml:fieldName property must be specified for a rml:Field, with a string as its value. - """ ; - sh:path rml:fieldName ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:datatype xsd:string ; - sh:nodeKind sh:Literal ; - ] , [ - sh:description """ - A child field of the field. - """ ; - sh:message """ - The value of a rml:field property for a rml:Field must be a resource. - """ ; - sh:path rml:field ; - sh:nodeKind sh:BlankNodeOrIRI ; - ## Disabled due to shape recursion. This is covered by rmlsh:FieldShape - # sh:or ( - # [ sh:node rmlsh:ExpressionFieldShape ] - # [ sh:node rmlsh:IterableFieldShape ] - # ) - ] -. - -rmlsh:IterableFieldShape a sh:NodeShape ; - rdfs:label "Iterable Field" ; - rdfs:comment """ - An iterable field is a construction that gives a name to logical iterations derived from the parent of the field. - """ ; - sh:message """ - Node must have a valid rml:IterableField description. - rml:IterableField must have one or more rml:field properties. - Furthermore, rml:IterableField requires what an rml:Iterable and rml:Field requires. - """ ; - sh:targetClass rml:IterableField ; - sh:node rmlsh:RMLIterableShape ; - ## Not using sh:node rmlsh:Field here due to shape recursion problem https://github.com/RDFLib/pySHACL/issues/154 - sh:property [ - sh:description """ - The name of the field. - """ ; - sh:message """ - Exactly one rml:fieldName property must be specified for a rml:Field, with a string as its value. - """ ; - sh:path rml:fieldName ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:datatype xsd:string ; - sh:nodeKind sh:Literal ; - ] ; - sh:property [ - sh:description """ - A child field of the iterable field. - """ ; - sh:message """ - The value of a rml:field property for a rml:Field must be a resource that describes an rml:ExpressionField. - """ ; - sh:path rml:field ; - sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] . - -rmlsh:LogicalViewJoinShape a sh:NodeShape ; - rdfs:label "LogicalViewJoin" ; - rdfs:comment """ - A LogicalViewJoin is an operation that adapts the logical iterations of one logical view (the child logical view) with fields from another logical view (the parent logical view). - """ ; - sh:message """ - Node must have a valid rml:LogicalViewJoin description. - rml:LogicalViewJoin requires: - - exactly one rml:parentLogicalView property. - - one or more rml:joinCondition properties. - - one or more rml:field properties. - Furthermore, rml:Field requires what an rml:ExpressionMap requires. - """ ; - sh:targetClass rml:LogicalViewJoin ; - sh:targetObjectsOf rml:leftJoin , rml:innerJoin ; - sh:property [ - sh:description """ - The parent logical view of the logical view join. - """ ; - sh:message """ - Exactly one rml:parentLogicalView property must be specified for a rml:LogicalViewJoin, with a resource as its value. - """ ; - sh:path rml:parentLogicalView ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] , [ - sh:description """ - A join condition of the logical view join. - """ ; - sh:message """ - At least one rml:parentLogicalView property must be specified for a rml:LogicalViewJoin, with a resource as its value. - """ ; - sh:path rml:joinCondition ; - sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] , [ - sh:description """ - A field of the logical view join. - """ ; - sh:message """ - At least one rml:field property must be specified for a rml:LogicalViewJoin, with a leaf expression field as its value. - """ ; - sh:path rml:field ; - sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:node rmlsh:LeafExpressionFieldShape ; - ] . - -rmlsh:LeafExpressionFieldShape a sh:NodeShape ; - rdfs:label "Leaf Expression Field" ; - rdfs:comment """ - A leaf expression field is an expression field without nested fields. - """ ; - sh:message """ - Node must have a valid rml:ExpressionField description. - """ ; - sh:node rmlsh:ExpressionFieldShape ; - sh:property [ - sh:description """ - A leaf expression field is an expression field without nested fields. - """ ; - sh:message """ - A leaf expression field has no nested fields. - """ ; - sh:path rml:field ; - sh:maxCount 0 ; - ] . - -rmlsh:StructuralAnnotationShape a sh:NodeShape; - rdfs:label "StructuralAnnotation" ; - rdfs:comment """ - Structural annotations provide a mechanism to express relationships between logical views, as well as additional information about fields. - """ ; - sh:message """ - Node must have a valid rml:StructuralAnnotationShape description. - All structural annotations of a logical view lv MUST have an on fields property (rml:onFields), linking the structural annotation to a list of field names occurring in lv. - rml:StructuralAnnotationShape requires: - - exactly one rml:onFields property. - """ ; - sh:targetClass rml:StructuralAnnotation ; - sh:targetObjectsOf rml:structuralAnnotation ; - sh:property [ - sh:description """ - property onFields specifies the fields in LogicalView that are involved by the structural annotation. The semantics of this involvement depends on the specific annotation. - """ ; - sh:message """ - Exactly one rml:onFields property must be specified for each rml:StructuralAnnotation - """ ; - sh:path rml:onFields ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] . - -rmlsh:InclusionAnnotationShape a sh:NodeShape; - rdfs:label "InclusionAnnotation" ; - rdfs:comment """ - The InclusionAnnotaton annotation (rml:InclusionAnnotation) is analogous to the notion of inclusion dependency in databases. - """ ; - sh:message """ - Node must have a valid rml:InclusionAnnotation description. - Each InclusionAnnotation annotation requires (additionally to the inherited `rml:onFields` property): - - Exactly one `rml:targetView` property - - Exactly one `rml:targetFields` property. - """ ; - sh:targetClass rml:InclusionAnnotation ; - sh:property [ - sh:description """ - property targetView specifies the LogicalView target of the InclusionAnnotation annotation. - """ ; - sh:message """ - Exactly one rml:targetView property must be specified for each rml:InclusionAnnotation. - """ ; - sh:path rml:targetView ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] , [ - sh:description """ - property targetFields specifies the Fields target of the InclusionAnnotation. - """ ; - sh:message """ - Exactly one rml:targetFields property must be specified for each rml:InclusionAnnotation. - """ ; - sh:path rml:targetFields ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - ] . - -rmlsh:parentCyclesShape a sh:NodeShape ; - sh:targetSubjectsOf rml:viewOn ; - sh:targetSubjectsOf rml:field ; - sh:sparql [ - a sh:SPARQLConstraint ; - sh:message "There must be no cycles via rml:viewOn or rml:Field." ; - sh:select """ - PREFIX rml: - SELECT ?this - WHERE { - ?this (rml:viewOn|rml:field)+ ?this . - } - """ ; - ] . - -rmlsh:joinCyclesShape a sh:NodeShape ; - sh:targetSubjectsOf rml:viewOn ; - sh:sparql [ - a sh:SPARQLConstraint ; - sh:message "There must be no cycles via rml:viewOn and rml:leftJoin or rml:innerJoin." ; - sh:select """ - PREFIX rml: - SELECT ?this - WHERE { - ?this a rml:LogicalView . - ?this ((rml:leftJoin|rml:innerJoin)/rml:parentLogicalView)+ ?this . - } - """ ; - ] . diff --git a/src/main/resources/shapes/rml-lv/mapping_validator.py b/src/main/resources/shapes/rml-lv/mapping_validator.py deleted file mode 100644 index 033c8b8..0000000 --- a/src/main/resources/shapes/rml-lv/mapping_validator.py +++ /dev/null @@ -1,45 +0,0 @@ -from logging import debug, info, critical -from pyshacl import validate -from rdflib import Graph -from shutil import get_terminal_size - - -class MappingValidator: - def __init__(self, shape: str, ontology: str) -> None: - sg = Graph() - sg.parse(shape, format='turtle') - self._shape = sg - og = Graph() - og.parse(ontology, format='turtle') - self._ont = og - - def validate(self, rules: Graph, print_report: bool = True) -> None: - valid: bool - report_graph: Graph - report_text: str - valid, report_graph, report_text = validate(rules, - shacl_graph=self._shape, - ont_graph=self._ont, - do_owl_imports=True) - debug(f'RML rules valid: {valid}') - debug(f'SHACL validation report: {report_text}') - - # If mapping rules are invalid, print SHACL report and raise exception - if not valid and print_report: - self._print_report(report_text) - msg = 'RML mapping rules are invalid, a detailed explanation' \ - ' is available in the report' - critical(msg) - raise ValueError(msg) - - def _print_report(self, report_text: str) -> None: - tty_columns: int - tty_columns, _ = get_terminal_size() - info('-' * tty_columns) - title: str = 'RML rules validation report' - white_space: int = int((tty_columns - len(title)) / 2) - title = ' ' * white_space + title + ' ' * white_space - info(title) - info('-' * tty_columns) - info(report_text) - info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-lv/requirements.txt b/src/main/resources/shapes/rml-lv/requirements.txt deleted file mode 100644 index e9fdd84..0000000 --- a/src/main/resources/shapes/rml-lv/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -parameterized -rdflib -pyshacl \ No newline at end of file diff --git a/src/main/resources/shapes/rml-lv/tests.py b/src/main/resources/shapes/rml-lv/tests.py deleted file mode 100644 index 295eca0..0000000 --- a/src/main/resources/shapes/rml-lv/tests.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -# (c) Dylan Van Assche (2020 - 2023) -# IDLab - Ghent University - imec -# MIT license -# - -import os -import argparse -import unittest -import logging -from parameterized import parameterized -from glob import glob -from rdflib import Graph - -from mapping_validator import MappingValidator -from utils import replace_strings_in_file, cleanup_tmp_folder - -TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), '*/*.ttl') -SHAPE_FILE_LOCATION = 'lv.ttl' -ONTOLOGY_FILE_LOCATION = '../ontology/documentation/ontology.ttl' - - -class MappingValidatorTests(unittest.TestCase): - def _validate_rules(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - - # Replace import statements - # also include io shapes just to validate the logical sources in the test cases - shapes = replace_strings_in_file(SHAPE_FILE_LOCATION, { - '': ', ' - }) - ontology = replace_strings_in_file(ONTOLOGY_FILE_LOCATION, { - '': '' - }) - - mapping_validator = MappingValidator(shapes, ontology) - mapping_validator.validate(rules) - - cleanup_tmp_folder(shapes) - cleanup_tmp_folder(ontology) - - def test_non_existing_mapping_rules(self) -> None: - with self.assertRaises(FileNotFoundError): - p = os.path.abspath('does_not_exist.ttl') - self._validate_rules(p) - - @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], - skip_on_empty=True) - def test_validation_rules(self, path: str) -> None: - """ - Test if our SHACL shapes are able to validate our validation mapping - rules test cases. - """ - print(f'Testing validation with: {path}') - if 'RMLLVTC0008a' in path or 'RMLLVTC0008b' in path or \ - 'RMLLVTC0008c' in path or 'RMLLVTC0008d' in path: - with self.assertRaises(Exception): - self._validate_rules(path) - else: - self._validate_rules(path) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Execute tests for SHACL ' - 'shapes on RML mapping rules.') - parser.add_argument('--verbose', '-v', action='count', default=1, - help='Set verbosity level of messages. Example: -vvv') - args = parser.parse_args() - - args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 - logging.basicConfig(level=args.verbose, - format='%(asctime)s %(levelname)s: %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - - print(TEST_CASES_DIR) - unittest.main(failfast=False) diff --git a/src/main/resources/shapes/rml-lv/utils.py b/src/main/resources/shapes/rml-lv/utils.py deleted file mode 100644 index 437871a..0000000 --- a/src/main/resources/shapes/rml-lv/utils.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -import shutil - -def replace_strings_in_file(file_path: str, replacements: dict) -> str: - abs_path = os.path.abspath(file_path) - tmp_dir = os.path.join(os.path.dirname(abs_path), 'tmp') - os.makedirs(tmp_dir, exist_ok=True) - tmp_file_path = os.path.join(tmp_dir, os.path.basename(abs_path)) - - with open(abs_path, 'r') as file: - file_data = file.read() - - for old_string, new_string in replacements.items(): - file_data = file_data.replace(old_string, new_string) - - with open(tmp_file_path, 'w') as file: - file.write(file_data) - - return tmp_file_path - -def cleanup_tmp_folder(file_path: str) -> None: - abs_path = os.path.abspath(file_path) - tmp_dir = os.path.dirname(abs_path) - if os.path.exists(tmp_dir): - shutil.rmtree(tmp_dir) diff --git a/src/main/resources/shapes/rml-star/assertedtriples_map.ttl b/src/main/resources/shapes/rml-star/assertedtriples_map.ttl deleted file mode 100644 index 628ab6e..0000000 --- a/src/main/resources/shapes/rml-star/assertedtriples_map.ttl +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################### -# RML Asserted Triples Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2025) # -############################################################################### -@prefix : . -@prefix rdfs: . -@prefix sh: . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Validate an RML Asserted Triples Map -:RMLAssertedTriplesMapShape - a sh:NodeShape ; - sh:targetClass rml:AssertedTriplesMap ; - sh:message "AssertedTriplesMap" ; - rdfs:comment """ - Represents a Asserted Triples Map. - """ ; - sh:message """ - Asserted Triples Map requires exactly one rml:subject or - one rml:subjectMap and zero or more rml:predicateObjectMaps - and exactly one rml:logicalSource. - """ ; - - sh:and ( - # Inherited shapes - :RMLTriplesMapPropertiesShape - # Asserted Triples Map specific shapes - [ - sh:path rdf:type ; - sh:message """ - Asserted Triples Map must have a rml:AssertedTriplesMap type. - """ ; - sh:value rml:AssertedTriplesMap ; - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-star/external_shapes.ttl b/src/main/resources/shapes/rml-star/external_shapes.ttl deleted file mode 100644 index b58054a..0000000 --- a/src/main/resources/shapes/rml-star/external_shapes.ttl +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# RML Star external resources shapes # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # -############################################################################### -@prefix sh: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Shapes are defined in the corresponding repositories of each specification -# Provide their IRI as stub to allow validation in Star. - -:RMLJoinConditionPropertiesShape - a sh:NodeShape; -. - -:RMLTriplesMapPropertiesShape - a sh:NodeShape; -. diff --git a/src/main/resources/shapes/rml-star/generate_shape.py b/src/main/resources/shapes/rml-star/generate_shape.py deleted file mode 100755 index 33e4745..0000000 --- a/src/main/resources/shapes/rml-star/generate_shape.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -import argparse -import sys -from os import path -from glob import glob -from rdflib import Graph, Namespace -from rdflib.plugins.serializers.turtle import TurtleSerializer -from rdflib import plugin - -SUBSHAPE_FORMAT = 'turtle' -SUBSHAPE_GLOB_PATTERN = '*.ttl' -SHACL = Namespace('http://www.w3.org/ns/shacl#') -RML = Namespace('http://w3id.org/rml/') - - -class TurtleWithPrefixes(TurtleSerializer): - """ - A turtle serializer that always emits prefixes - Workaround for https://github.com/RDFLib/rdflib/issues/1048 - """ - roundtrip_prefixes = True # Undocumented, forces to write all prefixes - - -class ShapeGenerator: - """ - Generates a complete SHACL shape of all the SHACL subshapes. - Useful for using the shapes in the shacl.org Playground. - """ - def __init__(self, glob_pattern: str, rdf_format: str, - destination: str) -> None: - self._glob_pattern: str = glob_pattern - self._rdf_format: str = rdf_format - self._destination: str = destination - self._shape = Graph() - self._shape.bind('sh', SHACL) - self._shape.bind('rml', RML) - # Register TurtleWithPrefixes serializer as 'tortoise' format - plugin.register('tortoise', - plugin.Serializer, - 'generate_shape', - 'TurtleWithPrefixes') - - def generate(self) -> None: - """ - Generate a full shape from the sub shapes. - """ - print('Reading subshapes:') - for sub_shape in glob(self._glob_pattern): - if 'star.ttl' in sub_shape or 'shacl.ttl' in sub_shape: - continue - print(f"\t{sub_shape}") - g = Graph() - g.bind('sh', SHACL) - g.bind('rml', RML) - self._shape += g.parse(sub_shape, format=self._rdf_format) - - print(f'Writing shape to {self._destination}') - self._shape.serialize(destination=self._destination, format='tortoise') - - -if __name__ == '__main__': - p = argparse.ArgumentParser(description='Generate a complete SHACL shape ' - 'from the subshapes.') - p.add_argument('destination', type=str, help='Location to write the ' - 'complete SHACL shape as Turtle.') - # Arguments parsing - args = p.parse_args() - if not path.exists(args.destination): - print(f'{args.destination} file path does not exist!') - sys.exit(1) - - if path.isdir(args.destination): - args.destination = path.join(args.destination, 'star.ttl') - - # Generate shape - generator = ShapeGenerator(SUBSHAPE_GLOB_PATTERN, SUBSHAPE_FORMAT, - args.destination) - generator.generate() diff --git a/src/main/resources/shapes/rml-star/mapping_validator.py b/src/main/resources/shapes/rml-star/mapping_validator.py deleted file mode 100755 index dabb1d2..0000000 --- a/src/main/resources/shapes/rml-star/mapping_validator.py +++ /dev/null @@ -1,40 +0,0 @@ -from logging import debug, info, critical -from pyshacl import validate -from rdflib import Graph -from shutil import get_terminal_size - - -class MappingValidator: - def __init__(self, shape: str) -> None: - g = Graph() - g.parse(shape, format='turtle') - self._shape = g - - def validate(self, rules: Graph, print_report: bool = True) -> None: - valid: bool - report_graph: Graph - report_text: str - valid, report_graph, report_text = validate(rules, - shacl_graph=self._shape) - debug(f'RML rules valid: {valid}') - debug(f'SHACL validation report: {report_text}') - - # If mapping rules are invalid, print SHACL report and raise exception - if not valid and print_report: - self._print_report(report_text) - msg = 'RML mapping rules are invalid, a detailed explanation' \ - ' is available in the report' - critical(msg) - raise ValueError(msg) - - def _print_report(self, report_text: str) -> None: - tty_columns: int - tty_columns, _ = get_terminal_size() - info('-' * tty_columns) - title: str = 'RML rules validation report' - white_space: int = int((tty_columns - len(title)) / 2) - title = ' ' * white_space + title + ' ' * white_space - info(title) - info('-' * tty_columns) - info(report_text) - info('-' * tty_columns) diff --git a/src/main/resources/shapes/rml-star/nonassertedtriples_map.ttl b/src/main/resources/shapes/rml-star/nonassertedtriples_map.ttl deleted file mode 100644 index 7de4a21..0000000 --- a/src/main/resources/shapes/rml-star/nonassertedtriples_map.ttl +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################### -# RML Non Asserted Triples Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2025) # -############################################################################### -@prefix : . -@prefix rdfs: . -@prefix sh: . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Validate an RML Non Asserted Triples Map -:RMLNonAssertedTriplesMapShape - a sh:NodeShape ; - sh:targetClass rml:NonAssertedTriplesMap ; - sh:message "NonAssertedTriplesMap" ; - rdfs:comment """ - Represents a Non Asserted Triples Map. - """ ; - sh:message """ - Non Asserted Triples Map requires exactly one rml:subject or - one rml:subjectMap and zero or more rml:predicateObjectMaps - and exactly one rml:logicalSource. - """ ; - - sh:and ( - # Inherited shapes - :RMLTriplesMapPropertiesShape - # Non Asserted Triples Map specific shapes - [ - sh:path rdf:type ; - sh:message """ - Non Asserted Triples Map must have a rml:NonAssertedTriplesMap type. - """ ; - sh:value rml:NonAssertedTriplesMap ; - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-star/requirements.txt b/src/main/resources/shapes/rml-star/requirements.txt deleted file mode 100644 index 3d264b8..0000000 --- a/src/main/resources/shapes/rml-star/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -parameterized -rdflib -pyshacl diff --git a/src/main/resources/shapes/rml-star/shacl.ttl b/src/main/resources/shapes/rml-star/shacl.ttl deleted file mode 100644 index e37856a..0000000 --- a/src/main/resources/shapes/rml-star/shacl.ttl +++ /dev/null @@ -1,406 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - -@prefix shsh: . - -shsh: - rdfs:label "SHACL for SHACL"@en ; - rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ; - sh:declare [ - sh:prefix "shsh" ; - sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; - ] . - - -shsh:ListShape - a sh:NodeShape ; - rdfs:label "List shape"@en ; - rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath rdf:rest ] ; - rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; - sh:hasValue rdf:nil ; - sh:node shsh:ListNodeShape ; - ] . - -shsh:ListNodeShape - a sh:NodeShape ; - rdfs:label "List node shape"@en ; - rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; - sh:or ( [ - sh:hasValue rdf:nil ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 0 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 0 ; - ] ; - ] - [ - sh:not [ sh:hasValue rdf:nil ] ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - ] ) . - -shsh:ShapeShape - a sh:NodeShape ; - rdfs:label "Shape shape"@en ; - rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; - - # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape - sh:targetClass sh:NodeShape ; - sh:targetClass sh:PropertyShape ; - sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; - sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, - sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, - sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, - sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, - sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ; - - sh:targetObjectsOf sh:node ; # node-node - sh:targetObjectsOf sh:not ; # not-node - sh:targetObjectsOf sh:property ; # property-node - sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node - - # Shapes are either node shapes or property shapes - sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; - - sh:property [ - sh:path sh:targetNode ; - sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind - ] ; - sh:property [ - sh:path sh:targetClass ; - sh:nodeKind sh:IRI ; # targetClass-nodeKind - ] ; - sh:property [ - sh:path sh:targetSubjectsOf ; - sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind - ] ; - sh:property [ - sh:path sh:targetObjectsOf ; - sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind - ] ; - sh:or ( [ sh:not [ - sh:class rdfs:Class ; - sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) - ] ] - [ sh:nodeKind sh:IRI ] - ) ; # implicit-targetClass-nodeKind - - sh:property [ - sh:path sh:severity ; - sh:maxCount 1 ; # severity-maxCount - sh:nodeKind sh:IRI ; # severity-nodeKind - ] ; - sh:property [ - sh:path sh:message ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype - ] ; - sh:property [ - sh:path sh:deactivated ; - sh:maxCount 1 ; # deactivated-maxCount - sh:in ( true false ) ; # deactivated-datatype - ] ; - - sh:property [ - sh:path sh:and ; - sh:node shsh:ListShape ; # and-node - ] ; - sh:property [ - sh:path sh:class ; - sh:nodeKind sh:IRI ; # class-nodeKind - ] ; - sh:property [ - sh:path sh:closed ; - sh:datatype xsd:boolean ; # closed-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:ignoredProperties ; - sh:node shsh:ListShape ; # ignoredProperties-node - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind - ] ; - sh:property [ - sh:path sh:datatype ; - sh:nodeKind sh:IRI ; # datatype-nodeKind - sh:maxCount 1 ; # datatype-maxCount - ] ; - sh:property [ - sh:path sh:disjoint ; - sh:nodeKind sh:IRI ; # disjoint-nodeKind - ] ; - sh:property [ - sh:path sh:equals ; - sh:nodeKind sh:IRI ; # equals-nodeKind - ] ; - sh:property [ - sh:path sh:in ; - sh:maxCount 1 ; # in-maxCount - sh:node shsh:ListShape ; # in-node - ] ; - sh:property [ - sh:path sh:languageIn ; - sh:maxCount 1 ; # languageIn-maxCount - sh:node shsh:ListShape ; # languageIn-node - ] ; - sh:property [ - sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:datatype xsd:string ; # languageIn-members-datatype - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:nodeKind sh:IRI ; # lessThan-nodeKind - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:datatype xsd:integer ; # maxCount-datatype - sh:maxCount 1 ; # maxCount-maxCount - ] ; - sh:property [ - sh:path sh:maxExclusive ; - sh:maxCount 1 ; # maxExclusive-maxCount - sh:nodeKind sh:Literal ; # maxExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxInclusive ; - sh:maxCount 1 ; # maxInclusive-maxCount - sh:nodeKind sh:Literal ; # maxInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxLength ; - sh:datatype xsd:integer ; # maxLength-datatype - sh:maxCount 1 ; # maxLength-maxCount - ] ; - sh:property [ - sh:path sh:minCount ; - sh:datatype xsd:integer ; # minCount-datatype - sh:maxCount 1 ; # minCount-maxCount - ] ; - sh:property [ - sh:path sh:minExclusive ; - sh:maxCount 1 ; # minExclusive-maxCount - sh:nodeKind sh:Literal ; # minExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minInclusive ; - sh:maxCount 1 ; # minInclusive-maxCount - sh:nodeKind sh:Literal ; # minInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minLength ; - sh:datatype xsd:integer ; # minLength-datatype - sh:maxCount 1 ; # minLength-maxCount - ] ; - sh:property [ - sh:path sh:nodeKind ; - sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in - sh:maxCount 1 ; # nodeKind-maxCount - ] ; - sh:property [ - sh:path sh:or ; - sh:node shsh:ListShape ; # or-node - ] ; - sh:property [ - sh:path sh:pattern ; - sh:datatype xsd:string ; # pattern-datatype - sh:maxCount 1 ; # multiple-parameters - # Not implemented: syntax rule pattern-regex - ] ; - sh:property [ - sh:path sh:flags ; - sh:datatype xsd:string ; # flags-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMaxCount ; - sh:datatype xsd:integer ; # qualifiedMaxCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMinCount ; - sh:datatype xsd:integer ; # qualifiedMinCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShapesDisjoint ; - sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:datatype xsd:boolean ; # uniqueLang-datatype - sh:maxCount 1 ; # uniqueLang-maxCount - ] ; - sh:property [ - sh:path sh:xone ; - sh:node shsh:ListShape ; # xone-node - ] . - -shsh:NodeShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:node ; # node-node - sh:property [ - sh:path sh:path ; - sh:maxCount 0 ; # NodeShape-path-maxCount - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:maxCount 0 ; # lessThan-scope - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:maxCount 0 ; # lessThanOrEquals-scope - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:maxCount 0 ; # maxCount-scope - ] ; - sh:property [ - sh:path sh:minCount ; - sh:maxCount 0 ; # minCount-scope - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 0 ; # qualifiedValueShape-scope - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:maxCount 0 ; # uniqueLang-scope - ] . - -shsh:PropertyShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:property ; # property-node - sh:property [ - sh:path sh:path ; - sh:maxCount 1 ; # path-maxCount - sh:minCount 1 ; # PropertyShape-path-minCount - sh:node shsh:PathShape ; # path-node - ] . - -# Values of sh:and, sh:or and sh:xone must be lists of shapes -shsh:ShapesListShape - a sh:NodeShape ; - sh:targetObjectsOf sh:and ; # and-members-node - sh:targetObjectsOf sh:or ; # or-members-node - sh:targetObjectsOf sh:xone ; # xone-members-node - sh:property [ - sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:node shsh:ShapeShape ; - ] . - - -# A path of blank node path syntax, used to simulate recursion -_:PathPath - sh:alternativePath ( - ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - sh:inversePath - sh:zeroOrMorePath - sh:oneOrMorePath - sh:zeroOrOnePath - ) . - -shsh:PathShape - a sh:NodeShape ; - rdfs:label "Path shape"@en ; - rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath _:PathPath ] ; - sh:node shsh:PathNodeShape ; - ] . - -shsh:PathNodeShape - sh:xone ( # path-metarule - [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path - [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path - sh:node shsh:PathListWithAtLeast2Members ; - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path - sh:closed true ; - sh:property [ - sh:path sh:alternativePath ; - sh:node shsh:PathListWithAtLeast2Members ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path - sh:closed true ; - sh:property [ - sh:path sh:inversePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path - sh:closed true ; - sh:property [ - sh:path sh:oneOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrOnePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - ) . - -shsh:PathListWithAtLeast2Members - a sh:NodeShape ; - sh:node shsh:ListShape ; - sh:property [ - sh:path [ sh:oneOrMorePath rdf:rest ] ; - sh:minCount 2 ; # 1 other list node plus rdf:nil - ] . - -shsh:ShapesGraphShape - a sh:NodeShape ; - sh:targetObjectsOf sh:shapesGraph ; - sh:nodeKind sh:IRI . # shapesGraph-nodeKind - -shsh:EntailmentShape - a sh:NodeShape ; - sh:targetObjectsOf sh:entailment ; - sh:nodeKind sh:IRI . # entailment-nodeKind - diff --git a/src/main/resources/shapes/rml-star/shared_properties.ttl b/src/main/resources/shapes/rml-star/shared_properties.ttl deleted file mode 100644 index 82446fd..0000000 --- a/src/main/resources/shapes/rml-star/shared_properties.ttl +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################### -# RML shared properties among resources shapes # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023) # -############################################################################### -@prefix sh: . -@prefix : . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - - -:RMLAssertedAndNonTriplesMapPropertiesShape - a sh:NodeShape; - sh:targetObjectsOf rml:quotedTriplesMap ; - sh:targetClass rml:AssertedTriplesMap ; - sh:targetClass rml:NonAssertedTriplesMap ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:and ( - [ - sh:path rml:predicateObjectMap ; - sh:message """ - Exactly one Predicate Object Map must be specified in the - Triples Map referenced by rml:quotedTriplesMap. - """ ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - [ - sh:message """ - rml:quotedTriplesMap expects either a rml:AssertedTriplesMap - or rml:NonAssertedTriplesMap. - """ ; - sh:or ([sh:node :RMLAssertedTriplesMapShape] - [sh:node :RMLNonAssertedTriplesMapShape]) ; - ] - [ - sh:message """ - Either a rml:AssertedTriplesMap or rml:NonAssertedTriplesMap, - but not both. - """ ; - sh:path rdf:type ; - sh:alternativePath (rml:AssertedTriplesMap - rml:NonAssertedTriplesMap ); - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ); -. diff --git a/src/main/resources/shapes/rml-star/star.ttl b/src/main/resources/shapes/rml-star/star.ttl deleted file mode 100644 index 02c0f0e..0000000 --- a/src/main/resources/shapes/rml-star/star.ttl +++ /dev/null @@ -1,123 +0,0 @@ -@prefix brick: . -@prefix csvw: . -@prefix dc: . -@prefix dcam: . -@prefix dcat: . -@prefix dcmitype: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix geo: . -@prefix odrl: . -@prefix org: . -@prefix owl: . -@prefix prof: . -@prefix prov: . -@prefix qb: . -@prefix rdf: . -@prefix rdfs: . -@prefix rml: . -@prefix schema: . -@prefix sh: . -@prefix skos: . -@prefix sosa: . -@prefix ssn: . -@prefix time: . -@prefix vann: . -@prefix void: . -@prefix wgs: . -@prefix xml: . -@prefix xsd: . - - a sh:NodeShape ; - sh:and ( [ sh:maxCount 1 ; - sh:message """ - Exactly one Predicate Object Map must be specified in the - Triples Map referenced by rml:quotedTriplesMap. - """ ; - sh:minCount 1 ; - sh:path rml:predicateObjectMap ] [ sh:message """ - rml:quotedTriplesMap expects either a rml:AssertedTriplesMap - or rml:NonAssertedTriplesMap. - """ ; - sh:or ( [ sh:node ] [ sh:node ] ) ] [ sh:alternativePath ( rml:AssertedTriplesMap rml:NonAssertedTriplesMap ) ; - sh:maxCount 1 ; - sh:message """ - Either a rml:AssertedTriplesMap or rml:NonAssertedTriplesMap, - but not both. - """ ; - sh:minCount 1 ; - sh:path rdf:type ] ) ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:targetClass rml:AssertedTriplesMap, - rml:NonAssertedTriplesMap ; - sh:targetObjectsOf rml:quotedTriplesMap . - - a sh:NodeShape ; - sh:and ( [ rdfs:comment """ - An Quoted Triples Map element to generate a RDF-star triple as - subject or object or another triple from a logical source record. - """ ; - sh:maxCount 1 ; - sh:message """ - Exactly one rml:quotedTriplesMap is required. - """ ; - sh:minCount 1 ; - sh:name "quotedTriplesMap" ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:path rml:quotedTriplesMap ] [ sh:message """ - An Quoted Triples Map may never be used for generating a predicate. - """ ; - sh:name "PredicateMap" ; - sh:targetObjectsOf rml:predicateObjectMap ; - sh:xone ( [ sh:minCount 1 ; - sh:path rml:predicate ] [ sh:minCount 1 ; - sh:path rml:predicateMap ] ) ] ) ; - rdfs:comment """ - Represents a Star Map. - """ ; - sh:message """ - Star Map requires exactly one rml:quotedTriplesMap and - zero or more rml:joinCondition. - """, - "StarMap" ; - sh:targetClass rml:StarMap . - - a sh:NodeShape ; - sh:and ( [ sh:message """ - Asserted Triples Map must have a rml:AssertedTriplesMap type. - """ ; - sh:path rdf:type ; - sh:value rml:AssertedTriplesMap ] ) ; - rdfs:comment """ - Represents a Asserted Triples Map. - """ ; - sh:message """ - Asserted Triples Map requires exactly one rml:subject or - one rml:subjectMap and zero or more rml:predicateObjectMaps - and exactly one rml:logicalSource. - """, - "AssertedTriplesMap" ; - sh:targetClass rml:AssertedTriplesMap . - - a sh:NodeShape . - - a sh:NodeShape ; - sh:and ( [ sh:message """ - Non Asserted Triples Map must have a rml:NonAssertedTriplesMap type. - """ ; - sh:path rdf:type ; - sh:value rml:NonAssertedTriplesMap ] ) ; - rdfs:comment """ - Represents a Non Asserted Triples Map. - """ ; - sh:message """ - Non Asserted Triples Map requires exactly one rml:subject or - one rml:subjectMap and zero or more rml:predicateObjectMaps - and exactly one rml:logicalSource. - """, - "NonAssertedTriplesMap" ; - sh:targetClass rml:NonAssertedTriplesMap . - - a sh:NodeShape . - diff --git a/src/main/resources/shapes/rml-star/star_map.ttl b/src/main/resources/shapes/rml-star/star_map.ttl deleted file mode 100644 index 73486a4..0000000 --- a/src/main/resources/shapes/rml-star/star_map.ttl +++ /dev/null @@ -1,61 +0,0 @@ -############################################################################### -# RML Star Map shape # -# Copyright Dylan Van Assche, IDLab - UGent - imec (2023 - 2025) # -############################################################################### -@prefix : . -@prefix rdfs: . -@prefix sh: . -@prefix rdf: . -@prefix rml: . -@prefix xsd: . - -# Validate an RMLS Star Map -:RMLStarMapShape - a sh:NodeShape ; - sh:targetClass rml:StarMap ; - sh:message "StarMap" ; - rdfs:comment """ - Represents a Star Map. - """ ; - sh:message """ - Star Map requires exactly one rml:quotedTriplesMap and - zero or more rml:joinCondition. - """ ; - - sh:and ( - # Inherited shapes - :RMLJoinConditionPropertiesShape - # Star Map specific shapes - [ - sh:path rml:quotedTriplesMap ; - sh:name "quotedTriplesMap" ; - sh:description """ - An Quoted Triples Map element to generate a RDF-star triple as - subject or object or another triple from a logical source record. - """ ; - sh:message """ - Exactly one rml:quotedTriplesMap is required. - """ ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - [ - sh:targetObjectsOf rml:predicateObjectMap ; - sh:name "PredicateMap" ; - sh:message """ - An Quoted Triples Map may never be used for generating a predicate. - """ ; - sh:xone ( - [ - sh:path rml:predicate ; - sh:minCount 1 ; - ] - [ - sh:path rml:predicateMap ; - sh:minCount 1 ; - ] - ); - ] - ) ; -. diff --git a/src/main/resources/shapes/rml-star/tests.py b/src/main/resources/shapes/rml-star/tests.py deleted file mode 100755 index 317a08d..0000000 --- a/src/main/resources/shapes/rml-star/tests.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -# (c) Dylan Van Assche (2020 - 2023) -# IDLab - Ghent University - imec -# MIT license -# - -import os -import argparse -import unittest -import logging -from parameterized import parameterized -from glob import glob -from rdflib import Graph - -from mapping_validator import MappingValidator - -TEST_CASES_DIR = os.path.join(os.path.abspath('../test-cases'), - '*/*/mapping.ttl') -STAR_SHAPE_FILE = os.path.abspath('star.ttl') -SHACL_SHAPE_FILE = os.path.abspath('shacl.ttl') - - -class MappingValidatorTests(unittest.TestCase): - def _validate_rules(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(STAR_SHAPE_FILE) - mapping_validator.validate(rules) - - def _validate_shapes(self, path: str) -> None: - rules = Graph().parse(path, format='turtle') - mapping_validator = MappingValidator(SHACL_SHAPE_FILE) - mapping_validator.validate(rules) - - def test_non_existing_mapping_rules(self) -> None: - with self.assertRaises(FileNotFoundError): - p = os.path.abspath('does_not_exist.ttl') - self._validate_rules(p) - - @parameterized.expand([(p,) for p in sorted(glob(TEST_CASES_DIR))], - skip_on_empty=True) - def test_validation_rules(self, path: str) -> None: - """ - Test if our SHACL shapes are able to validate our validation mapping - rules test cases. - """ - print(f'Testing validation with: {path}') - if 'invalid' in path: - with self.assertRaises(Exception): - self._validate_rules(path) - else: - self._validate_rules(path) - - def test_validation_shapes(self) -> None: - """ - Test if our SHACL shapes are valid according to the W3C Recommdendation - of SHACL. Validation with the official SHACL shapes for SHACL. - - See https://www.w3.org/TR/shacl/#shacl-shacl - """ - self._validate_shapes('./star.ttl') - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Execute tests for SHACL ' - 'shapes on RML mapping rules.') - parser.add_argument('--verbose', '-v', action='count', default=1, - help='Set verbosity level of messages. Example: -vvv') - args = parser.parse_args() - - args.verbose = 70 - (10 * args.verbose) if args.verbose > 0 else 0 - logging.basicConfig(level=args.verbose, - format='%(asctime)s %(levelname)s: %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - - print(TEST_CASES_DIR) - unittest.main(failfast=False) diff --git a/src/test/java/burp/TestRMLCC.java b/src/test/java/burp/TestRMLCC.java index e335b37..5e1915c 100644 --- a/src/test/java/burp/TestRMLCC.java +++ b/src/test/java/burp/TestRMLCC.java @@ -3,6 +3,6 @@ public class TestRMLCC extends TestRMLModule { @Override public String getBase() { - return "./src/test/resources/rml-cc/"; + return "./target/test-classes/rml-cc/"; } } diff --git a/src/test/java/burp/TestRMLCore.java b/src/test/java/burp/TestRMLCore.java index dca6fa1..0cc973d 100644 --- a/src/test/java/burp/TestRMLCore.java +++ b/src/test/java/burp/TestRMLCore.java @@ -3,6 +3,6 @@ public class TestRMLCore extends TestRMLModule { @Override public String getBase() { - return "./src/test/resources/rml-core/"; + return "./target/test-classes/rml-core/"; } } diff --git a/src/test/java/burp/TestRMLFNML.java b/src/test/java/burp/TestRMLFNML.java index 14f303b..3b48ad4 100644 --- a/src/test/java/burp/TestRMLFNML.java +++ b/src/test/java/burp/TestRMLFNML.java @@ -3,6 +3,6 @@ public class TestRMLFNML extends TestRMLModule { @Override public String getBase() { - return "./src/test/resources/rml-fnml/"; + return "./target/test-classes/rml-fnml/"; } } diff --git a/src/test/java/burp/TestRMLIO.java b/src/test/java/burp/TestRMLIO.java index 8ab74a4..c849109 100644 --- a/src/test/java/burp/TestRMLIO.java +++ b/src/test/java/burp/TestRMLIO.java @@ -6,7 +6,7 @@ public class TestRMLIO extends TestRMLModule { @Override public String getBase() { - return "./src/test/resources/rml-io/"; + return "./target/test-classes/rml-io/"; } private boolean isIgnored(String id) { diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java index fad5a46..d2062cb 100644 --- a/src/test/java/burp/TestRMLIORegistry.java +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -23,7 +23,7 @@ public class TestRMLIORegistry extends TestRMLModule { - public static String base = "./src/test/resources/rml-io-registry/"; + public static String base = "./target/test-classes/rml-io-registry/"; @Override public String getBase() { diff --git a/src/test/java/burp/TestRMLLV.java b/src/test/java/burp/TestRMLLV.java index 6cd9cfe..4af25cb 100644 --- a/src/test/java/burp/TestRMLLV.java +++ b/src/test/java/burp/TestRMLLV.java @@ -3,6 +3,6 @@ public class TestRMLLV extends TestRMLModule { @Override public String getBase() { - return "./src/test/resources/rml-lv/"; + return "./target/test-classes/rml-lv/"; } } diff --git a/src/test/java/burp/TestRMLModule.java b/src/test/java/burp/TestRMLModule.java index f07caca..0b728f5 100644 --- a/src/test/java/burp/TestRMLModule.java +++ b/src/test/java/burp/TestRMLModule.java @@ -52,11 +52,19 @@ public Stream loadTestData() throws IOException, CsvException { } protected Stream testDataProviderOK() throws IOException, CsvException { - return loadTestData().filter(t -> !t.error); + List list = loadTestData().filter(t -> !t.error).toList(); + if (list.isEmpty()) { + return Stream.of(new TestData(java.util.Map.of("ID", "dummy", "error", "false"))); + } + return list.stream(); } protected Stream testDataProviderNotOK() throws IOException, CsvException { - return loadTestData().filter(t -> t.error); + List list = loadTestData().filter(t -> t.error).toList(); + if (list.isEmpty()) { + return Stream.of(new TestData(java.util.Map.of("ID", "dummy", "error", "true"))); + } + return list.stream(); } public Path getPath(TestData testData, String path) { @@ -95,6 +103,7 @@ public void prepareSource(TestData testData) throws Exception { @ParameterizedTest @MethodSource("testDataProviderOK") public void testForOK(TestData testData) throws Exception { + if ("dummy".equals(testData.ID)) return; printTestHeader(testData); prepareSource(testData); @@ -237,6 +246,7 @@ public void testForOK(TestData testData) throws Exception { @ParameterizedTest @MethodSource("testDataProviderNotOK") public void testForNotOK(TestData testData) throws Exception { + if ("dummy".equals(testData.ID)) return; printTestHeader(testData); prepareSource(testData); testForNotOK(testData, getPath(testData, testData.mapping).toAbsolutePath().toString()); From d94a03637225dbb8ce352b1d98851c7d5279359b Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 11 Jun 2026 16:45:00 +0200 Subject: [PATCH 10/45] feat(reporting): Plain text reporting with colour depending on severity --- .../java/burp/reporting/FileHighlight.java | 38 +++++++++++++++++-- .../reporting/PlainTextReportGenerator.java | 38 +++++++++++++++---- src/main/java/burp/reporting/Severity.java | 7 ++++ 3 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 src/main/java/burp/reporting/Severity.java diff --git a/src/main/java/burp/reporting/FileHighlight.java b/src/main/java/burp/reporting/FileHighlight.java index feb71b5..7232951 100644 --- a/src/main/java/burp/reporting/FileHighlight.java +++ b/src/main/java/burp/reporting/FileHighlight.java @@ -8,10 +8,18 @@ public class FileHighlight { public static String extractAndHighlight(Path filePath, List nodes) { - return extractAndHighlight(filePath, nodes, 1); + return extractAndHighlight(filePath, nodes, 1, Severity.ERROR); + } + + public static String extractAndHighlight(Path filePath, List nodes, Severity severity) { + return extractAndHighlight(filePath, nodes, 1, severity); } public static String extractAndHighlight(Path filePath, List nodes, int contextLines) { + return extractAndHighlight(filePath, nodes, contextLines, Severity.ERROR); + } + + public static String extractAndHighlight(Path filePath, List nodes, int contextLines, Severity severity) { if (!Files.exists(filePath)) { return null; } @@ -49,7 +57,7 @@ public static String extractAndHighlight(Path filePath, List nodes, String lineNumberStr = formatLineNumber(lineIndex + 1); sb.append(lineNumberStr); - sb.append(renderLineWithColors(lineContent, rangesOnLine)).append(System.lineSeparator()); + sb.append(renderLineWithColors(lineContent, rangesOnLine, severity)).append(System.lineSeparator()); } return sb.toString(); @@ -79,7 +87,7 @@ private static String formatLineNumber(int lineNumber) { /** * Splits the line string based on ranges and inserts ANSI codes. */ - private static String renderLineWithColors(String line, List ranges) { + private static String renderLineWithColors(String line, List ranges, Severity severity) { if (ranges.isEmpty()) { return line; } @@ -99,7 +107,13 @@ private static String renderLineWithColors(String line, List errors = new ArrayList<>(); + List warnings = new ArrayList<>(); + List info = new ArrayList<>(); + + for (RmlError issue : report.getErrors()) { + OntClass logType = issue.getErrorType(); + if (isOrParent(logType, RER.Information)) info.add(issue); + else if (isOrParent(logType, RER.Warning)) warnings.add(issue); + else errors.add(issue); + } + + printIssues(sb, errors, "Errors", Severity.ERROR); + printIssues(sb, warnings, "Warnings", Severity.WARNING); + printIssues(sb, info, "Information", Severity.INFORMATION); sb.append("Statistics:\n"); int triplesMapsSize = 0; @@ -42,7 +55,11 @@ public static String generateTextReport(RmlExecutionReport report) { return sb.toString(); } - private static void printTracingInfo(StringBuilder sb, RmlError issue) { + private static boolean isOrParent(OntClass ontClass, OntClass parent) { + return ontClass.equals(parent) || ontClass.hasSuperClass(ontClass); + } + + private static void printTracingInfo(StringBuilder sb, RmlError issue, Severity severity) { if (issue.getOrigin() != null) { Origin origin = issue.getOrigin(); sb.append(prependIndent("In mapping", 4)).append(System.lineSeparator()); @@ -77,10 +94,10 @@ private static void printTracingInfo(StringBuilder sb, RmlError issue) { } // Print File Underlined extract - String highlight = FileHighlight.extractAndHighlight(file, locations); + String highlight = FileHighlight.extractAndHighlight(file, locations, severity); if (highlight != null) { if (!lineLocations.isEmpty()) { - sb.append(lineLocations.get(0)).append(System.lineSeparator()); + sb.append(lineLocations.getFirst()).append(System.lineSeparator()); } sb.append(highlight); } else { @@ -91,13 +108,20 @@ private static void printTracingInfo(StringBuilder sb, RmlError issue) { } } - private static void printIssues(StringBuilder sb, List issues, String header) { + private static void printIssues(StringBuilder sb, List issues, String header, Severity severity) { if (issues != null && !issues.isEmpty()) { sb.append(header).append(":").append(System.lineSeparator()); for (int i = 0; i < issues.size(); i++) { RmlError issue = issues.get(i); - sb.append(prependIndent(FileHighlight.ansiRed(issue.getMessage()), 2)).append(System.lineSeparator()); - printTracingInfo(sb, issue); + String msg = issue.getMessage(); + String msgColored; + switch (severity) { + case WARNING -> msgColored = FileHighlight.ansiYellow(msg); + case INFORMATION -> msgColored = FileHighlight.ansiCyan(msg); + case null, default -> msgColored = FileHighlight.ansiRed(msg); + } + sb.append(prependIndent(msgColored, 2)).append(System.lineSeparator()); + printTracingInfo(sb, issue, severity); appendErrorTypeHelp(sb, issue.getErrorType()); if (issue.getException() != null) { diff --git a/src/main/java/burp/reporting/Severity.java b/src/main/java/burp/reporting/Severity.java new file mode 100644 index 0000000..e3e380d --- /dev/null +++ b/src/main/java/burp/reporting/Severity.java @@ -0,0 +1,7 @@ +package burp.reporting; + +public enum Severity { + ERROR, + WARNING, + INFORMATION +} From c663d7e6bc4925cf5dd0717087aaacd8fbcec32d Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 17 Jun 2026 11:32:01 +0200 Subject: [PATCH 11/45] add rer vocabulary --- src/main/resources/vocabularies/rer.ttl | 1032 +++++++++++++++++++++++ 1 file changed, 1032 insertions(+) create mode 100644 src/main/resources/vocabularies/rer.ttl diff --git a/src/main/resources/vocabularies/rer.ttl b/src/main/resources/vocabularies/rer.ttl new file mode 100644 index 0000000..4b7f4d5 --- /dev/null +++ b/src/main/resources/vocabularies/rer.ttl @@ -0,0 +1,1032 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix dc: . +@prefix xsd: . +@prefix rml: . +@prefix vann: . +@prefix schema: . +@prefix sw: . +@prefix widoco: . + +@prefix rer: . +@prefix ptr: . +@prefix draw: . + +rer: + a owl:Ontology ; + vann:preferredNamespacePrefix "rer" ; + vann:preferredNamespaceUri "https://w3id.org/dre/rer#" ; + dc:title "RML Execution Report (RER) Vocabulary"@en ; + dc:description "Vocabulary for describing reports, statistics, execution plans and error/warning information produced by RML processors."@en ; + schema:image ; + dc:abstract "The RML Execution Report (RER) is a machine-readable report that makes mapping execution issues and outcomes transparent for RML authors and tooling, with contextual information."@en ; + dc:date "2025-01-07"^^xsd:date ; + dc:creator "Jakub Duchateau" ; + schema:codeRepository "https://github.com/jduchateau/RER" ; + owl:versionInfo "0.0.1" ; + dc:license ; + schema:funding "This work was supported by the Fonds de la Recherche Scientifique -- FNRS under Grant n° MIS~F.4016.24." ; + owl:imports ptr: . + +rer:RmlExecutionReport + a owl:Class ; + rdfs:label "RML Execution Report" ; + rdfs:comment "A report generated by an RML Processor." ; + widoco:order 1 ; + draw:uml true; + vann:example """ +[] a rer:RmlExecutionReport + rer:isSuccess false; + rer:isComplete false; + + rer:processorName "BURP"; + rer:processorVersion "0.1.2"; + + rer:generatedStatements 0; + rer:generatedStatementsPerTriplesMap [ + rer:triplesMap + rer:generatedStatements 0 + ]; + rer:generatedStatementsPerTriplesMap [ + rer:triplesMap + rer:generatedStatements 0 + ]; + + rer:hasErrors [ + rer:timestamp "2025-11-26+13:20:00"^xsd:dateTime + a rer:ReferenceFormulationExecutionError + rer:message "Execution Error in JSONPath `$.film.title.value`." + rer:reference "$.film.title.value" + rer:referenceFormulation rml:JSONPath + rer:iteration "{film:{title:'A film title'}}" + rer:stackTrace "A java stack trace" + rer:mappingStatement [ + rer:statement <<:a0 rml:template "$.film.title.value`.">>; + rer:part rer:object + ]; + ]. + """; + rdfs:isDefinedBy rer: . + +rer:processorName + a owl:DatatypeProperty ; + rdfs:label "processor name" ; + rdfs:comment "The name of the RML processor that generated this report." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range xsd:string ; + rdfs:isDefinedBy rer: . + +rer:processorVersion + a owl:DatatypeProperty ; + rdfs:label "processor version" ; + rdfs:comment "The version of the RML processor that generated this report." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range xsd:string ; + rdfs:isDefinedBy rer: . + +rer:isSuccess + a owl:DatatypeProperty ; + rdfs:label "is success" ; + rdfs:comment "Indicates if the execution completed successfully without critical failure. Typically corresponds to exit code 0." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range xsd:boolean ; + rdfs:isDefinedBy rer: . + +rer:isComplete + a owl:DatatypeProperty ; + rdfs:label "is complete" ; + rdfs:comment "Are the output datasets complete." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range xsd:boolean ; + rdfs:isDefinedBy rer: . + +rer:numberOfTriplesMap + a owl:DatatypeProperty ; + rdfs:label "number of triples map" ; + rdfs:comment "Indicate how many Triples Map were found in the RML mapping document." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range xsd:integer ; + rdfs:isDefinedBy rer: . + +rer:hasLog + a owl:ObjectProperty ; + rdfs:label "has log" ; + rdfs:comment "Indicates a log message." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range rer:Log ; + rdfs:isDefinedBy rer: . + +rer:hasError + a owl:ObjectProperty ; + rdfs:subPropertyOf rer:hasLog ; + rdfs:label "has error" ; + rdfs:comment "Indicates an error that occurred." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range rer:Error ; + rdfs:isDefinedBy rer: . + +rer:generatedStatements + a owl:DatatypeProperty ; + rdfs:label "generated statements" ; + rdfs:comment "Number of statements produced by the execution of the mapping at a specific scope (total, per Triples Map, per target)." ; + rdfs:domain [ + rdf:type owl:Class ; + owl:unionOf ( + rer:RmlExecutionReport + rer:GeneratedStatementPerTriplesMap + rer:GeneratedStatementsPerTarget + ) + ] ; + rdfs:range xsd:integer ; + rdfs:isDefinedBy rer: . + +rer:generatedStatementsPerTarget + a owl:ObjectProperty ; + rdfs:label "generated statements per target" ; + rdfs:comment "Number of generated statements grouped by target (rml:LogicalTarget)." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range rer:GeneratedStatementsPerTarget ; + rdfs:isDefinedBy rer: . + +rer:GeneratedStatementsPerTarget + a owl:Class ; + rdfs:label "Generated Statements Per Target" ; + rdfs:comment "Statistics about the number of generated statements for a specific Logical Target." ; + rdfs:isDefinedBy rer: . + +rer:target + a owl:ObjectProperty ; + rdfs:label "target" ; + rdfs:comment "The Logical Target for which the statistics are reported." ; + rdfs:domain rer:GeneratedStatementsPerTarget ; + rdfs:range rml:LogicalTarget ; + rdfs:isDefinedBy rer: . + +rer:generatedStatementsPerTriplesMap + a owl:ObjectProperty ; + rdfs:label "generated statements per Triples Map" ; + rdfs:comment "Number of generated statements grouped by triples map (rml:TriplesMap), all triples map understood by the processor needs to be present. The sum of those is not necessarily equal to rer:generatedStatements as some RML modules may imply or define behaviours after a triples has been generated." ; + rdfs:domain rer:RmlExecutionReport ; + rdfs:range rer:GeneratedStatementPerTriplesMap ; + rdfs:isDefinedBy rer: . + + +rer:GeneratedStatementPerTriplesMap + a owl:Class ; + rdfs:label "Generated Statement Per Triples Map" ; + rdfs:comment "Statistics about the number of generated statements for a specific Triples Map." ; + rdfs:isDefinedBy rer: . + +rer:triplesMap + a owl:ObjectProperty ; + rdfs:label "triples map" ; + rdfs:comment "The Triples Map for which the statistics are reported." ; + rdfs:domain rer:GeneratedStatementPerTriplesMap ; + rdfs:range rml:TriplesMap ; + rdfs:isDefinedBy rer: . + + +rer:message + a owl:DatatypeProperty ; + rdfs:label "message" ; + rdfs:comment "Human-readable message associated with an error or a warning." ; + rdfs:domain rer:Log ; + rdfs:range rdfs:Literal ; + rdfs:isDefinedBy rer: . + +rer:potentialCause + a owl:AnnotationProperty ; + rdfs:label "Potential Cause" ; + rdfs:comment "Hypothesis on what may have caused the log entry." ; + rdfs:domain rer:Log ; + rdfs:range rdfs:Literal ; + widoco:displayClassAnnotation 1 ; + rdfs:isDefinedBy rer: . + +rer:potentialSolution + a owl:AnnotationProperty ; + rdfs:label "Potential Solution" ; + rdfs:comment "Suggested actions to resolve or investigate the log entry." ; + rdfs:domain rer:Log ; + rdfs:range rdfs:Literal ; + widoco:displayClassAnnotation 2 ; + rdfs:isDefinedBy rer: . + +rer:potentialConfusion + a owl:AnnotationProperty ; + rdfs:label "Potential Confusion" ; + rdfs:comment "Potential confusion with other errors classes." ; + rdfs:domain rer:Log ; + rdfs:range xsd:string ; + widoco:displayClassAnnotation 3 ; + rdfs:isDefinedBy rer: . + +rer:potentialConfusionError + a owl:AnnotationProperty ; + rdfs:label "Potential Confusion Error" ; + rdfs:comment "Potential confusion with other errors classes." ; + rdfs:domain rer:Log ; + rdfs:range rer:Log ; + widoco:displayClassAnnotation 4 ; + rdfs:isDefinedBy rer: . + +rer:suggestedContext + a owl:AnnotationProperty ; + rdfs:label "Suggested Context" ; + rdfs:comment "Context resources recommended to be attache to the error entry log.Used for example to generate an error message." ; + rdfs:domain rer:Log ; + rdfs:range rdfs:Resource ; + widoco:displayClassAnnotation 5; + rdfs:isDefinedBy rer: . + +# TODO: check +rer:hasSourceData + a owl:ObjectProperty ; + rdfs:label "has source data" ; + rdfs:comment "Literal fragment of source data causing the issue." ; + rdfs:domain rer:Error ; + rdfs:range rdfs:Literal ; + rdfs:isDefinedBy rer: . + +rer:Log + a owl:Class ; + rdfs:label "Log" ; + rdfs:comment "A log message produced during RML processor execution, look at subClasses for the gravity definition. (Information < Warning < Error)" ; + widoco:order 100 ; + rdfs:isDefinedBy rer: . + +rer:timestamp + a owl:DatatypeProperty ; + rdfs:label "Timestamp of the log message." ; + rdfs:comment "Time at which the log entry was produced." ; + rdfs:domain rer:Log ; + rdfs:range xsd:dateTimeStamp ; + rdfs:isDefinedBy rer: . + + +rer:order + a owl:DatatypeProperty ; + rdfs:label "order" ; + rdfs:comment "An optional implementation defined order for log messages." ; + rdfs:domain rer:Log ; + rdfs:isDefinedBy rer: . + +rer:planNode + a owl:ObjectProperty ; + rdfs:label "plan node" ; + rdfs:comment "RML Processor plan node at the source of the issue. Processor specific." ; + rdfs:domain rer:Error ; + sw:term_status "experimental" ; + rdfs:isDefinedBy rer: . + +rer:mappingNode + a owl:ObjectProperty ; + rdfs:label "mapping node" ; + rdfs:comment "RDF node in the mapping that is at the source of the issue. Prefer using the more precise rer:mappingStatement when possible." ; + rdfs:domain rer:Error ; + rdfs:range rdfs:Resource ; + owl:deprecated true ; + rdfs:isDefinedBy rer: . + +rer:mappingStatement + a owl:ObjectProperty ; + rdfs:label "mapping statement" ; + rdfs:domain rer:Log ; + rdfs:range ptr:StatementPart ; + rdfs:comment """RDF statement(s) in the mapping that are at the source of the issue. + As soon as a mapping document is available as RDF Graph, statements parts should be used to pinpoint problematic constructs.""" ; + rdfs:isDefinedBy rer: . + + + +rer:iterationIndex + a owl:DatatypeProperty ; + rdfs:label "iteration index" ; + rdfs:comment "The index of the iteration that generated the log message." ; + rdfs:domain rer:Log ; + rdfs:range xsd:integer ; + rdfs:isDefinedBy rer: . + +rer:iterationData + a owl:DatatypeProperty ; + rdfs:label "iteration data" ; + rdfs:comment "Serialized data item for the iteration that generated the log message." ; + rdfs:domain rer:Log ; + rdfs:range rdfs:Literal ; + rdfs:isDefinedBy rer: . + +rer:stackTrace + a owl:DatatypeProperty ; + rdfs:label "stack trace" ; + rdfs:comment "The stack trace of the error that generated the log message." ; + rdfs:domain rer:Log ; + rdfs:range xsd:string ; + rdfs:isDefinedBy rer: . + +rer:ReferenceFormulationError + a owl:Class ; + rdfs:label "Reference Formulation Error" ; + rdfs:subClassOf rer:Error ; + rdfs:comment "Errors related to the reference formulation used in the mapping." ; + rdfs:isDefinedBy rer: . + +rer:reference + a owl:DatatypeProperty ; + rdfs:label "reference" ; + rdfs:comment "The reference formulation expression that generated the log message." ; + rdfs:range xsd:string ; + rdfs:domain rer:ReferenceFormulationError ; + rdfs:isDefinedBy rer: . + +rer:referenceFormulation + a owl:DatatypeProperty ; + rdfs:label "reference formulation" ; + rdfs:comment "The reference formulation used in the mapping that generated the log message." ; + rdfs:range rml:ReferenceFormulation ; + rdfs:domain rer:ReferenceFormulationError ; + rdfs:isDefinedBy rer: . + +rer:allowedTermTypes + a owl:DatatypeProperty ; + rdfs:label "allowed term types" ; + rdfs:comment "The allowed term types of the term map." ; + rdfs:domain rer:IncorrectTermType ; + rdfs:range rml:TermType ; + rdfs:isDefinedBy rer: . + +rer:languageTag + a owl:DatatypeProperty ; + rdfs:subPropertyOf rer:data ; + rdfs:label "language tag" ; + rdfs:comment "Language tag attached to the offending literal." ; + rdfs:domain rer:InvalidLanguageTagError ; + rdfs:range xsd:language ; + rdfs:isDefinedBy rer: . + +rer:Information + a owl:Class ; + rdfs:subClassOf rer:Log ; + rdfs:label "Information" ; + rdfs:comment "A information from the RML processor." ; + widoco:order 101 ; + rdfs:isDefinedBy rer: . + +rer:Warning + a owl:Class ; + rdfs:subClassOf rer:Log ; + rdfs:label "Warning" ; + rdfs:comment "A warning that occurred during the RML processor execution." ; + widoco:order 200 ; + rdfs:isDefinedBy rer: . + + +rer:UnrecognizedTerm + a owl:Class ; + rdfs:label "Unrecognized Term" ; + rdfs:subClassOf rer:Warning ; + rdfs:comment "The engine encountered a property or class in the RML namespace it does not recognize." ; + rer:potentialCause "This could be a typo in the mapping or a feature from a newer RML version this engine does not know." ; + rer:potentialSolution "Check for typos in the term. If it is correct, this engine may be outdated." ; + widoco:order 201 ; + rdfs:isDefinedBy rer: . + + +rer:DeprecatedFeature + a owl:Class ; + rdfs:label "Deprecated Feature" ; + rdfs:subClassOf rer:Warning ; + rdfs:comment "The mapping uses a deprecated RML feature." ; + rer:potentialCause + "The mapping employs a term or construct that has been marked as deprecated in the RML specification or processor." ; + rer:potentialSolution + "Update the mapping to use the recommended alternative constructs as per the latest RML specification." ; + widoco:order 202 ; + rdfs:isDefinedBy rer: . + + + +rer:Error + a owl:Class ; + rdfs:subClassOf rer:Log ; + rdfs:label "Error" ; + rdfs:comment "An error that occurred during the RML processor execution." ; + rer:potentialCause "An unexpected situation occurred during mapping execution or validation." ; + rer:potentialSolution "Inspect the error details, mapping definition and source data to identify the root cause." ; + rer:potentialConfusion + "Do not confuse this generic error with more specific subclasses that provide finer diagnostics." ; + widoco:order 300 ; + rdfs:isDefinedBy rer: . + +rer:ExecutionError + a owl:Class ; + rdfs:label "Execution Error" ; + rdfs:subClassOf rer:Error ; + rdfs:comment "Errors related to the execution of a mapping (plan) with real data" ; + rer:potentialCause "Hypothesis on data may be incorrect" ; + rer:potentialSolution "If the data are correct then adapt setup to handle that case else change the data" ; + rer:potentialConfusion "Distinguish it from errors that could be captured with static analysis alone." ; + rer:potentialConfusionError rer:MappingError ; + widoco:order 303 ; + rdfs:isDefinedBy rer: +. + +rer:DataError + a owl:Class ; + rdfs:label "Data Error" ; + rdfs:subClassOf rer:ExecutionError ; + rdfs:comment "The obtained data is problematic." ; + rer:potentialCause "Input data does not match the assumptions of the mapping or reference formulation." ; + rer:potentialSolution "Validate and clean the input data, or adapt the mapping to handle the observed data patterns." ; + rer:potentialConfusion "May be mistaken for a mapping error, but the mapping is valid and the data itself is problematic." ; + rer:potentialConfusionError rer:MappingError ; + rdfs:isDefinedBy rer: . + +rer:data + a owl:DatatypeProperty ; + rdfs:label "Data" ; + rdfs:comment "Raw data value that violates expectations." ; + rdfs:domain rer:DataError ; + rdfs:range rdfs:Literal ; + rdfs:isDefinedBy rer: . + +rer:DatatypeExpectationError + a owl:Class ; + rdfs:subClassOf rer:DataError ; + rdfs:label "Datatype Expectation Error" ; + rdfs:comment "Errors where a value violates an expected datatype." ; + rdfs:isDefinedBy rer: . + +rer:dataType + a owl:DatatypeProperty ; + rdfs:label "Data Type" ; + rdfs:comment "Datatype of the offending data value." ; + rdfs:domain rer:DataError ; + rdfs:range rdfs:Datatype ; + rdfs:isDefinedBy rer: . + +rer:expectedDataType + a owl:DatatypeProperty ; + rdfs:label "Expected Data Type" ; + rdfs:comment "Expected datatype for the offending value." ; + rdfs:domain rer:DatatypeExpectationError ; + rdfs:range rdfs:Datatype ; + rdfs:isDefinedBy rer: . + + +rer:TypeConversionError + a owl:Class ; + rdfs:label "Type Conversion Error" ; + rdfs:subClassOf rer:DataError, rer:DatatypeExpectationError ; + rdfs:comment "The type of a data could not be converted to the target type." ; + rer:potentialCause "An ExpressionMap generates a value of a type that is not convertible to the expected/specified type." ; + rer:potentialSolution "Adjust the mapping to generate values in the expected datatype or update the target type to match the actual data." ; + rer:potentialConfusion "Do not confuse with Function Execution Error, where the function fails even if the types are correct." ; + rer:potentialConfusionError rer:FunctionExecutionError ; + rer:suggestedContext rer:expectedDataType, rer:dataType, rer:data ; + rdfs:isDefinedBy rer: . + +rer:IllTypedLiteralError + a owl:Class ; + rdfs:label "Ill-typed Literal Error" ; + rdfs:subClassOf rer:DataError, rer:DatatypeExpectationError ; + rdfs:comment "The value of a typed literal is not valid according to the datatype." ; + rer:potentialSolution + "Fix the value of the typed literal to be valid according to the datatype or update the datatype to match the actual value, you may also leave the datatype empty to let the engine infer it." ; + rdfs:isDefinedBy rer: . + +rer:NotWellFormedLanguageTagError + a owl:Class ; + rdfs:label "Not Well-formed Language Tag" ; + rdfs:subClassOf rer:InvalidLanguageTagError ; + rdfs:comment "The language tag attached to a literal does not conform to BCP47 syntax (malformed tag)." ; + rer:potentialCause "The language tag contains invalid subtags or illegal characters that violate BCP47." ; + rer:potentialSolution "Correct the language tag to a valid BCP47 value or remove the tag to let the engine infer it." ; + rer:potentialConfusion "May be confused with Invalid Language Tag Error; here the tag is syntactically invalid, whereas in Invalid Language Tag Error the tag is well-formed but not recognized." ; + rer:potentialConfusionError rer:InvalidLanguageTagError ; + rer:suggestedContext rer:languageTag, rer:data ; + rdfs:isDefinedBy rer: . + +rer:InvalidLanguageTagError + a owl:Class ; + rdfs:label "Invalid Language Tag Error" ; + rdfs:subClassOf rer:InvalidOutputRDF ; + rdfs:comment "The language tag of a literal is not valid according to the BCP47 specification." ; + rer:potentialConfusion "May be confused with Not Well-formed Language Tag; if the tag is well-formed but not recognized." ; + rer:potentialConfusionError rer:NotWellFormedLanguageTagError ; + rdfs:isDefinedBy rer: . + +rer:SyntaxError + a owl:Class ; + rdfs:label "Parsing Error" ; + rdfs:subClassOf rer:Error ; + rer:isAbstract true ; + rdfs:comment "Errors related to the parsing of a mapping definition." ; + rer:potentialCause "The mapping definition is invalid." ; + rer:potentialSolution "Fix the mapping definition." ; + rdfs:isDefinedBy rer: . + + +rer:UnparseableDataError + a owl:Class ; + rdfs:label "Unparseable Data Error" ; + rdfs:subClassOf rer:DataError, rer:SyntaxError ; + rdfs:comment "The obtained data does not follow the expected format." ; + rer:potentialCause "The source value uses an unexpected syntax or format that cannot be parsed." ; + rer:potentialSolution "Normalize the input format or adjust the reference formulation and parsing rules to accept the observed format." ; + rer:potentialConfusion "May be confused with Type Conversion Error; here the problem is parsing, not converting a parsed value." ; + rer:potentialConfusionError rer:TypeConversionError ; + rdfs:isDefinedBy rer: . + +rer:SourceAccessError + a owl:Class ; + rdfs:label "Source Access Error" ; + rdfs:subClassOf rer:ExecutionError ; + rdfs:comment "The specified rml:Source cannot be accessed/reached/does not exist." ; + rer:potentialCause "Error in the access path or credentials" ; + rer:potentialSolution "Verify the source URI, network connectivity, and authentication credentials; update the mapping or environment configuration accordingly." ; + rer:potentialConfusion "Do not confuse with Logical Source Error, which concerns iterating over the source rather than reaching it." ; + rer:potentialConfusionError rer:LogicalSourceError ; + rdfs:isDefinedBy rer: . + +rer:LogicalSourceError + a owl:Class ; + rdfs:label "Logical Source Error" ; + rdfs:subClassOf rer:ExecutionError ; + rdfs:comment "Error while obtaining an iteration or iterating over a source." ; + rer:potentialCause "The reference formulation, iterator, is incompatible" ; + rer:potentialSolution "Review the logical source, reference formulation and iterator expression to ensure they are compatible with the actual source structure." ; + rer:potentialConfusion "May be confused with Reference Formulation Execution Error, which relates to value extraction rather than iteration." ; + rer:potentialConfusionError rer:ReferenceFormulationExecutionError ; + rdfs:isDefinedBy rer: . + +rer:ReferenceFormulationExecutionError + a owl:Class ; + rdfs:label "Reference Formulation Execution Error" ; + rdfs:subClassOf rer:ExecutionError, rer:ReferenceFormulationError ; + rdfs:comment "Failed to extract a value from the source data using the provided reference formulation." ; + rer:potentialCause "The reference expression is incorrect or does not match the current iteration context." ; + rer:potentialSolution "Check and correct the reference expression so it matches the structure and naming of the source data." ; + rer:potentialConfusion "Can be confused with Logical Source Error; here iteration works but the value extraction expression fails." ; + rer:potentialConfusionError rer:LogicalSourceError ; + rer:suggestedContext rer:iterationData, rer:referenceFormulation, rer:reference, rer:mappingStatement ; + rdfs:isDefinedBy rer: . + +rer:FunctionExecutionError + a owl:Class ; + rdfs:label "Function Execution Error" ; + rdfs:subClassOf rer:ExecutionError ; + rdfs:comment "An error that occurs while executing a function during mapping evaluation." ; + rer:potentialCause "The function implementation raised an exception or received invalid arguments during execution." ; + rer:potentialSolution "Inspect the function definition, arguments and implementation; fix invalid inputs or implementation bugs." ; + rer:potentialConfusion "Type Conversion Error could be an alternative when we precisely know that's the issue." ; + rer:potentialConfusionError rer:TypeConversionError ; + rdfs:isDefinedBy rer: . + +rer:InvalidOutputRDF + a owl:Class ; + rdfs:label "Invalid Output RDF" ; + rdfs:subClassOf rer:DataError ; + rdfs:comment "An error indicating that the produced RDF graph is invalid." ; + rer:potentialCause "The mapping generates RDF terms or statements that violate the RDF data model." ; + rer:potentialSolution "Review the mapping rules and output constraints to ensure only valid RDF terms and structures are produced." ; + rer:potentialConfusion "This error is not for mapping file with errors in the RDF serialization format, these should be Mapping Syntax Error." ; + rer:potentialConfusionError rer:RDFMappingSyntaxError ; + rdfs:isDefinedBy rer: . + +rer:InvalidIRI + a owl:Class ; + rdfs:label "Invalid IRI" ; + rdfs:subClassOf rer:InvalidOutputRDF ; + rdfs:comment "An error indicating that a generated IRI is syntactically invalid [RFC3987] or not allowed." ; + rer:potentialCause "The mapping constructs IRIs by concatenation or templating that yields illegal characters or structure." ; + rer:potentialSolution "Validate IRI templates and input values; encode or sanitize components before building IRIs." ; + rer:potentialConfusion "May be confused with Predicate Not Reifiable; here the issue is invalid syntax of the IRI itself." ; + rer:potentialConfusionError rer:PredicateNotReifiable, rer:InvalidURI ; + rdfs:isDefinedBy rer: . + + +rer:InvalidURI + a owl:Class ; + rdfs:label "Invalid URI" ; + rdfs:subClassOf rer:InvalidOutputRDF ; + rdfs:comment "An error indicating that a generated URI is syntactically invalid [RFC3986] or not allowed." ; + rer:potentialCause "The mapping constructs URIs by concatenation or templating that yields illegal characters or structure." ; + rer:potentialSolution "Validate URI templates and input values; encode or sanitize components before building URIs." ; + rer:potentialConfusion "May be confused with Predicate Not Reifiable; here the issue is invalid syntax of the URI itself." ; + rer:potentialConfusionError rer:PredicateNotReifiable, rer:InvalidIRI ; + rdfs:isDefinedBy rer: . + +rer:PredicateNotReifiable + a owl:Class ; + rdfs:label "Predicate Not Reifiable" ; + rdfs:subClassOf rer:InvalidOutputRDF ; + rdfs:comment "An error indicating that a predicate used in the mapping cannot be reified as required." ; + rer:potentialCause "The mapping attempts to reify a predicate that is reserved, unsupported or structurally incompatible with reification." ; + rer:potentialSolution "Adapt the mapping to use a different predicate or another representation that does not require reification." ; + rer:potentialConfusion "Do not confuse with Invalid IRI, which is about syntactic invalidity of the IRI, not reifiability." ; + rer:potentialConfusionError rer:InvalidIRI ; + rdfs:isDefinedBy rer: . + +rer:MappingError + a owl:Class ; + rdfs:label "Mapping Error" ; + rdfs:subClassOf rer:Error ; + rdfs:comment "Errors related to the mapping definition itself. Changing input data or configuration will not make it work." ; + rer:potentialCause "The RML mapping is invalid." ; + rer:potentialSolution "Changing the mapping." ; + rer:potentialConfusion "The error is not due to the data in which case it is probably an Execution Error or Configuration Error." ; + rer:potentialConfusionError rer:ExecutionError, rer:ConfigurationError ; + widoco:order 302 ; + rdfs:isDefinedBy rer: . + +rer:RDFMappingSyntaxError + a owl:Class ; + rdfs:label "RDF Mapping Syntax Error" ; + rdfs:subClassOf rer:MappingError, rer:SyntaxError ; + rdfs:comment "Error in the RDF Serialization of the mapping." ; + rer:potentialCause "The mapping file contains invalid RDF syntax or serialization errors." ; + rer:potentialSolution "Validate and fix the RDF syntax using an RDF parser or validator before running the engine." ; + rer:potentialConfusion "Do not confuse with Invalid Output RDF, which refers to invalid generated RDF data rather than mapping syntax." ; + rer:potentialConfusionError rer:InvalidOutputRDF ; + rdfs:isDefinedBy rer: . + +rer:UnsupportedMapping + a owl:Class ; + rdfs:label "Unsupported Mapping" ; + rdfs:subClassOf rer:MappingError ; + rdfs:comment "The processor encounters a feature, configuration, or term that it cannot execute. The processor implies no judgment on the validity of the construct, only its own inability to process it." ; + rer:potentialCause "The mapping uses a feature that is not implemented in this specific engine." ; + rer:potentialSolution "Check the engine documentation for supported features. You may need to simplify the mapping, switch to a compatible engine, or implement the missing feature plugin." ; + rer:potentialConfusion "The difference with Out Of Spec is that the engine don't know if this is spec compliant or not, whereas an Out Of Spec mapping is invalid everywhere." ; + rer:potentialConfusionError rer:OutOfSpec ; + rdfs:isDefinedBy rer: . + +rer:UnsupportedFunction + a owl:Class ; + rdfs:label "Unsupported Function" ; + rdfs:subClassOf rer:UnsupportedMapping ; + rdfs:comment "The mapping references a function that the processor cannot execute because the implementation logic is missing." ; + rer:potentialCause "The function IRI exists in the mapping, but the engine has no registered code associated with that IRI." ; + rer:potentialSolution "Register the custom function implementation with the engine or ensure the necessary function libraries are loaded." ; + rer:potentialConfusion "Distinguished from Function Execution Error: Here the function code is never called because it wasn't found. In execution errors, the code runs but fails." ; + rer:potentialConfusionError rer:FunctionExecutionError ; + rdfs:isDefinedBy rer: . + +rer:OutOfSpec + a owl:Class ; + rdfs:label "Out Of Spec" ; + rdfs:subClassOf rer:MappingError ; + rdfs:comment "The mapping contains constructs that that violate the RML specification (e.g., two logical sources), regardless of the engine." ; + rer:potentialCause "A cardinality violation, usage of a property on the wrong class, or an invalid literal value for a configuration property. Likely to be caught by the shapes." ; + rer:potentialSolution "Refactor the mapping to adhere to the RML specification constraints. Validating the mapping against SHACL shapes usually reveals the fix." ; + rer:potentialConfusion "May be confused with Unsupported Mapping: An Out Of Spec error indicates the mapping is objectively invalid and should not work on any compliant processor." ; + rer:potentialConfusionError rer:UnsupportedMapping ; + rdfs:isDefinedBy rer: . + +rer:ReferenceFormulationSyntaxError + a owl:Class ; + rdfs:label "Reference Formulation Syntax Error" ; + rdfs:subClassOf rer:MappingError, rer:SyntaxError, rer:ReferenceFormulationError ; + rdfs:comment "An error indicating that the reference formulation expression in the mapping has invalid syntax." ; + rer:potentialCause "The reference formulation or path expression in the mapping is malformed." ; + rer:potentialSolution "Correct the reference formulation syntax according to the rules of the chosen reference formulation." ; + rer:potentialConfusion "Should not be confused with Reference Formulation Execution Error, which arises when executing a syntactically valid expression." ; + rer:potentialConfusionError rer:ReferenceFormulationExecutionError ; + rdfs:isDefinedBy rer: . + +rer:NoTriplesMap + a owl:Class ; + rdfs:label "No Triples Map" ; + rdfs:subClassOf rer:MappingError ; + rdfs:comment "No triples map found in the graph." ; + rer:potentialCause "The mapping file is empty or contains no resources recognized as TriplesMap" ; + rer:potentialSolution "Ensure that the mapping defines at least one Triples Map with the correct IRIs and prefixes." ; + rer:potentialConfusion "May be confused with Source Access Error; here the source may be fine but no mapping is defined to use it." ; + rer:potentialConfusionError rer:SourceAccessError ; + rdfs:isDefinedBy rer: . + +rer:IncorrectTermType + a owl:Class ; + rdfs:label "Incorrect Term Type" ; + rdfs:subClassOf rer:OutOfSpec ; + rdfs:comment "The term type of a term is not the expected one." ; + rer:potentialCause "The mapping specifies a term type (IRI, blank node, literal) inconsistent with the position or constraints in the target RDF model." ; + rer:potentialSolution "Adjust the mapping term type or target constraints so that subject, predicate and object positions use valid term types." ; + rer:potentialConfusion "May be confused with Type Conversion Error; here term type is wrong, not the lexical value datatype." ; + rer:potentialConfusionError rer:TypeConversionError ; + rdfs:isDefinedBy rer: . + +rer:ConfigurationError + a owl:Class ; + rdfs:label "Configuration Error" ; + rdfs:subClassOf rer:Error ; + rdfs:comment "Errors related to engine or environment configuration." ; + rer:potentialCause + "Required configuration options, environment variables, or parameters are missing, invalid, or inconsistent." ; + rer:potentialSolution + "Review engine configuration, command line parameters, and environment variables; fix invalid values and provide missing ones." ; + rer:potentialConfusion + "Do not confuse with Mapping Error (mapping definition is wrong) or Execution Error (data-related issues)." ; + widoco:order 301 ; + rdfs:isDefinedBy rer: . + +rer:MissingDependency + a owl:Class ; + rdfs:label "Missing Dependency" ; + rdfs:subClassOf rer:ConfigurationError ; + rdfs:comment "A required library, plugin, external tool or service is not available at runtime." ; + rer:potentialCause "The engine was started without installing or enabling a required dependency." ; + rer:potentialSolution + "Install and enable the missing dependency, update the classpath/module-path, or configure the engine to use an available alternative." ; + rer:potentialConfusion + "May be confused with Unsupported Function, which refers to a function not implemented even when dependencies are present." ; + rdfs:isDefinedBy rer: . + +rer:OutOfMemory + a owl:Class ; + rdfs:label "Out Of Memory" ; + rdfs:subClassOf rer:ExecutionError ; + rdfs:comment "The engine ran out of memory while executing a mapping or producing results." ; + rer:potentialCause + "Input data is too large, processing is not streamed, or memory limits for the process/VM are too low." ; + rer:potentialSolution + "Increase memory limits, enable streaming or chunked processing, or split the job into smaller executions." ; + rer:potentialConfusion + "Do not confuse with Source Access Error; here the problem is resource exhaustion, not reaching the source." ; + rdfs:isDefinedBy rer: . + +rer:CannotReadMappingDocument + a owl:Class ; + rdfs:label "Cannot Read Mapping Document" ; + rdfs:subClassOf rer:ConfigurationError ; + rdfs:comment "The mapping document cannot be read (e.g. missing file, insufficient permissions, unreadable stream)." ; + rer:potentialCause + "Wrong path or URI to the mapping file, missing file, or insufficient file system / network permissions." ; + rer:potentialSolution + "Verify that the mapping path/URI is correct, the resource exists and the process has sufficient permissions to read it." ; + rer:potentialConfusion + "Do not confuse with RDF Mapping Syntax Error; here the mapping cannot be read at all, not parsed." ; + rdfs:isDefinedBy rer: . + +rer:UnexpectedError + a owl:Class ; + rdfs:label "Unexpected Error" ; + rdfs:subClassOf rer:Error ; + rdfs:comment "A generic internal engine error, typically indicating a bug or unexpected failure not attributable to user input." ; + rer:potentialCause "Unhandled exception, logic bug, or inconsistent internal state within the RML processor." ; + rer:potentialSolution + "Collect logs and stack traces, report the issue to the engine maintainers, and update to a fixed version when available." ; + rer:potentialConfusion + "Do not confuse with Configuration Error or Mapping Error, which are caused by user-provided configuration or mapping definitions." ; + rdfs:isDefinedBy rer: . + + + +@prefix draw: . +@prefix xsd: . + + "760"^^xsd:double; + "110.5"^^xsd:double; + "260"^^xsd:double; + "123"^^xsd:double. + "0"^^xsd:double; + "20"^^xsd:double; + "180"^^xsd:double; + "20"^^xsd:double. + "0"^^xsd:double; + "40"^^xsd:double; + "180"^^xsd:double; + "20"^^xsd:double. + "0"^^xsd:double; + "60"^^xsd:double; + "180"^^xsd:double; + "20"^^xsd:double. + "0"^^xsd:double; + "80"^^xsd:double; + "180"^^xsd:double; + "20"^^xsd:double. + "0"^^xsd:double; + "100"^^xsd:double; + "180"^^xsd:double; + "20"^^xsd:double. + "1159.9951953125"^^xsd:double; + "147"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1159.9951953125"^^xsd:double; + "304"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "480"^^xsd:double; + "200.5"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "478.73"^^xsd:double; + "110.5"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1028.73"^^xsd:double; + "400"^^xsd:double; + "171.27"^^xsd:double; + "50"^^xsd:double. + "618.73"^^xsd:double; + "605"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1679.996875"^^xsd:double; + "938"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "2158"^^xsd:double; + "304"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1870"^^xsd:double; + "304"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1960"^^xsd:double; + "380"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1790"^^xsd:double; + "380"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1448.73"^^xsd:double; + "420"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "579.73"^^xsd:double; + "400"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1700"^^xsd:double; + "510"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1870.0031250000002"^^xsd:double; + "625"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1870"^^xsd:double; + "805"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1433.23"^^xsd:double; + "589"^^xsd:double; + "151"^^xsd:double; + "50"^^xsd:double. + "1730"^^xsd:double; + "805"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1684.0034375"^^xsd:double; + "1050"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1588.73"^^xsd:double; + "805"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1271"^^xsd:double; + "400"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1429.03"^^xsd:double; + "750"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1240"^^xsd:double; + "599"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1300"^^xsd:double; + "675"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1121"^^xsd:double; + "514"^^xsd:double; + "219"^^xsd:double; + "50"^^xsd:double. + "738.73"^^xsd:double; + "515"^^xsd:double; + "151.27"^^xsd:double; + "50"^^xsd:double. + "1540"^^xsd:double; + "938"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1400"^^xsd:double; + "938"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "128.73"^^xsd:double; + "400"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "488.73"^^xsd:double; + "515"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "610"^^xsd:double; + "515"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "488.73"^^xsd:double; + "605"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "900"^^xsd:double; + "515"^^xsd:double; + "200"^^xsd:double; + "50"^^xsd:double. + "348.73"^^xsd:double; + "515"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "200.00000000000003"^^xsd:double; + "515"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1520"^^xsd:double; + "520"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "10"^^xsd:double; + "515"^^xsd:double; + "180"^^xsd:double; + "50"^^xsd:double. + "1620"^^xsd:double; + "400"^^xsd:double; + "120"^^xsd:double; + "50"^^xsd:double. + "1408.73"^^xsd:double; + "320"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double; + "1553.9951953124998"^^xsd:double; + "213.75"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double. +xsd:dateTimeStamp "1526.9951953124998"^^xsd:double; + "108"^^xsd:double; + "154"^^xsd:double; + "30"^^xsd:double. +xsd:integer "1553.9951953124998"^^xsd:double; + "143"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double. + "1553.9951953124998"^^xsd:double; + "178"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double. +xsd:string "1553.9951953124998"^^xsd:double; + "37"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double; + "818.03"^^xsd:double; + "406"^^xsd:double; + "100"^^xsd:double; + "24"^^xsd:double. +xsd:language "1910"^^xsd:double; + "948"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double. + "1967.9951953124998"^^xsd:double; + "495"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double. + "2168"^^xsd:double; + "639"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double; + "2168"^^xsd:double; + "639"^^xsd:double; + "100"^^xsd:double; + "30"^^xsd:double. + "-0.0896"^^xsd:double; + "3"^^xsd:double; + "0"^^xsd:double; + "0"^^xsd:double. + "1544.4951953124998"^^xsd:double; + "0"^^xsd:double; + "119"^^xsd:double; + "34"^^xsd:double. + "818.03"^^xsd:double; + "440"^^xsd:double; + "81.97"^^xsd:double; + "30"^^xsd:double. + "879"^^xsd:double; + "605"^^xsd:double; + "81.96822102864604"^^xsd:double; + "44"^^xsd:double. + "306"^^xsd:double; + "117.25"^^xsd:double; + "90"^^xsd:double; + "36.5"^^xsd:double. + "306"^^xsd:double; + "207.25"^^xsd:double; + "100"^^xsd:double; + "36.5"^^xsd:double. From 420419174f262999605b57288589db4baf174c19 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 17 Jun 2026 13:39:04 +0200 Subject: [PATCH 12/45] fix imports --- src/main/java/burp/parse/Parse.java | 4 +--- src/main/java/burp/parse/turtleprov/TurtleProvParser.java | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index 2b58638..7809933 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -6,9 +6,7 @@ import burp.model.fnml.FunctionExecution; import burp.model.fnml.ReturnMap; import burp.model.gathermap.GatherMap; -import burp.model.lv.JoinType; -import burp.model.lv.LogicalView; -import burp.model.lv.ViewJoin; +import burp.model.lv.*; import burp.model.rdf.BlankNodeTerm; import burp.model.rdf.IRITerm; import burp.model.rdf.LiteralTerm; diff --git a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java index 3d0e1fd..ec1c734 100644 --- a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java +++ b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java @@ -1,6 +1,7 @@ package burp.parse.turtleprov; import burp.reporting.PointRange; +import org.antlr.v4.runtime.*; import java.io.IOException; import java.io.InputStream; @@ -95,8 +96,8 @@ public void syntaxError(Recognizer recognizer, Object offendingSymbol, int try { store = visitor.visitTurtleDoc(parser.turtleDoc()); } catch (TurtleProvException e) { - int line = e.getRange() != null && e.getRange().start() != null ? e.getRange().start().line + 1 : 0; - int col = e.getRange() != null && e.getRange().start() != null ? e.getRange().start().column : 0; + int line = e.getRange() != null ? e.getRange().start().line + 1 : 0; + int col = e.getRange() != null ? e.getRange().start().column : 0; syntaxErrors.add(new ProvStore.SyntaxError(line, col, e.getMessage(), "AST Traversal", e.getRange())); store = visitor.getStore(); } catch (Exception e) { From 3b83275e9eaff24391b31aa44d1b5775eb647974 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 17 Jun 2026 13:39:28 +0200 Subject: [PATCH 13/45] chore: update dependencies prepare deploy --- .github/workflows/deploy.yml | 42 +++++++++ .github/workflows/{ci.yml => tests.yml} | 8 +- pom.xml | 115 +++++++++++++++--------- 3 files changed, 117 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/deploy.yml rename .github/workflows/{ci.yml => tests.yml} (79%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..cf213d5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Deploy + +on: + push: + branches: + - main + tags: + - 'v*' + +jobs: + deploy: + name: Deploy Release + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + server-id: central + server-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + server-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + gpg-private-key: ${{ secrets.GPG_ARMOR_KEY }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: Deploy Maven package + run: mvn deploy -B -Pdeploy + - name: JReleaser Release + run: mvn jreleaser:full-release -B -Pdeploy + env: + TAG_NAME: ${{ github.ref }} + JRELEASER_PROJECT_VERSION: ${{ github.ref }} + JRELEASER_JBANG_GITHUB_TOKEN: ${{ secrets.JBANG_CATALOG_TOKEN }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/tests.yml similarity index 79% rename from .github/workflows/ci.yml rename to .github/workflows/tests.yml index f9a5477..ad578db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Java CI with Maven +name: Tests on: push: @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Set up JDK 21 - uses: actions/setup-java@v3 + uses: actions/setup-java@v5 with: java-version: '21' distribution: 'temurin' @@ -22,7 +22,7 @@ jobs: - name: Build and test with Maven run: mvn test - name: Publish Test Report - uses: mikepenz/action-junit-report@v6.0.0 + uses: mikepenz/action-junit-report@v6 if: success() || failure() # always run even if the previous step fails with: report_paths: '**/target/surefire-reports/TEST-*.xml' diff --git a/pom.xml b/pom.xml index 54a07c5..42ebba9 100644 --- a/pom.xml +++ b/pom.xml @@ -171,6 +171,8 @@ 3.11.0 21 + 21 + 21 com.google.auto.service @@ -259,16 +261,15 @@ -n RER --ontology - --rdfs --inference --import ${project.basedir}/src/main/resources/vocabularies/ptr.ttl -a https://w3id.org/dre/rer# --declarations - static { - M_MODEL.read(RER.class.getClassLoader().getResourceAsStream("vocabularies/rer.ttl"), - RER.NS, "TURTLE"); } + + static{M_MODEL.read(RER.class.getClassLoader().getResourceAsStream("vocabularies/rer.ttl"), + RER.NS, "TURTLE");} true @@ -355,14 +356,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - - 21 - 21 - - @@ -371,6 +364,16 @@ deploy + + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 + true + + central + + + org.apache.maven.plugins maven-shade-plugin @@ -475,7 +478,7 @@ - kg-construct + kg-construct BURP github.com true @@ -514,7 +517,7 @@ ALWAYS ALWAYS - jduchateau + kg-construct jbang-catalog @@ -539,35 +542,47 @@ picocli 4.7.5 + org.apache.jena jena-arq - 5.6.0 + ${jena.version} org.apache.jena jena-shacl - 5.6.0 + ${jena.version} - com.google.guava - guava - 33.6.0-jre + org.apache.jena + jena-iri3986 + ${jena.version} + + org.apache.jena + jena-ontapi + ${jena.version} + + com.opencsv opencsv - 5.9 + 5.12.0 + + + com.univocity + univocity-parsers + 2.9.1 com.jayway.jsonpath json-path - 2.9.0 + 2.10.0 net.minidev json-smart - 2.5.0 + 2.6.0 at.asitplus @@ -597,7 +612,7 @@ com.microsoft.sqlserver mssql-jdbc - 12.6.1.jre11 + 13.2.1.jre11 org.xerial @@ -609,12 +624,40 @@ commons-text 1.11.0 + + net.sf.saxon + Saxon-HE + 12.9 + + + com.google.guava + guava + 33.4.8-jre + + + org.tukaani + xz + 1.9 + + + org.antlr + antlr4-runtime + ${antlr.version} + + + + + com.github.candil-data-fabric + JNC + xpath-namespace-SNAPSHOT + - + - org.slf4j - slf4j-simple - 2.0.17 + com.google.auto.service + auto-service-annotations + 1.1.1 + compile @@ -663,24 +706,8 @@ org.apache.jena jena-fuseki-main - 4.10.0 + ${jena.version} test - - - org.tukaani - xz - 1.9 - - - com.univocity - univocity-parsers - 2.9.1 - - - com.github.candil-data-fabric - JNC - xpath-namespace-SNAPSHOT - From 95c2502d6a31b016e1369110636400bbcc180439 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 17 Jun 2026 13:39:45 +0200 Subject: [PATCH 14/45] chore: remove unused FetchTestCases --- src/test/java/burp/Test.java | 0 src/test/java/burp/tools/FetchTestCases.java | 226 ------------------- 2 files changed, 226 deletions(-) delete mode 100644 src/test/java/burp/Test.java delete mode 100644 src/test/java/burp/tools/FetchTestCases.java diff --git a/src/test/java/burp/Test.java b/src/test/java/burp/Test.java deleted file mode 100644 index e69de29..0000000 diff --git a/src/test/java/burp/tools/FetchTestCases.java b/src/test/java/burp/tools/FetchTestCases.java deleted file mode 100644 index b6614bd..0000000 --- a/src/test/java/burp/tools/FetchTestCases.java +++ /dev/null @@ -1,226 +0,0 @@ -package burp.tools; - -import org.jspecify.annotations.NonNull; - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.*; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -/** - * Cross-platform fetcher that downloads RML module repositories as ZIP archives - * (no need for Git installed), extracts them, copies test-cases and shapes - * into this project, and cleans up temporary files. - * - * Usage (recommended via Maven): - * mvn -q -DskipTests=true -Dexec.mainClass=burp.tools.FetchTestCases exec:java - */ -public class FetchTestCases { - - public static void main(String[] args) { - Path root = Paths.get("."); - run( - root.resolve("src/test/resources"), - root.resolve("src/main/resources/shapes"), - root.resolve("src/main/resources/vocabularies/rml/") - ); - } - - public static void run(Path testCasesDir, Path shapesDir, Path vocabulariesDir) { - List repos = List.of( - "rml-core", - "rml-cc", - "rml-io", - "rml-fnml", - "rml-lv", - "rml-io-registry" - ); - - for (String repo : repos) { - String base = "https://github.com/kg-construct/" + repo; - String zipMain = base + "/archive/refs/heads/main.zip"; - String zipMaster = base + "/archive/refs/heads/master.zip"; - - try { - System.out.println("Downloading and extracting " + repo + " …"); - Path tempDir = Files.createTempDirectory("burp-fetch-" + repo); - - try { - if (!downloadWithFallback(zipMain, zipMaster, tempDir)) { - System.err.println("• Failed to download " + repo + " (main/master not found). Skipping."); - continue; - } - - // GitHub zip contains a single top-level directory named like - - Path innerRoot; - try (var stream = Files.list(tempDir)) { - innerRoot = stream.filter(Files::isDirectory).findFirst().orElse(tempDir); - } - - // Copy test-cases - Path srcTestCases = innerRoot.resolve("test-cases"); - if (testCasesDir == null) { - System.out.println("• Skipped " + repo + " test-cases (destination not configured)"); - } else if (Files.isDirectory(srcTestCases)) { - Path destTestCases = testCasesDir.resolve(repo); - Files.createDirectories(destTestCases); - copyDir(srcTestCases, destTestCases); - System.out.println("• Copied test-cases: " + srcTestCases + " -> " + destTestCases); - } else { - System.out.println("• Skipped " + repo + " (no test-cases directory found)"); - } - - // Copy shapes - Path srcShapes = innerRoot.resolve("shapes"); - if (shapesDir == null) { - System.out.println("• Skipped " + repo + " shapes (destination not configured)"); - } else if (Files.isDirectory(srcShapes)) { - Path destShapes = shapesDir.resolve(repo); - Files.createDirectories(destShapes); - copyDir(srcShapes, destShapes); - System.out.println("• Copied shapes: " + srcShapes + " -> " + destShapes); - } else { - System.out.println("• Skipped " + repo + " (no shapes directory found)"); - } - - // Copy vocabulary - Path srcVoc = innerRoot.resolve("ontology/" + repo + ".owl"); - if (vocabulariesDir == null) { - System.out.println("• Skipped " + repo + " vocabulary (destination not configured)"); - } else if (Files.exists(srcVoc)) { - Path destVoc = vocabulariesDir.resolve(repo + ".owl"); - Files.createDirectories(vocabulariesDir); - Files.copy(srcVoc, destVoc, StandardCopyOption.REPLACE_EXISTING); - System.out.println("• Copied vocabulary: " + srcVoc + " -> " + destVoc); - } else { - System.out.println("• Skipped " + repo + " (no ontology file found)"); - } - - } finally { - // Cleanup extracted content - safeDeleteRecursively(tempDir); - } - } catch (Exception e) { - System.err.println(); - System.err.println("Error occurred while processing " + repo + "."); - System.err.println("• Check the repository URLs and your internet connection."); - System.err.println("Details: " + e.getMessage()); - } - } - - System.out.println("Done."); - } - - private static boolean downloadWithFallback(String url1, String url2, Path dest) { - try { - return downloadAndExtract(url1, dest); - } catch (IOException e) { - try { - return downloadAndExtract(url2, dest); - } catch (IOException ex) { - return false; - } - } - } - - private static boolean downloadAndExtract(String urlStr, Path destDir) throws IOException { - try { - URI uri = new URI(urlStr); - URL url = uri.toURL(); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setConnectTimeout(20000); - conn.setReadTimeout(60000); - conn.setRequestMethod("GET"); - conn.setRequestProperty("Accept", "application/zip"); - - int code = conn.getResponseCode(); - if (code < 200 || code >= 300) { - try (InputStream is = conn.getErrorStream()) { - if (is != null) is.close(); - } - return false; - } - - Files.createDirectories(destDir); - try (InputStream is = conn.getInputStream(); - BufferedInputStream bis = new BufferedInputStream(is)) { - unzipStream(bis, destDir); - } - return true; - } catch (URISyntaxException e) { - throw new IOException(e); - } - } - - private static void unzipStream(InputStream input, Path destDir) throws IOException { - try (ZipInputStream zis = new ZipInputStream(input)) { - ZipEntry entry = zis.getNextEntry(); - while (entry != null) { - Path outPath = destDir.resolve(entry.getName()).normalize(); - // Prevent Zip Slip - if (!outPath.startsWith(destDir)) { - throw new IOException("Bad zip entry: " + entry.getName()); - } - if (entry.isDirectory()) { - Files.createDirectories(outPath); - } else { - Files.createDirectories(outPath.getParent()); - copyStream(zis, outPath); - } - zis.closeEntry(); - entry = zis.getNextEntry(); - } - } - } - - private static void copyStream(InputStream input, Path dest) throws IOException { - try (OutputStream out = Files.newOutputStream(dest, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) { - input.transferTo(out); - } - } - - private static void copyDir(Path src, Path dest) throws IOException { - Files.walkFileTree(src, new SimpleFileVisitor<>() { - @Override - public @NonNull FileVisitResult preVisitDirectory(@NonNull Path dir, @NonNull BasicFileAttributes attrs) throws IOException { - Path target = dest.resolve(src.relativize(dir)); - Files.createDirectories(target); - return FileVisitResult.CONTINUE; - } - - @Override - public @NonNull FileVisitResult visitFile(@NonNull Path file, @NonNull BasicFileAttributes attrs) throws IOException { - Path target = dest.resolve(src.relativize(file)); - Files.createDirectories(target.getParent()); - Files.copy(file, target, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES); - return FileVisitResult.CONTINUE; - } - }); - } - - private static void safeDeleteRecursively(Path path) throws IOException { - if (!Files.exists(path)) return; - Files.walkFileTree(path, new SimpleFileVisitor<>() { - @Override - public @NonNull FileVisitResult visitFile(@NonNull Path file, @NonNull BasicFileAttributes attrs) throws IOException { - Files.deleteIfExists(file); - return FileVisitResult.CONTINUE; - } - - @Override - public @NonNull FileVisitResult postVisitDirectory(@NonNull Path dir, IOException exc) throws IOException { - Files.deleteIfExists(dir); - return FileVisitResult.CONTINUE; - } - }); - } -} From 1f1aa0f94c33cb9f7bd6cb9f4ec37b99dc30ddcd Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 17 Jun 2026 13:40:51 +0200 Subject: [PATCH 15/45] ignore candil-data-fabric warning --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 42ebba9..19660ce 100644 --- a/pom.xml +++ b/pom.xml @@ -649,6 +649,7 @@ com.github.candil-data-fabric JNC + xpath-namespace-SNAPSHOT From 094b747f63f9ffaa8041735266d34f0cee84e5e9 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 17 Jun 2026 13:49:10 +0200 Subject: [PATCH 16/45] ci: fetch with submodules --- .github/workflows/deploy.yml | 1 + .github/workflows/tests.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cf213d5..128601d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,7 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 + submodules: true - name: Set up JDK 21 uses: actions/setup-java@v5 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad578db..d23c048 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v6 + with: + submodules: true - name: Set up JDK 21 uses: actions/setup-java@v5 with: From 9356402ffaceec2971d4abff457e94ba46429d84 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 17 Jun 2026 16:34:29 +0200 Subject: [PATCH 17/45] ci: add rdf-tests submodule to index --- .gitmodules | 1 + src/test/resources/rdf-tests | 1 + 2 files changed, 2 insertions(+) create mode 160000 src/test/resources/rdf-tests diff --git a/.gitmodules b/.gitmodules index 91683e0..9c2b66f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,7 @@ [submodule "src/test/resources/rdf-tests"] path = src/test/resources/rdf-tests url = https://github.com/w3c/rdf-tests.git + branch = main [submodule "rml-modules/rml-core"] path = rml-modules/rml-core url = https://github.com/kg-construct/rml-core.git diff --git a/src/test/resources/rdf-tests b/src/test/resources/rdf-tests new file mode 160000 index 0000000..f172950 --- /dev/null +++ b/src/test/resources/rdf-tests @@ -0,0 +1 @@ +Subproject commit f172950b7c8b42a7d2618a7905bba521847249b1 From a5ec9fed1190961d71c1521e95bd4e547a0d37ae Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 18 Jun 2026 16:50:33 +0200 Subject: [PATCH 18/45] fix: add dummy test case when no parametric test exists --- src/test/java/turtleprov/AbstractManifestTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/turtleprov/AbstractManifestTest.java b/src/test/java/turtleprov/AbstractManifestTest.java index 5540ce5..3a104b9 100644 --- a/src/test/java/turtleprov/AbstractManifestTest.java +++ b/src/test/java/turtleprov/AbstractManifestTest.java @@ -136,6 +136,8 @@ private List getTestsOfType(String typeUri) { } } } + if (list.isEmpty()) + list.add(new TestInfo("dummy", "dummy", null, null)); return list; } @@ -164,12 +166,14 @@ public Stream negativeEvalTests() { @ParameterizedTest(name = "{0}") @MethodSource("positiveSyntaxTests") public void testPositiveSyntax(TestInfo info) throws Exception { + if (!"dummy".equals(info.name)) return; TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); } @ParameterizedTest(name = "{0}") @MethodSource("negativeSyntaxTests") public void testNegativeSyntax(TestInfo info) throws Exception { + if (!"dummy".equals(info.name)) return; ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); Assertions.assertFalse(store.getSyntaxErrors().isEmpty(), "Expected syntax errors but none were found"); } @@ -177,6 +181,7 @@ public void testNegativeSyntax(TestInfo info) throws Exception { @ParameterizedTest(name = "{0}") @MethodSource("evalTests") public void testEvaluation(TestInfo info) throws Exception { + if (!"dummy".equals(info.name)) return; ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); Model actionModel = RDF12Converter.toModel(store, false); Model expectedModel = RDFDataMgr.loadModel(info.resultFile.toString()); @@ -188,6 +193,7 @@ public void testEvaluation(TestInfo info) throws Exception { @ParameterizedTest(name = "{0}") @MethodSource("negativeEvalTests") public void testNegativeEvaluation(TestInfo info) { + if (!"dummy".equals(info.name)) return; try { ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); Assertions.assertTrue(store.triples.isEmpty() || !store.getSyntaxErrors().isEmpty()); From e138749ad0a94519c289f3584df55b3831d47304 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 18 Jun 2026 16:51:06 +0200 Subject: [PATCH 19/45] chore: remove duplicate central-publishing-maven-plugin --- .github/workflows/deploy.yml | 2 +- .github/workflows/tests.yml | 4 +++- pom.xml | 10 ---------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 128601d..d3f1f24 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - id-token: write + issues: write steps: - name: Checkout code uses: actions/checkout@v6 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d23c048..ebcf362 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,9 @@ jobs: java-version: '21' distribution: 'temurin' cache: 'maven' - - name: Build and test with Maven + - name: Build with Maven + run: mvn clean compile + - name: Test with Maven run: mvn test - name: Publish Test Report uses: mikepenz/action-junit-report@v6 diff --git a/pom.xml b/pom.xml index 19660ce..1d05323 100644 --- a/pom.xml +++ b/pom.xml @@ -364,16 +364,6 @@ deploy - - org.sonatype.central - central-publishing-maven-plugin - 0.9.0 - true - - central - - - org.apache.maven.plugins maven-shade-plugin From e4dc84db48fe1044500701a57b9527e535ed10bf Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 8 Jul 2026 11:10:00 +0200 Subject: [PATCH 20/45] feat: add support for Boolean literals in RDF serialization in Datardf.toTerm --- src/main/java/burp/model/rdf/Datardf.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/burp/model/rdf/Datardf.java b/src/main/java/burp/model/rdf/Datardf.java index eab0f81..dc606dc 100644 --- a/src/main/java/burp/model/rdf/Datardf.java +++ b/src/main/java/burp/model/rdf/Datardf.java @@ -58,6 +58,7 @@ public static boolean semanticEquals(Object a, Object b) { return Objects.equals(termA, termB); } + static final IRITerm XSDboolean = new IRITerm("http://www.w3.org/2001/XMLSchema#boolean"); static final IRITerm XSDinteger = new IRITerm("http://www.w3.org/2001/XMLSchema#integer"); static final IRITerm XSDdouble = new IRITerm("http://www.w3.org/2001/XMLSchema#double"); static final IRITerm XSDdate = new IRITerm("http://www.w3.org/2001/XMLSchema#date"); @@ -119,7 +120,9 @@ public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { return new LiteralTerm(o.toString(), datatype, null); } - if (o instanceof Integer || o instanceof Long) { + if (o instanceof Boolean bool) { + return new LiteralTerm(bool.toString(), XSDboolean, null); + } else if (o instanceof Integer || o instanceof Long) { return new LiteralTerm(o.toString(), XSDinteger, null); } else if (o instanceof Float f) { return new LiteralTerm(doubleCanonicalMap(f.doubleValue()), XSDdouble, null); From fbbd3324c451f2ae758dc9c3e76e5e2b0bb482b7 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 8 Jul 2026 11:10:27 +0200 Subject: [PATCH 21/45] chore: remove obsolete fetch-test-cases scripts --- fetch-test-cases.bat | 61 ------------------------------------- fetch-test-cases.sh | 72 -------------------------------------------- 2 files changed, 133 deletions(-) delete mode 100644 fetch-test-cases.bat delete mode 100755 fetch-test-cases.sh diff --git a/fetch-test-cases.bat b/fetch-test-cases.bat deleted file mode 100644 index c058672..0000000 --- a/fetch-test-cases.bat +++ /dev/null @@ -1,61 +0,0 @@ -@echo off - -set "targetDir=target" - -echo Creating target directory... -if not exist "%targetDir%" mkdir "%targetDir%" -if errorlevel 1 goto error - -cd "%targetDir%" -if errorlevel 1 goto error - -echo Cloning https://github.com/kg-construct/rml-core -git clone https://github.com/kg-construct/rml-core -if errorlevel 1 goto error - -echo Cloning rhttps://github.com/kg-construct/rml-cc -git clone https://github.com/kg-construct/rml-cc -if errorlevel 1 goto error - -echo Cloning https://github.com/kg-construct/rml-io -git clone https://github.com/kg-construct/rml-io -if errorlevel 1 goto error - -echo Cloning rhttps://github.com/kg-construct/rml-fnml -git clone https://github.com/kg-construct/rml-fnml -if errorlevel 1 goto error - -echo Cloning https://github.com/kg-construct/rml-lv -git clone https://github.com/kg-construct/rml-lv -if errorlevel 1 goto error - -echo Cloning rhttps://github.com/kg-construct/rml-star -git clone https://github.com/kg-construct/rml-star -if errorlevel 1 goto error - -echo All repositories cloned successfully into the target directory! - -echo Copying test-case directories to ..\src\test\resources -xcopy .\rml-core\test-cases ..\src\test\resources\rml-core /E /I /Y -xcopy .\rml-cc\test-cases ..\src\test\resources\rml-cc /E /I /Y -xcopy .\target\rml-io\test-cases ..\src\test\resources\rml-io /E /I /Y -xcopy .\rml-lv\test-cases ..\src\test\resources\rml-lv /E /I /Y -xcopy .\rml-fnml\test-cases ..\src\test\resources\rml-fnml /E /I /Y -xcopy .\rml-star\test-cases ..\src\test\resources\rml-star /E /I /Y - -rmdir /S /Q .\rml-core -rmdir /S /Q .\rml-cc -rmdir /S /Q .\rml-io -rmdir /S /Q .\rml-lv -rmdir /S /Q .\rml-fnml -rmdir /S /Q .\rml-star - -goto end - -:error -echo Error occurred. -echo Check the repository URLs and your internet connection. -echo or verify that you have permissions to create and write to the target directory. - -:end -pause \ No newline at end of file diff --git a/fetch-test-cases.sh b/fetch-test-cases.sh deleted file mode 100755 index fb07063..0000000 --- a/fetch-test-cases.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -# --- config --- -target_dir="target" -resources_dir="src/test/resources" -shapes_resources_dir="src/main/resources/shapes" -repos=( - "rml-core" - "rml-cc" - "rml-io" - "rml-fnml" - "rml-lv" - "rml-star" -) - -trap 'echo; echo "Error occurred."; echo "• Check the repository URLs and your internet connection."; echo "• Verify you have permissions to create/write to \"$target_dir\"."; exit 1' ERR - -# Check prerequisites -command -v git >/dev/null 2>&1 || { echo "git is required but not found in PATH."; exit 1; } - -echo "Creating $target_dir directory..." -mkdir -p "$target_dir" - -echo "Entering $target_dir..." -cd "$target_dir" - -# Clone all repositories -for repo in "${repos[@]}"; do - echo "Cloning https://github.com/kg-construct/$repo ..." - git clone "https://github.com/kg-construct/$repo" -done - -echo "All repositories cloned successfully into $target_dir" - -# Copy test-cases into ../src/test/resources/ -echo "Copying test-case directories to ../$resources_dir ..." -for repo in "${repos[@]}"; do - src="$repo/test-cases" - dest="../$resources_dir/$repo" - if [[ -d "$src" ]]; then - mkdir -p "$dest" - # -a to preserve attrs; -r for recursive; --no-target-directory not needed here - cp -a "$src/." "$dest/" - echo "• Copied $src -> $dest" - else - echo "• Skipped $repo (no test-cases directory found)" - fi -done - -# Copy shapes into ../src/main/resources/ -echo "Copying shapes directories to ../$shapes_resources_dir ..." -for repo in "${repos[@]}"; do - src="$repo/shapes" - dest="../$shapes_resources_dir/$repo" - if [[ -d "$src" ]]; then - mkdir -p "$dest" - # -a to preserve attrs; -r for recursive; --no-target-directory not needed here - cp -a "$src/." "$dest/" - echo "• Copied $src -> $dest" - else - echo "• Skipped $repo (no shapes directory found)" - fi -done - -# Remove cloned repositories -echo "Cleaning up cloned repositories..." -for repo in "${repos[@]}"; do - rm -rf "./$repo" -done - -echo "Done." From 0391feedc38bde4cf87a251648b81a89230673b0 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 11:38:09 +0200 Subject: [PATCH 22/45] ci: disable (for now) RML-IO-Registry tests --- src/main/java/burp/reporting/Origin.java | 3 ++- src/test/java/burp/TestRMLIORegistry.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/burp/reporting/Origin.java b/src/main/java/burp/reporting/Origin.java index 80c1567..a5e8de2 100644 --- a/src/main/java/burp/reporting/Origin.java +++ b/src/main/java/burp/reporting/Origin.java @@ -2,11 +2,12 @@ import burp.model.PlanNode; import org.apache.jena.rdf.model.Statement; +import org.jspecify.annotations.Nullable; import java.util.Collections; import java.util.List; -public record Origin(PlanNode planNode, List sourceStatements) { +public record Origin(@Nullable PlanNode planNode, @Nullable List sourceStatements) { public Origin() { this((PlanNode) null, null); diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java index d2062cb..aa3a023 100644 --- a/src/test/java/burp/TestRMLIORegistry.java +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -8,6 +8,7 @@ import org.apache.jena.update.UpdateFactory; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; import org.testcontainers.containers.JdbcDatabaseContainer; import org.testcontainers.mssqlserver.MSSQLServerContainer; import org.testcontainers.mysql.MySQLContainer; @@ -21,6 +22,7 @@ import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; +@Disabled public class TestRMLIORegistry extends TestRMLModule { public static String base = "./target/test-classes/rml-io-registry/"; @@ -133,7 +135,7 @@ public static void startContainers() { @AfterAll public static void stopContainers() { - Stream.>of(PGSQL_CONTAINER, MYSQL_CONTAINER, MSSQL_CONTAINER) + Stream.of(PGSQL_CONTAINER, MYSQL_CONTAINER, MSSQL_CONTAINER) .parallel() .forEach(JdbcDatabaseContainer::stop); } From 3729f943d066a64e9dcba6d8a401c933593423b7 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 11:51:16 +0200 Subject: [PATCH 23/45] chore: remove unused code and refactor `itselfOrId` into `termItselfOrCollectionId` --- src/main/java/burp/ls/LogicalSourceFactory.java | 14 -------------- src/main/java/burp/model/MappingDocument.java | 16 ++++++++++------ .../burp/model/RdfStatementSubjectGraph.java | 4 ---- src/main/java/burp/model/Reference.java | 12 +----------- src/main/java/burp/model/TermExtensions.java | 13 ------------- 5 files changed, 11 insertions(+), 48 deletions(-) delete mode 100644 src/main/java/burp/model/TermExtensions.java diff --git a/src/main/java/burp/ls/LogicalSourceFactory.java b/src/main/java/burp/ls/LogicalSourceFactory.java index 2854a6e..900499a 100644 --- a/src/main/java/burp/ls/LogicalSourceFactory.java +++ b/src/main/java/burp/ls/LogicalSourceFactory.java @@ -69,14 +69,6 @@ public static List changeIterator( ); } - public static List changeIterator( - @NotNull String iterationAsString, - @NotNull Resource referenceFormulation, - String iterator - ) { - return changeIterator(iterationAsString, referenceFormulation, iterator, null); - } - public static Reference buildReference( Resource referenceFormulation, String reference, Origin origin, Origin referenceFormulationOrigin ) { @@ -94,10 +86,4 @@ public static Reference buildReference( ) ); } - - public static Reference buildReference( - Resource referenceFormulation, String reference, Origin origin - ) { - return buildReference(referenceFormulation, reference, origin, null); - } } diff --git a/src/main/java/burp/model/MappingDocument.java b/src/main/java/burp/model/MappingDocument.java index 0e80310..d01cc10 100644 --- a/src/main/java/burp/model/MappingDocument.java +++ b/src/main/java/burp/model/MappingDocument.java @@ -57,6 +57,13 @@ public List generate() { return postProcessContainers(stmts); } + public static Term termItselfOrCollectionId(Term t) { + if (t instanceof CollectionOrContainerTerm) { + return ((CollectionOrContainerTerm) t).getId(); + } + return t; + } + private List postProcessContainers(List stmts) { Map> containers = new HashMap<>(); Map> expandedContainer = new HashMap<>(); @@ -104,7 +111,7 @@ private List postProcessContainers(List stmts) { containerStmts.add(new RdfStatement( (BlankNodeOrIRI) currentListId, new IRITerm(RDF.first.getURI()), - TermExtensions.itselfOrId(element), + termItselfOrCollectionId(element), graph, null )); @@ -156,7 +163,7 @@ private void emitContainerStmts(CollectionOrContainerTerm c, Term subject, IRITe containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, new IRITerm(RDF.type.getURI()), type, graph, null)); for (int i = 0; i < c.getElements().size(); i++) { Term element = c.getElements().get(i); - containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, new IRITerm("http://www.w3.org/1999/02/22-rdf-syntax-ns#_" + (i + 1)), TermExtensions.itselfOrId(element), graph, null)); + containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, new IRITerm("http://www.w3.org/1999/02/22-rdf-syntax-ns#_" + (i + 1)), termItselfOrCollectionId(element), graph, null)); } } @@ -164,10 +171,7 @@ private Term rewrite(Term t) { if (t instanceof RdfListTerm && ((RdfListTerm) t).getElements().isEmpty()) { return new IRITerm(RDF.nil.getURI()); } - if (t instanceof CollectionOrContainerTerm) { - return ((CollectionOrContainerTerm) t).getId(); - } - return t; + return termItselfOrCollectionId(t); } private void extractAndMergeContainers(Term t, IRITerm graph, Map> containers, Map> expandedContainer, Consumer replaceTermBy) { diff --git a/src/main/java/burp/model/RdfStatementSubjectGraph.java b/src/main/java/burp/model/RdfStatementSubjectGraph.java index 058234f..101e6e3 100644 --- a/src/main/java/burp/model/RdfStatementSubjectGraph.java +++ b/src/main/java/burp/model/RdfStatementSubjectGraph.java @@ -17,10 +17,6 @@ public RdfStatementSubjectGraph(BlankNodeOrIRI subject, IRITerm graph, Set children() { - return Collections.emptyList(); - } - - @Override - public Iterable dependencies() { - return Collections.emptyList(); - } - public List values(Iteration i) { return getValues(i); } diff --git a/src/main/java/burp/model/TermExtensions.java b/src/main/java/burp/model/TermExtensions.java deleted file mode 100644 index fe4d90b..0000000 --- a/src/main/java/burp/model/TermExtensions.java +++ /dev/null @@ -1,13 +0,0 @@ -package burp.model; - -import burp.model.rdf.CollectionOrContainerTerm; -import burp.model.rdf.Term; - -public class TermExtensions { - public static Term itselfOrId(Term t) { - if (t instanceof CollectionOrContainerTerm) { - return ((CollectionOrContainerTerm) t).getId(); - } - return t; - } -} From a406789829fb1a075e1fc08143fe63d5a1960479 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 12:06:31 +0200 Subject: [PATCH 24/45] fix: testParsesRmlMappingFiles from RML Test Cases and BURP Test cases --- .../java/turtleprov/TurtleParserTest.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/test/java/turtleprov/TurtleParserTest.java b/src/test/java/turtleprov/TurtleParserTest.java index 8f9b597..4bbdc53 100644 --- a/src/test/java/turtleprov/TurtleParserTest.java +++ b/src/test/java/turtleprov/TurtleParserTest.java @@ -270,17 +270,29 @@ public void testParsesRmlMappingFiles(Path mappingFile) throws Exception { public static Stream rmlMappingFiles() throws Exception { - Path resourcesPath = Paths.get("src/test/resources"); - if (!Files.exists(resourcesPath)) return Stream.empty(); - - try (Stream walk = Files.walk(resourcesPath)) { - return walk + Path rmlResourcesPath = Paths.get("rml-modules"); + Stream rmlMappings; + try (Stream walk = Files.walk(rmlResourcesPath)) { + rmlMappings = walk .filter(p -> p.toString().contains("rml-")) .filter(p -> p.toString().endsWith("mapping.ttl")) .map(Arguments::of) .toList() .stream(); } + + Path burpResourcesPath = Paths.get("src/test/resources/burp"); + Stream burpMappings; + try (Stream walk = Files.walk(burpResourcesPath)) { + burpMappings = walk + .filter(p -> p.toString().endsWith("mapping.ttl")) + .map(Arguments::of) + .toList() + .stream(); + } + + return Stream.concat(rmlMappings, burpMappings); + } @Test From e27b2632ee6d666754adde31a51d3f285b8b0e01 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 12:26:34 +0200 Subject: [PATCH 25/45] feat: Add support for BSON with JSONPath --- pom.xml | 5 +++++ src/main/java/burp/ls/JSONSourceRFC.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1d05323..454b8dd 100644 --- a/pom.xml +++ b/pom.xml @@ -589,6 +589,11 @@ kotlinx-serialization-json-jvm 1.6.3 + + org.mongodb + bson-kotlinx + 5.9.0 + com.mysql mysql-connector-j diff --git a/src/main/java/burp/ls/JSONSourceRFC.java b/src/main/java/burp/ls/JSONSourceRFC.java index cc1a1c4..f052312 100644 --- a/src/main/java/burp/ls/JSONSourceRFC.java +++ b/src/main/java/burp/ls/JSONSourceRFC.java @@ -21,10 +21,14 @@ import org.antlr.v4.kotlinruntime.atn.ATNConfigSet; import org.antlr.v4.kotlinruntime.dfa.DFA; import org.apache.jena.rdf.model.Resource; +import org.bson.RawBsonDocument; +import org.bson.json.JsonMode; +import org.bson.json.JsonWriterSettings; import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; @@ -39,12 +43,18 @@ public class JSONSourceRFC extends FileBasedLogicalSource { public Iterable iterator() { try { String decompressedFile = getDecompressedFile(); + Path decompressedFilePath = Paths.get(decompressedFile); String jsonString; if (decompressedFile.endsWith(".bson")) { - throw new RuntimeException("BSON not supported."); + byte[] bsonBytes = Files.readAllBytes(decompressedFilePath); + RawBsonDocument bsonDoc = new RawBsonDocument(bsonBytes); + JsonWriterSettings settings = JsonWriterSettings.builder() + .outputMode(JsonMode.RELAXED) + .build(); + jsonString = bsonDoc.toJson(settings); } else { - jsonString = Files.readString(Paths.get(decompressedFile), encoding); + jsonString = Files.readString(decompressedFilePath, encoding); } JsonElement jsonContent = Json.Default.parseToJsonElement(jsonString); From 036b0c507460ab7fff521062fe7b02667c48548e Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 14:59:35 +0200 Subject: [PATCH 26/45] fix Double representation, normalise in test and while serialising use normal or scientific depending on threshold. --- src/main/java/burp/model/rdf/Datardf.java | 8 ++++ src/test/java/burp/TestRMLIORegistry.java | 3 +- src/test/java/burp/TestRMLModule.java | 47 ++++++++++++++++++++++- 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/main/java/burp/model/rdf/Datardf.java b/src/main/java/burp/model/rdf/Datardf.java index dc606dc..6665d23 100644 --- a/src/main/java/burp/model/rdf/Datardf.java +++ b/src/main/java/burp/model/rdf/Datardf.java @@ -140,6 +140,14 @@ public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { } static String doubleCanonicalMap(double d) { + if (Double.isNaN(d)) return "NaN"; + if (d == Double.POSITIVE_INFINITY) return "INF"; + if (d == Double.NEGATIVE_INFINITY) return "-INF"; + if (d < 0.999 || d > 999) return doubleScientificMap(d); + return Double.toString(d); + } + + static String doubleScientificMap(double d) { BigDecimal f = BigDecimal.valueOf(d); int p = f.precision(); String x = "0.0" + "#".repeat(Math.max(0, p - 2)) + "E0"; diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java index aa3a023..b337537 100644 --- a/src/test/java/burp/TestRMLIORegistry.java +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -8,7 +8,6 @@ import org.apache.jena.update.UpdateFactory; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.testcontainers.containers.JdbcDatabaseContainer; import org.testcontainers.mssqlserver.MSSQLServerContainer; import org.testcontainers.mysql.MySQLContainer; @@ -22,7 +21,7 @@ import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; -@Disabled + public class TestRMLIORegistry extends TestRMLModule { public static String base = "./target/test-classes/rml-io-registry/"; diff --git a/src/test/java/burp/TestRMLModule.java b/src/test/java/burp/TestRMLModule.java index 0b728f5..f600653 100644 --- a/src/test/java/burp/TestRMLModule.java +++ b/src/test/java/burp/TestRMLModule.java @@ -7,6 +7,9 @@ import com.opencsv.CSVReaderHeaderAware; import com.opencsv.CSVWriter; import com.opencsv.exceptions.CsvException; +import org.apache.jena.datatypes.xsd.XSDDatatype; +import org.apache.jena.graph.Node; +import org.apache.jena.graph.NodeFactory; import org.apache.jena.query.QueryExecution; import org.apache.jena.query.QueryExecutionFactory; import org.apache.jena.query.QuerySolution; @@ -17,6 +20,8 @@ import org.apache.jena.riot.RDFDataMgr; import org.apache.jena.riot.RiotException; import org.apache.jena.sparql.core.DatasetGraph; +import org.apache.jena.sparql.core.DatasetGraphFactory; +import org.apache.jena.sparql.core.Quad; import org.apache.jena.sparql.util.IsoMatcher; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.TestInstance; @@ -175,8 +180,8 @@ public void testForOK(TestData testData) throws Exception { boolean isJsonFormat = out.endsWith(".json") || out.endsWith(".jsonld") || out.endsWith(".rdfjson"); try { - DatasetGraph expected = loadDataset(decompressedExpectedPath); - DatasetGraph actual = loadDataset(decompressedActualPath); + DatasetGraph expected = normalizeDoubles(loadDataset(decompressedExpectedPath)); + DatasetGraph actual = normalizeDoubles(loadDataset(decompressedActualPath)); boolean isIsomorphic = IsoMatcher.isomorphic(expected, actual); if (!isIsomorphic) { @@ -398,4 +403,42 @@ private static List normalizeAndDeduplicateLines(String data) { Collections.sort(sorted); return sorted; } + + + /** + * Normalises the lexical forms of xsd:double and xsd:float literal values. + *

+ * Different test suites have conflicting representation expectations for double/float literals: + *

    + *
  • rml-io-registry test cases (0004o, 0004t, 0005t, 0006t) expect standard decimal lexical representations (like "20.0"^^xsd:double).
  • + *
  • rml-io test cases (e.g., RMLTTC0002q) expect canonical XML Schema scientific lexical representations (like "3.3E1"^^xsd:double).
  • + *
+ *

+ * To ensure that the test isomorphic check compares literals by their actual numerical values + * rather than their literal lexical representations, this method parses all double/float + * literals in the DatasetGraph and normalises them to the standard Double.toString (d) format. + */ + private static DatasetGraph normalizeDoubles(DatasetGraph dsg) { + DatasetGraph normalized = DatasetGraphFactory.create(); + Iterator it = dsg.find(); + while (it.hasNext()) { + Quad q = it.next(); + Node obj = q.getObject(); + if (obj.isLiteral()) { + String dtUri = obj.getLiteralDatatypeURI(); + if (XSDDatatype.XSDdouble.getURI().equals(dtUri) || XSDDatatype.XSDfloat.getURI().equals(dtUri)) { + try { + double val = Double.parseDouble(obj.getLiteralLexicalForm()); + String normLex = Double.toString(val); + Node normObj = NodeFactory.createLiteralDT(normLex, obj.getLiteralDatatype()); + q = Quad.create(q.getGraph(), q.getSubject(), q.getPredicate(), normObj); + } catch (NumberFormatException e) { + // fallback + } + } + } + normalized.add(q); + } + return normalized; + } } From 17aa9ffbcf4cc3b62061faf00da0eb1ab8db5378 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 15:18:58 +0200 Subject: [PATCH 27/45] feat: enhance CSV parsing with quoteChar and commentPrefix support, handle local URLs, and improve delimiter logic --- src/main/java/burp/ls/CSVSource.java | 7 +++ src/main/java/burp/ls/CSVSourceProvider.java | 28 ++++++++-- .../java/burp/ls/FileBaseSourceProvider.java | 51 ++++++++++++++----- src/main/java/burp/vocabularies/CSVW.java | 3 +- 4 files changed, 73 insertions(+), 16 deletions(-) diff --git a/src/main/java/burp/ls/CSVSource.java b/src/main/java/burp/ls/CSVSource.java index 3acba62..b397401 100644 --- a/src/main/java/burp/ls/CSVSource.java +++ b/src/main/java/burp/ls/CSVSource.java @@ -20,6 +20,8 @@ public class CSVSource extends FileBasedLogicalSource { public char delimiter = ','; + public char quoteChar = '"'; + public String commentPrefix = null; public boolean firstLineIsHeader = true; @Override @@ -36,12 +38,17 @@ public Iterable iterator() { .withCSVParser( new CSVParserBuilder() .withSeparator(delimiter) + .withQuoteChar(quoteChar) .build() ).build(); List all = csvReader.readAll(); csvReader.close(); + if (commentPrefix != null) { + all.removeIf(rec -> rec.length > 0 && rec[0] != null && rec[0].startsWith(commentPrefix)); + } + if (all.isEmpty()) { return iterations; } diff --git a/src/main/java/burp/ls/CSVSourceProvider.java b/src/main/java/burp/ls/CSVSourceProvider.java index 5e2bc2a..de4b0b5 100644 --- a/src/main/java/burp/ls/CSVSourceProvider.java +++ b/src/main/java/burp/ls/CSVSourceProvider.java @@ -67,14 +67,32 @@ public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWork } if (r.hasProperty(CSVW.delimiter)) { - // TODO: According to CSVW, the delimiter is a string. But all examples are chars. - source.delimiter = r.getProperty(CSVW.delimiter).getChar(); + String delimStr = r.getProperty(CSVW.delimiter).getString(); + if (delimStr.equals("\\t")) { + source.delimiter = '\t'; + } else if (delimStr.equals("\\n")) { + source.delimiter = '\n'; + } else if (delimStr.equals("\\r")) { + source.delimiter = '\r'; + } else if (delimStr.length() == 1) { + source.delimiter = delimStr.charAt(0); + } else { + source.delimiter = r.getProperty(CSVW.delimiter).getChar(); + } } if (r.hasProperty(CSVW.header)) { source.firstLineIsHeader = r.getProperty(CSVW.header).getBoolean(); } + if (r.hasProperty(CSVW.quoteChar)) { + source.quoteChar = r.getProperty(CSVW.quoteChar).getChar(); + } + + if (r.hasProperty(CSVW.commentPrefix)) { + source.commentPrefix = r.getProperty(CSVW.commentPrefix).getString(); + } + if (r.hasProperty(CSVW.NULL) && !ls.hasProperty(RML.NULL)) { r.listProperties(CSVW.NULL).forEachRemaining((Consumer) t -> { if (t.getObject().isResource()) { @@ -92,7 +110,11 @@ public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWork } } - source.encoding = FileBaseSourceProvider.getEncoding(ls); + if (ls.hasProperty(RML.encoding)) { + source.encoding = FileBaseSourceProvider.getEncoding(ls); + } else if (!s.hasProperty(CSVW.dialect) || !s.getPropertyResourceValue(CSVW.dialect).hasProperty(CSVW.encoding)) { + source.encoding = FileBaseSourceProvider.getEncoding(ls); + } source.nulls.addAll(FileBaseSourceProvider.getNullValues(s)); return source; diff --git a/src/main/java/burp/ls/FileBaseSourceProvider.java b/src/main/java/burp/ls/FileBaseSourceProvider.java index 7708716..16cfca2 100644 --- a/src/main/java/burp/ls/FileBaseSourceProvider.java +++ b/src/main/java/burp/ls/FileBaseSourceProvider.java @@ -9,6 +9,7 @@ import org.apache.jena.rdf.model.Statement; import org.apache.jena.vocabulary.DCAT; import org.apache.jena.vocabulary.RDF; +import org.jspecify.annotations.Nullable; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -38,11 +39,11 @@ public static Charset getEncoding(Resource source) { return StandardCharsets.UTF_16; } throw new BurpException( - new RmlError( - "Provided Character Set " + enc + " not supported.", - new Origin(source.getProperty(RML.encoding), StatementPart.Predicate, StatementPart.Object), - RER.Error - ) + new RmlError( + "Provided Character Set " + enc + " not supported.", + new Origin(source.getProperty(RML.encoding), StatementPart.Predicate, StatementPart.Object), + RER.Error + ) ); } @@ -72,7 +73,7 @@ public FileAndOrigin(SourceFile file, List origin) { public static FileAndOrigin getFile(Resource source, Path mappingDir, Path currentWorkingDir) { if (source.hasProperty(RDF.type, RML.RelativePathSource) || source.hasProperty(RDF.type, RML.FilePath)) { - Statement pathStmt = source.getProperty(RML.path); + @Nullable Statement pathStmt = source.getProperty(RML.path); String file; if (pathStmt != null && pathStmt.getObject().isLiteral()) { file = pathStmt.getLiteral().getString(); @@ -113,16 +114,42 @@ public static FileAndOrigin getFile(Resource source, Path mappingDir, Path curre if (source.hasProperty(RDF.type, CSVW.Table)) { String url = source.getProperty(CSVW.url).getLiteral().getString(); - return new FileAndOrigin(new SourceFile.Remote(url), List.of(StatementParts.fromPredicateObject(source.getProperty(CSVW.url)))); + if (isLocalURL(url)) { + Path resolved = resolveLocalPath(url, mappingDir); + return new FileAndOrigin(new SourceFile.Local(resolved.toString()), List.of(StatementParts.fromPredicateObject(source.getProperty(CSVW.url)))); + } else { + return new FileAndOrigin(new SourceFile.Remote(url), List.of(StatementParts.fromPredicateObject(source.getProperty(CSVW.url)))); + } } Resource type = source.getPropertyResourceValue(RDF.type); throw new BurpException( - new RmlError( - "Source type (" + type + ") not yet implemented in source " + source, - new Origin(source.getProperty(RDF.type), StatementPart.Object), - RER.UnsupportedMapping - ) + new RmlError( + "Source type (" + type + ") not yet implemented in source " + source, + new Origin(source.getProperty(RDF.type), StatementPart.Object), + RER.UnsupportedMapping + ) ); } + + private static boolean isLocalURL(String url) { + try { + java.net.URI uri = java.net.URI.create(url); + String scheme = uri.getScheme(); + return scheme == null || scheme.equalsIgnoreCase("file"); + } catch (Exception e) { + return true; + } + } + + private static Path resolveLocalPath(String url, Path mappingDir) { + try { + if (url.startsWith("file:")) { + return Path.of(java.net.URI.create(url)); + } + } catch (Exception e) { + // ignore and fallback + } + return mappingDir.resolve(url); + } } diff --git a/src/main/java/burp/vocabularies/CSVW.java b/src/main/java/burp/vocabularies/CSVW.java index 4282ad5..2e37c66 100644 --- a/src/main/java/burp/vocabularies/CSVW.java +++ b/src/main/java/burp/vocabularies/CSVW.java @@ -16,5 +16,6 @@ public class CSVW { public static final Property header = ResourceFactory.createProperty(NS + "header"); public static final Property NULL = ResourceFactory.createProperty(NS + "null"); public static final Property url = ResourceFactory.createProperty(NS + "url"); - + public static final Property quoteChar = ResourceFactory.createProperty(NS + "quoteChar"); + public static final Property commentPrefix = ResourceFactory.createProperty(NS + "commentPrefix"); } From 5c8544471ec172d1f614064c42201a51b30af210 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 15:19:45 +0200 Subject: [PATCH 28/45] test: use Testcontainers annotations for managing the lifecycle of database containers --- src/test/java/burp/TestRMLIORegistry.java | 53 +++++++++-------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java index b337537..dab5e63 100644 --- a/src/test/java/burp/TestRMLIORegistry.java +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -6,9 +6,9 @@ import org.apache.jena.riot.RDFFormat; import org.apache.jena.update.UpdateAction; import org.apache.jena.update.UpdateFactory; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; import org.testcontainers.containers.JdbcDatabaseContainer; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; import org.testcontainers.mssqlserver.MSSQLServerContainer; import org.testcontainers.mysql.MySQLContainer; import org.testcontainers.postgresql.PostgreSQLContainer; @@ -18,10 +18,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Stream; - +@Testcontainers public class TestRMLIORegistry extends TestRMLModule { public static String base = "./target/test-classes/rml-io-registry/"; @@ -46,19 +44,16 @@ public void prepareSource(TestData testData) throws Exception { switch (jdbcDriver) { case "com.mysql.cj.jdbc.Driver": - MYSQL_CONTAINER_FUTURE.join(); queryString = "?allowMultiQueries=true"; MYSQL_CONTAINER.addParameter("allowMultiQueries", "true"); db = MYSQL_CONTAINER; break; case "org.postgresql.Driver": - PGSQL_CONTAINER_FUTURE.join(); db = PGSQL_CONTAINER; break; case "com.microsoft.sqlserver.jdbc.SQLServerDriver": - MSSQL_CONTAINER_FUTURE.join(); MSSQL_CONTAINER.withUrlParam("databaseName", "master"); try (var conn = MSSQL_CONTAINER.createConnection("")) { try (var stmt = conn.createStatement()) { @@ -78,10 +73,10 @@ public void prepareSource(TestData testData) throws Exception { System.out.printf("Updating database connection in mapping with JDBC URL=%s Username=%s Password=%s%n", db.getJdbcUrl(), db.getUsername(), db.getPassword()); String sparql = String.format( """ - PREFIX d2rq: - DELETE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass } - INSERT { ?s d2rq:jdbcDSN "%s"; d2rq:username "%s"; d2rq:password "%s" } - WHERE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass }""", + PREFIX d2rq: + DELETE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass } + INSERT { ?s d2rq:jdbcDSN "%s"; d2rq:username "%s"; d2rq:password "%s" } + WHERE { ?s d2rq:jdbcDSN ?oldDSN; d2rq:username ?oldUser; d2rq:password ?oldPass }""", db.getJdbcUrl(), db.getUsername(), db.getPassword() ); var updateRequest = UpdateFactory.create(sparql); @@ -111,31 +106,23 @@ public void prepareSource(TestData testData) throws Exception { } } + @Container public static PostgreSQLContainer PGSQL_CONTAINER = new PostgreSQLContainer("postgres:latest") .withUsername("postgres") - .withPassword("test"); - private static CompletableFuture PGSQL_CONTAINER_FUTURE = null; + .withPassword("test") + .withReuse(true); + @Container public static MySQLContainer MYSQL_CONTAINER = new MySQLContainer("mysql:8") .withEnv("MYSQL_ROOT_HOST", "%") - .withCommand("mysqld", "--sql_mode=ANSI_QUOTES"); - private static CompletableFuture MYSQL_CONTAINER_FUTURE = null; - - public static MSSQLServerContainer MSSQL_CONTAINER = new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2022-CU20-ubuntu-22.04") - .acceptLicense(); - private static CompletableFuture MSSQL_CONTAINER_FUTURE = null; - - @BeforeAll - public static void startContainers() { - PGSQL_CONTAINER_FUTURE = CompletableFuture.runAsync(PGSQL_CONTAINER::start); - MYSQL_CONTAINER_FUTURE = CompletableFuture.runAsync(MYSQL_CONTAINER::start); - MSSQL_CONTAINER_FUTURE = CompletableFuture.runAsync(MSSQL_CONTAINER::start); - } + .withCommand("mysqld", "--sql_mode=ANSI_QUOTES") + .withReuse(true); + + + @Container + public static MSSQLServerContainer MSSQL_CONTAINER = + new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2022-CU20-ubuntu-22.04") + .acceptLicense() + .withReuse(true); - @AfterAll - public static void stopContainers() { - Stream.of(PGSQL_CONTAINER, MYSQL_CONTAINER, MSSQL_CONTAINER) - .parallel() - .forEach(JdbcDatabaseContainer::stop); - } } From 6fdfa0e007716de0de25e36f3b7896b2e59d2512 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 14 Jul 2026 15:42:15 +0200 Subject: [PATCH 29/45] feat: add trim option for CSVW --- src/main/java/burp/ls/CSVSource.java | 15 +++++++++ src/main/java/burp/ls/CSVSourceProvider.java | 34 +++++++++++++------- src/main/java/burp/vocabularies/CSVW.java | 1 + 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/main/java/burp/ls/CSVSource.java b/src/main/java/burp/ls/CSVSource.java index b397401..1200167 100644 --- a/src/main/java/burp/ls/CSVSource.java +++ b/src/main/java/burp/ls/CSVSource.java @@ -22,6 +22,7 @@ public class CSVSource extends FileBasedLogicalSource { public char delimiter = ','; public char quoteChar = '"'; public String commentPrefix = null; + public boolean trim = false; public boolean firstLineIsHeader = true; @Override @@ -58,6 +59,13 @@ public Iterable iterator() { String[] header; if (firstLineIsHeader) { header = all.removeFirst(); + if (trim) { + for (int i = 0; i < header.length; i++) { + if (header[i] != null) { + header[i] = header[i].trim(); + } + } + } } else { int columnCount = all.getFirst().length; header = new String[columnCount]; @@ -67,6 +75,13 @@ public Iterable iterator() { } for (String[] rec : all) { + if (trim) { + for (int i = 0; i < rec.length; i++) { + if (rec[i] != null) { + rec[i] = rec[i].trim(); + } + } + } iterations.add(new CSVIteration(header, rec, nulls)); } } diff --git a/src/main/java/burp/ls/CSVSourceProvider.java b/src/main/java/burp/ls/CSVSourceProvider.java index de4b0b5..f5fefb1 100644 --- a/src/main/java/burp/ls/CSVSourceProvider.java +++ b/src/main/java/burp/ls/CSVSourceProvider.java @@ -21,7 +21,7 @@ import java.nio.file.Path; import java.util.Collections; import java.util.List; -import java.util.function.Consumer; +import java.util.Set; import java.util.stream.Collectors; @SuppressWarnings("unused") @@ -93,17 +93,12 @@ public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWork source.commentPrefix = r.getProperty(CSVW.commentPrefix).getString(); } - if (r.hasProperty(CSVW.NULL) && !ls.hasProperty(RML.NULL)) { - r.listProperties(CSVW.NULL).forEachRemaining((Consumer) t -> { - if (t.getObject().isResource()) { - // WE ASSUME WE CAN HAVE RESOURCES AS NULL FOR - // SPARQL SOURCES - source.nulls.add(t.getObject().asResource()); - } else { - source.nulls.add(t.getObject().asLiteral().getValue()); - } - }); + if (r.hasProperty(CSVW.trim)) { + source.trim = r.getProperty(CSVW.trim).getBoolean(); } + source.nulls.addAll(getNulls(ls, s)); + source.nulls.addAll(getNulls(ls, r)); + // TODO: Natural RDF mapping of CSV values } else { source.encoding = StandardCharsets.UTF_8; @@ -120,6 +115,21 @@ public LogicalSource create(Resource ls, Path mappingDirectory, Path currentWork return source; } + private Set getNulls(Resource ls, Resource resource) { + if (resource.hasProperty(CSVW.NULL) && !ls.hasProperty(RML.NULL)) { + return resource.listProperties(CSVW.NULL).mapWith(t -> { + if (t.getObject().isResource()) { + // WE ASSUME WE CAN HAVE RESOURCES AS NULL FOR + // SPARQL SOURCES + return (t.getObject().asResource()); + } else { + return (t.getObject().asLiteral().getValue()); + } + }).toSet(); + } + return Collections.emptySet(); + } + @Override public List parseStringPayload(String payload, String iterator, Origin referenceFormulationOrigin) { try { @@ -127,7 +137,7 @@ public List parseStringPayload(String payload, String iterator, Origi List all = reader.readAll(); reader.close(); if (all.isEmpty()) return Collections.emptyList(); - String[] header = all.remove(0); + String[] header = all.removeFirst(); return all.stream() .map(it -> (Iteration) new CSVIteration(header, it, Collections.emptySet())) .collect(Collectors.toList()); diff --git a/src/main/java/burp/vocabularies/CSVW.java b/src/main/java/burp/vocabularies/CSVW.java index 2e37c66..e2e822d 100644 --- a/src/main/java/burp/vocabularies/CSVW.java +++ b/src/main/java/burp/vocabularies/CSVW.java @@ -18,4 +18,5 @@ public class CSVW { public static final Property url = ResourceFactory.createProperty(NS + "url"); public static final Property quoteChar = ResourceFactory.createProperty(NS + "quoteChar"); public static final Property commentPrefix = ResourceFactory.createProperty(NS + "commentPrefix"); + public static final Property trim = ResourceFactory.createProperty(NS + "trim"); } From 2ae34679517225a6490601c3956f9dd4cb284942 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 15 Jul 2026 16:36:17 +0200 Subject: [PATCH 30/45] Add tests from issues #20 and #21 --- src/test/resources/burp/ELSDVLEE-20/mapping.ttl | 2 +- src/test/resources/burp/ELSDVLEE-20/output.nt | 14 ++++++++++++++ src/test/resources/burp/ELSDVLEE-21/mapping.ttl | 12 ++++++------ src/test/resources/burp/ELSDVLEE-21/output.nt | 15 +++++++++++++++ src/test/resources/burp/metadata.csv | 4 ++-- 5 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 src/test/resources/burp/ELSDVLEE-20/output.nt create mode 100644 src/test/resources/burp/ELSDVLEE-21/output.nt diff --git a/src/test/resources/burp/ELSDVLEE-20/mapping.ttl b/src/test/resources/burp/ELSDVLEE-20/mapping.ttl index 4428b84..f8a9a71 100644 --- a/src/test/resources/burp/ELSDVLEE-20/mapping.ttl +++ b/src/test/resources/burp/ELSDVLEE-20/mapping.ttl @@ -54,7 +54,7 @@ rml:fieldName "birthyear" ; rml:reference "birthyear" ; ] ; - rml:innerJoin [ + rml:leftJoin [ rml:parentLogicalView :jsonView ; rml:joinCondition [ rml:parent "name" ; diff --git a/src/test/resources/burp/ELSDVLEE-20/output.nt b/src/test/resources/burp/ELSDVLEE-20/output.nt new file mode 100644 index 0000000..62c8015 --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-20/output.nt @@ -0,0 +1,14 @@ + "alice" . + . + "1995"^^ . + "sword" . + "shield" . + "flower" . + + "bob" . + . + "1999"^^ . + + "tobias" . + . + "2005"^^ . diff --git a/src/test/resources/burp/ELSDVLEE-21/mapping.ttl b/src/test/resources/burp/ELSDVLEE-21/mapping.ttl index aa14203..06eee4f 100644 --- a/src/test/resources/burp/ELSDVLEE-21/mapping.ttl +++ b/src/test/resources/burp/ELSDVLEE-21/mapping.ttl @@ -5,25 +5,25 @@ <#AuthorMapping> rml:logicalSource <#AuthorsSource> ; rml:subjectMap [ - rml:template "http://example.com/author/{id}" + rml:template "http://example.com/author/{$.id}" ] ; rml:predicateObjectMap [ rml:predicate foaf:name ; rml:objectMap [ - rml:reference "name" + rml:reference "$.name" ] ] . <#BookMapping> rml:logicalSource <#BooksSource> ; rml:subjectMap [ - rml:template "http://example.com/book/{id}" + rml:template "http://example.com/book/{$.id}" ] ; rml:predicateObjectMap [ rml:predicate dbo:title ; rml:objectMap [ - rml:reference "title" + rml:reference "$.title" ] ], [ @@ -31,8 +31,8 @@ rml:objectMap [ rml:parentTriplesMap <#AuthorMapping> ; rml:joinCondition [ - rml:child "author_id" ; - rml:parent "id" + rml:child "$.author_id" ; + rml:parent "$.id" ] ] ] . diff --git a/src/test/resources/burp/ELSDVLEE-21/output.nt b/src/test/resources/burp/ELSDVLEE-21/output.nt new file mode 100644 index 0000000..e9d6736 --- /dev/null +++ b/src/test/resources/burp/ELSDVLEE-21/output.nt @@ -0,0 +1,15 @@ + "Alice" . + "Charlie" . + "Bob" . + + . + "RDF Fundamentals" . + + "Knowledge Graphs Guide" . + . + + "Semantic Web Handbook" . + . + + "Data Mapping Patterns" . + . diff --git a/src/test/resources/burp/metadata.csv b/src/test/resources/burp/metadata.csv index 3f6f697..04d2caf 100644 --- a/src/test/resources/burp/metadata.csv +++ b/src/test/resources/burp/metadata.csv @@ -8,5 +8,5 @@ BURPFNMLTC-CSV-toSafeURI,toSafeURI,Tests toSafeURI function,fnml,mapping.ttl,tex BURPIOTC-CSV-BOM,csv_bom,Tests CSV BOM parsing,rml-core,mapping.ttl,text/csv,application/n-quads,country_info.csv,output.nq,false BURPIOTC-SQLITE,sqlite,Tests SQLite DB reading,rml-io,mapping.ttl,application/sql,application/n-quads,student.db,output.nq,false BURPIOTC-BSON,bson,Tests BSON reading,rml-io,mapping.ttl,application/bson,application/n-quads,student.bson,output.nq,false -ELSDVLEE-20,RML-LV left join causes error,,rml-lv,mapping.ttl,,,"",,false -ELSDVLEE-21,explicit rml:TriplesMap statement needed to use TriplesMap as ParentTriplesMap,,rml-lv,mapping.ttl,,,,,false \ No newline at end of file +ELSDVLEE-20,RML-LV left join causes error,,rml-lv,mapping.ttl,,,"",output.nt,false +ELSDVLEE-21,explicit rml:TriplesMap statement needed to use TriplesMap as ParentTriplesMap,,rml-lv,mapping.ttl,,,,output.nt,false \ No newline at end of file From 0fa31445feb57dfe2d0abe5deaf6bb87ea49609b Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 16 Jul 2026 14:04:47 +0200 Subject: [PATCH 31/45] fix: turtleprov parser escaping RDFLiteral and base IRI resolving and escape iri and escape local name --- .../antlr4/burp/parse/turtleprov/Turtle.g4 | 3 +- src/main/java/burp/parse/Parse.java | 53 +++++- .../java/burp/parse/turtleprov/ProvStore.java | 24 +-- .../parse/turtleprov/ProvTurtleVisitor.java | 180 ++++++++++++++---- .../parse/turtleprov/TurtleProvParser.java | 3 +- .../java/turtleprov/AbstractManifestTest.java | 15 +- .../java/turtleprov/TurtleParserTest.java | 120 ++++++------ 7 files changed, 266 insertions(+), 132 deletions(-) diff --git a/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 b/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 index 624fe9a..b2090bb 100644 --- a/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 +++ b/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 @@ -294,7 +294,7 @@ STRING_LITERAL_LONG_SINGLE_QUOTE // [47] STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? ([^"\] | ECHAR | UCHAR))* '"""' STRING_LITERAL_LONG_QUOTE - : '"""' (('\'' | '\'\'')? ((~ ['\\]) | ECHAR | UCHAR))* '"""' + : '"""' (('"' | '""')? ((~ ["\\]) | ECHAR | UCHAR))* '"""' ; // [44] STRING_LITERAL_QUOTE ::= '"' ([^#x22#x5C#x0A#x0D] | ECHAR | UCHAR)* '"' @@ -345,6 +345,7 @@ PN_CHARS_BASE | '\u3001' .. '\uD7FF' | '\uF900' .. '\uFDCF' | '\uFDF0' .. '\uFFFD' + | '\u{10000}' .. '\u{EFFFF}' ; // [53] PN_CHARS_U ::= PN_CHARS_BASE | '_' diff --git a/src/main/java/burp/parse/Parse.java b/src/main/java/burp/parse/Parse.java index 7809933..e572add 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -18,11 +18,16 @@ import burp.vocabularies.RER; import burp.vocabularies.RML; import org.apache.jena.graph.Node; +import org.apache.jena.langtagx.LangTagX; +import org.apache.jena.ontapi.OntModelFactory; +import org.apache.jena.ontapi.model.OntModel; import org.apache.jena.query.Dataset; import org.apache.jena.query.DatasetFactory; import org.apache.jena.query.ParameterizedSparqlString; import org.apache.jena.query.QueryParseException; import org.apache.jena.rdf.model.*; +import org.apache.jena.reasoner.Reasoner; +import org.apache.jena.reasoner.ReasonerRegistry; import org.apache.jena.riot.Lang; import org.apache.jena.riot.RDFDataMgr; import org.apache.jena.shacl.ShaclValidator; @@ -41,6 +46,17 @@ public class Parse { + private static final OntModel RML_CORE_ONTOLOGY = loadRmlCoreOntology(); + + private static OntModel loadRmlCoreOntology() { + OntModel schema = OntModelFactory.createModel(); + var stream = Parse.class.getResourceAsStream("/vocabularies/rml/rml-core.owl"); + if (stream != null) { + schema.read(stream, "urn:dummy", FileUtils.langTurtle); + } + return schema; + } + public final Map triplesMaps = new HashMap<>(); public final Map logicalViews = new HashMap<>(); public final Map logicalTargets = new HashMap<>(); @@ -55,9 +71,9 @@ private Dataset parseTurtleFromFile(Path turtleFile) throws Exception { provStore = TurtleProvParser.parseTurtleFromPath(turtleFile); if (!provStore.getSyntaxErrors().isEmpty()) { var rmlSyntaxError = provStore.getSyntaxErrors().stream().map(error -> { - TextFilePointer tfp = new TextFilePointer(turtleFile, error.range); + TextFilePointer tfp = new TextFilePointer(turtleFile, error.range()); Origin origin = new Origin(null, List.of(tfp)); - return new RmlError(error.message, origin, RER.RDFMappingSyntaxError); + return new RmlError(error.message(), origin, RER.RDFMappingSyntaxError); }).toList(); if (Main.report != null) { Main.report.getErrors().addAll(rmlSyntaxError); @@ -146,13 +162,16 @@ public List parseMappingFile(Path mappingPath, Path currentDirectory } private boolean isValid(Model mapping) { - Model core = ModelFactory.createDefaultModel(); - core.read(Parse.class.getResourceAsStream("/shapes/core.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/cc.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/lv.ttl"), "urn:dummy", FileUtils.langTurtle); - core.read(Parse.class.getResourceAsStream("/shapes/io.ttl"), "urn:dummy", FileUtils.langTurtle); + Model shapesModel = ModelFactory.createDefaultModel(); + shapesModel.read(Parse.class.getResourceAsStream("/shapes/core.ttl"), "urn:dummy", FileUtils.langTurtle); + shapesModel.read(Parse.class.getResourceAsStream("/shapes/cc.ttl"), "urn:dummy", FileUtils.langTurtle); + shapesModel.read(Parse.class.getResourceAsStream("/shapes/lv.ttl"), "urn:dummy", FileUtils.langTurtle); + shapesModel.read(Parse.class.getResourceAsStream("/shapes/io.ttl"), "urn:dummy", FileUtils.langTurtle); + + Reasoner reasoner = ReasonerRegistry.getRDFSReasoner().bindSchema(RML_CORE_ONTOLOGY); + InfModel infModel = ModelFactory.createInfModel(reasoner, mapping); - ValidationReport report = ShaclValidator.get().validate(core.getGraph(), mapping.getGraph()); + ValidationReport report = ShaclValidator.get().validate(shapesModel.getGraph(), infModel.getGraph()); if (!report.conforms()) { report.getEntries().forEach(vr -> { List focusOrigins = extractStatementsFromShaclViolation(vr, mapping); @@ -472,7 +491,23 @@ private DatatypeMap prepareDatatypeMap(Resource dtm) { } private LanguageMap prepareLanguageMap(Resource lam) { - return prepareExpression(lam, new LanguageMap()); + LanguageMap lm = prepareExpression(lam, new LanguageMap()); + if (lm.getExpression() instanceof RDFNodeConstant constant) { + String value = (constant.constant instanceof LiteralTerm literalTerm) + ? literalTerm.value() + : constant.constant.toString(); + if (!LangTagX.checkLanguageTag(value)) { + throw new BurpException( + new RmlError( + "Invalid static language code: " + value, + lm.getExpressionOrigin(), + RER.MappingError + //TODO Should probably be a InvalidLanguageTag error but it is an ExecutionError which says that it is due to data but herer it is constant so due to mapping. + ) + ); + } + } + return lm; } private Field prepareField(Resource p) { diff --git a/src/main/java/burp/parse/turtleprov/ProvStore.java b/src/main/java/burp/parse/turtleprov/ProvStore.java index a14a888..c27b9ae 100644 --- a/src/main/java/burp/parse/turtleprov/ProvStore.java +++ b/src/main/java/burp/parse/turtleprov/ProvStore.java @@ -2,6 +2,7 @@ import burp.reporting.PointRange; import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.NonNull; import java.util.*; @@ -23,27 +24,20 @@ public List getSyntaxErrors() { return syntaxErrors; } - public static class SyntaxError { - public final int line; - public final int charPositionInLine; - public final String message; - public final String offendingSymbol; - public final PointRange range; - - public SyntaxError(int line, int charPositionInLine, String message, String offendingSymbol, PointRange range) { - this.line = line; - this.charPositionInLine = charPositionInLine; - this.message = message; - this.offendingSymbol = offendingSymbol; - this.range = range; - } + public record SyntaxError( + int line, + int charPositionInLine, + String message, + String offendingSymbol, + PointRange range + ) { public SyntaxError(int line, int charPositionInLine, String message, String offendingSymbol) { this(line, charPositionInLine, message, offendingSymbol, null); } @Override - public String toString() { + public @NonNull String toString() { return "line " + line + ":" + charPositionInLine + " " + message; } } diff --git a/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java index 5eb01fc..aa7d96d 100644 --- a/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java +++ b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java @@ -7,6 +7,8 @@ import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.TerminalNode; +import org.apache.jena.datatypes.xsd.XSDDatatype; +import org.apache.jena.irix.IRIx; import org.apache.jena.rdf.model.*; import org.apache.jena.vocabulary.RDF; @@ -57,11 +59,13 @@ public static List retrieveTurtleLocation(Object o) { } return locations; } + private final ProvStore store = new ProvStore(); public ProvStore getStore() { return store; } + private final Model model = ModelFactory.createDefaultModel(); private final Map blankNodeMap = new HashMap<>(); @@ -75,6 +79,15 @@ private Resource createBlankNode(String id) { private static final Pattern prefixedNamePattern = Pattern.compile("^(.*?):(.*)$"); private static final Pattern blankNodeLabelPattern = Pattern.compile("^_:(.+)$"); + private String baseURI = null; + + private String resolveRelativeIRI(String base, String rel) { + try { + return IRIx.create(base).resolve(rel).toString(); + } catch (Exception e) { + return rel; + } + } private Point getStartPoint(Token token) { if (token == null) return null; @@ -141,6 +154,10 @@ public Object makeRegisterPrefix(TerminalNode prefix, TerminalNode iriRef, boole String prefixNs = prefixText.substring(0, prefixText.length() - 1); String iriText = iriRef.getText(); String iri = iriText.substring(1, iriText.length() - 1); + iri = unescapeIri(iri); + if (baseURI != null) { + iri = resolveRelativeIRI(baseURI, iri); + } store.getPrefixes().put(prefixNs, iri); return null; } @@ -157,11 +174,27 @@ public Object visitSparqlPrefix(TurtleParser.SparqlPrefixContext ctx) { @Override public Object visitBase(TurtleParser.BaseContext ctx) { + String baseText = ctx.IRIREF().getText(); + String base = baseText.substring(1, baseText.length() - 1); + base = unescapeIri(base); + if (baseURI != null) { + this.baseURI = resolveRelativeIRI(baseURI, base); + } else { + this.baseURI = base; + } return null; } @Override public Object visitSparqlBase(TurtleParser.SparqlBaseContext ctx) { + String baseText = ctx.IRIREF().getText(); + String base = baseText.substring(1, baseText.length() - 1); + base = unescapeIri(base); + if (baseURI != null) { + this.baseURI = resolveRelativeIRI(baseURI, base); + } else { + this.baseURI = base; + } return null; } @@ -192,6 +225,61 @@ public Object visitSubject(TurtleParser.SubjectContext ctx) { throw new TurtleProvException("Unknown subject type", getRange(ctx)); } + public static String unescapeLocalName(String s) { + if (s == null) return null; + return s.replaceAll("\\\\(.)", "$1"); + } + + private static final Pattern ESCAPE_PATTERN = Pattern.compile("\\\\(u([0-9a-fA-F]{0,4})|U([0-9a-fA-F]{0,8})|.?)"); + + private static String unescape(String s, boolean isIri) { + if (s == null) return null; + Matcher m = ESCAPE_PATTERN.matcher(s); + StringBuilder sb = new StringBuilder(s.length()); + while (m.find()) { + String esc = m.group(1); + if (esc == null || esc.isEmpty()) { + throw new IllegalArgumentException(isIri ? "Trailing backslash in IRI" : "Trailing backslash in string"); + } + char first = esc.charAt(0); + if (first == 'u') { + if (esc.length() < 5) { + throw new IllegalArgumentException("Incomplete \\u unicode escape"); + } + int cp = Integer.parseInt(esc.substring(1), 16); + m.appendReplacement(sb, Matcher.quoteReplacement(String.valueOf((char) cp))); + } else if (first == 'U') { + if (esc.length() < 9) { + throw new IllegalArgumentException("Incomplete \\U unicode escape"); + } + int cp = Integer.parseInt(esc.substring(1), 16); + m.appendReplacement(sb, Matcher.quoteReplacement(new String(Character.toChars(cp)))); + } else { + if (isIri) { + throw new IllegalArgumentException("Invalid escape in IRI: \\" + first); + } + char replacement = switch (first) { + case 't' -> '\t'; + case 'b' -> '\b'; + case 'n' -> '\n'; + case 'r' -> '\r'; + case 'f' -> '\f'; + case '"' -> '"'; + case '\'' -> '\''; + case '\\' -> '\\'; + default -> throw new IllegalArgumentException("Invalid escape sequence: \\" + first); + }; + m.appendReplacement(sb, Matcher.quoteReplacement(String.valueOf(replacement))); + } + } + m.appendTail(sb); + return sb.toString(); + } + + public static String unescapeIri(String s) { + return unescape(s, true); + } + @Override public Object visitIri(TurtleParser.IriContext ctx) { TerminalNode irirefCtx = ctx.IRIREF(); @@ -201,12 +289,16 @@ public Object visitIri(TurtleParser.IriContext ctx) { Token token = irirefCtx.getSymbol(); String iriText = token.getText(); String iri = iriText.substring(1, iriText.length() - 1); + iri = unescapeIri(iri); + if (baseURI != null) { + iri = resolveRelativeIRI(baseURI, iri); + } Resource resource = ResourceFactory.createResource(iri); NodeInfo nodeInfo = new NodeInfo( - TurtleNodeKind.IRIREF, - getStartPoint(token), - getEndPoint(token), - null + TurtleNodeKind.IRIREF, + getStartPoint(token), + getEndPoint(token), + null ); return new Pair<>(resource, nodeInfo); } else if (prefixedNameCtx != null) { @@ -217,6 +309,7 @@ public Object visitIri(TurtleParser.IriContext ctx) { if (match.matches()) { String prefix = match.group(1) != null ? match.group(1) : ""; String localName = match.group(2); + localName = unescapeLocalName(localName); String namespace = store.getPrefixes().get(prefix); if (namespace == null) throw new TurtleProvException("Unknown prefix: " + prefix, getRange(token)); Resource resource = ResourceFactory.createResource(namespace + localName); @@ -240,8 +333,8 @@ private Pair visitBlankNodeTerminal(TerminalNode terminalNod String label = matcher.group(1); Resource resource = blankNodeMap.computeIfAbsent(label, this::createBlankNode); NodeInfo nodeInfo = new NodeInfo( - TurtleNodeKind.BLANK_NODE_LABEL, - getStartPoint(token), getEndPoint(token), label + TurtleNodeKind.BLANK_NODE_LABEL, + getStartPoint(token), getEndPoint(token), label ); return new Pair<>(resource, nodeInfo); } else { @@ -250,8 +343,8 @@ private Pair visitBlankNodeTerminal(TerminalNode terminalNod } else if (text.startsWith("[") && text.endsWith("]")) { Resource resource = createBlankNode(); NodeInfo nodeInfo = new NodeInfo( - TurtleNodeKind.ANONYMOUS_BLANK_NODE, - getStartPoint(token), getEndPoint(token), null + TurtleNodeKind.ANONYMOUS_BLANK_NODE, + getStartPoint(token), getEndPoint(token), null ); return new Pair<>(resource, nodeInfo); } else { @@ -271,7 +364,6 @@ public Resource assembleList(List list) { Resource node = blankNodes.get(i); RDFNode value = list.get(i); store.getTriples().add(new ProvTriple(model.createStatement(node, RDF.first, value))); - store.getTriples().add(new ProvTriple(model.createStatement(node, RDF.type, RDF.List))); } for (int i = 0; i < blankNodes.size() - 1; i++) { Resource current = blankNodes.get(i); @@ -293,8 +385,8 @@ public Object visitCollection(TurtleParser.CollectionContext ctx) { } Resource collectionStart = assembleList(items); NodeInfo nodeInfo = new NodeInfo( - TurtleNodeKind.COLLECTION, - getStartPoint(ctx.start), getEndPoint(ctx.stop), null + TurtleNodeKind.COLLECTION, + getStartPoint(ctx.start), getEndPoint(ctx.stop), null ); return new Pair<>(collectionStart, nodeInfo); @@ -304,8 +396,8 @@ public Object visitCollection(TurtleParser.CollectionContext ctx) { public Object visitBlankNodePropertyList(TurtleParser.BlankNodePropertyListContext ctx) { Resource resource = createBlankNode(); NodeInfo nodeInfo = new NodeInfo( - TurtleNodeKind.BLANK_NODE_PROPERTY_LIST, - getStartPoint(ctx.start), getEndPoint(ctx.stop), null + TurtleNodeKind.BLANK_NODE_PROPERTY_LIST, + getStartPoint(ctx.start), getEndPoint(ctx.stop), null ); Pair subject = new Pair<>(resource, nodeInfo); @@ -318,8 +410,8 @@ public Object visitBlankNodePropertyList(TurtleParser.BlankNodePropertyListConte @SuppressWarnings("unchecked") private void visitPredicateObjectList( - TurtleParser.PredicateObjectListContext ctx, - Pair subject + TurtleParser.PredicateObjectListContext ctx, + Pair subject ) { List verbs = ctx.verb(); List objectLists = ctx.objectList(); @@ -344,8 +436,8 @@ public Object visitVerb(TurtleParser.VerbContext ctx) { return new Pair<>(property, iriPair.second()); } else if ("a".equals(ctx.getText())) { NodeInfo nodeInfo = new NodeInfo( - TurtleNodeKind.TYPE_VERB, - getStartPoint(ctx.start), getEndPoint(ctx.stop), null + TurtleNodeKind.TYPE_VERB, + getStartPoint(ctx.start), getEndPoint(ctx.stop), null ); return new Pair<>(RDF.type, nodeInfo); } else { @@ -370,8 +462,10 @@ public Object visitObject_(TurtleParser.Object_Context ctx) { if (ctx.collection() != null) return visitCollection(ctx.collection()); if (ctx.blankNodePropertyList() != null) return visitBlankNodePropertyList(ctx.blankNodePropertyList()); if (ctx.literal() != null) return visitLiteral(ctx.literal()); - if (ctx.tripleTerm() != null) throw new TurtleProvException("RDF-star / RDF 1.2 triple terms are not supported", getRange(ctx)); - if (ctx.reifiedTriple() != null) throw new TurtleProvException("RDF-star / RDF 1.2 reified triples are not supported", getRange(ctx)); + if (ctx.tripleTerm() != null) + throw new TurtleProvException("RDF-star / RDF 1.2 triple terms are not supported", getRange(ctx)); + if (ctx.reifiedTriple() != null) + throw new TurtleProvException("RDF-star / RDF 1.2 reified triples are not supported", getRange(ctx)); throw new TurtleProvException("Unknown object type: " + ctx.getText(), getRange(ctx)); } @@ -407,7 +501,7 @@ public Object visitRdfLiteral(TurtleParser.RdfLiteralContext ctx) { TurtleNodeKind kind; TerminalNode firstChild = (TerminalNode) ctx.string().getChild(0); int symbolType = firstChild.getSymbol().getType(); - + if (symbolType == TurtleParser.STRING_LITERAL_QUOTE) { kind = TurtleNodeKind.STRING_LITERAL_QUOTE; } else if (symbolType == TurtleParser.STRING_LITERAL_SINGLE_QUOTE) { @@ -422,7 +516,7 @@ public Object visitRdfLiteral(TurtleParser.RdfLiteralContext ctx) { Point startPoint = getStartPoint(ctx.start); Point endPoint = getEndPoint(ctx.stop); - + Point rdfStart = null; if (ctx.string().start != null) { rdfStart = getStartPoint(ctx.string().start).plus(new Point(0, quoteSize)); @@ -436,30 +530,35 @@ public Object visitRdfLiteral(TurtleParser.RdfLiteralContext ctx) { } NodeInfo nodeInfo = new NodeInfo( - kind, - startPoint, - endPoint, - rdfStart, - rdfEnd, - null + kind, + startPoint, + endPoint, + rdfStart, + rdfEnd, + null ); return new Pair<>(literal, nodeInfo); } + public static String unescapeRdfLiteralString(String s) { + return unescape(s, false); + } + @Override public Object visitString(TurtleParser.StringContext ctx) { String text = ctx.getText(); - if (text.startsWith("\"\"\"") && text.endsWith("\"\"\"")) { - return new Pair<>(text.substring(3, text.length() - 3), 3); - } else if (text.startsWith("'''") && text.endsWith("'''")) { - return new Pair<>(text.substring(3, text.length() - 3), 3); - } else if (text.startsWith("\"") && text.endsWith("\"")) { - return new Pair<>(text.substring(1, text.length() - 1), 1); - } else if (text.startsWith("'") && text.endsWith("'")) { - return new Pair<>(text.substring(1, text.length() - 1), 1); + String content; + int delimiterLength; + if (ctx.STRING_LITERAL_LONG_QUOTE() != null || ctx.STRING_LITERAL_LONG_SINGLE_QUOTE() != null) { + content = text.substring(3, text.length() - 3); + delimiterLength = 3; } else { - return new Pair<>(text, 0); + assert ctx.STRING_LITERAL_QUOTE() != null || ctx.STRING_LITERAL_SINGLE_QUOTE() != null; + content = text.substring(1, text.length() - 1); + delimiterLength = 1; } + content = unescapeRdfLiteralString(content); + return new Pair<>(content, delimiterLength); } private Pair visitNumericLiteral(TerminalNode terminalNode) { @@ -470,13 +569,13 @@ private Pair visitNumericLiteral(TerminalNode terminalNode) { TurtleNodeKind kind; if (text.contains("e") || text.contains("E")) { - literal = model.createTypedLiteral(Double.parseDouble(text)); + literal = model.createTypedLiteral(text, XSDDatatype.XSDdouble); kind = TurtleNodeKind.DOUBLE_LITERAL; } else if (text.contains(".")) { - literal = model.createTypedLiteral(Double.parseDouble(text)); // TODO add decimal + literal = model.createTypedLiteral(text, XSDDatatype.XSDdecimal); kind = TurtleNodeKind.DECIMAL_LITERAL; } else { - literal = model.createTypedLiteral(Integer.parseInt(text)); + literal = model.createTypedLiteral(text, XSDDatatype.XSDinteger); kind = TurtleNodeKind.INTEGER_LITERAL; } @@ -491,5 +590,6 @@ private Pair visitBooleanLiteral(TerminalNode terminalNode) { return new Pair<>(literal, nodeInfo); } - public record Pair(A first, B second) {} + public record Pair(A first, B second) { + } } diff --git a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java index ec1c734..06f33d2 100644 --- a/src/main/java/burp/parse/turtleprov/TurtleProvParser.java +++ b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java @@ -2,6 +2,7 @@ import burp.reporting.PointRange; import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.Interval; import java.io.IOException; import java.io.InputStream; @@ -30,7 +31,7 @@ private static ProvStore parse(CharStream input) { TurtleLexer lexer = new TurtleLexer(input); List syntaxErrors = new ArrayList<>(); - final String fullText = input.size() > 0 ? input.getText(org.antlr.v4.runtime.misc.Interval.of(0, input.size() - 1)) : ""; + final String fullText = input.size() > 0 ? input.getText(Interval.of(0, input.size() - 1)) : ""; BaseErrorListener errorListener = new BaseErrorListener() { @Override diff --git a/src/test/java/turtleprov/AbstractManifestTest.java b/src/test/java/turtleprov/AbstractManifestTest.java index 3a104b9..5d24aa9 100644 --- a/src/test/java/turtleprov/AbstractManifestTest.java +++ b/src/test/java/turtleprov/AbstractManifestTest.java @@ -28,6 +28,9 @@ import java.util.*; import java.util.stream.Stream; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + @TestInstance(TestInstance.Lifecycle.PER_CLASS) public abstract class AbstractManifestTest { @@ -166,22 +169,22 @@ public Stream negativeEvalTests() { @ParameterizedTest(name = "{0}") @MethodSource("positiveSyntaxTests") public void testPositiveSyntax(TestInfo info) throws Exception { - if (!"dummy".equals(info.name)) return; + if ("dummy".equals(info.name)) return; TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); } @ParameterizedTest(name = "{0}") @MethodSource("negativeSyntaxTests") public void testNegativeSyntax(TestInfo info) throws Exception { - if (!"dummy".equals(info.name)) return; + if ("dummy".equals(info.name)) return; ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); - Assertions.assertFalse(store.getSyntaxErrors().isEmpty(), "Expected syntax errors but none were found"); + assertFalse(store.getSyntaxErrors().isEmpty(), "Expected syntax errors but none were found"); } @ParameterizedTest(name = "{0}") @MethodSource("evalTests") public void testEvaluation(TestInfo info) throws Exception { - if (!"dummy".equals(info.name)) return; + if ("dummy".equals(info.name)) return; ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); Model actionModel = RDF12Converter.toModel(store, false); Model expectedModel = RDFDataMgr.loadModel(info.resultFile.toString()); @@ -193,10 +196,10 @@ public void testEvaluation(TestInfo info) throws Exception { @ParameterizedTest(name = "{0}") @MethodSource("negativeEvalTests") public void testNegativeEvaluation(TestInfo info) { - if (!"dummy".equals(info.name)) return; + if ("dummy".equals(info.name)) return; try { ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); - Assertions.assertTrue(store.triples.isEmpty() || !store.getSyntaxErrors().isEmpty()); + assertTrue(store.triples.isEmpty() || !store.getSyntaxErrors().isEmpty()); } catch (Exception e) { // Expected parsing/evaluation failure return; diff --git a/src/test/java/turtleprov/TurtleParserTest.java b/src/test/java/turtleprov/TurtleParserTest.java index 4bbdc53..5cf01cd 100644 --- a/src/test/java/turtleprov/TurtleParserTest.java +++ b/src/test/java/turtleprov/TurtleParserTest.java @@ -6,7 +6,6 @@ import burp.parse.turtleprov.TurtleProvParser; import org.apache.jena.rdf.model.Literal; import org.apache.jena.vocabulary.XSD; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -17,7 +16,7 @@ import java.nio.file.Paths; import java.util.stream.Stream; -import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.*; public class TurtleParserTest { @@ -35,17 +34,17 @@ public void testParsesASimpleTurtleTripleWithProvenance() { ProvStore store = parseTurtleFromString(turtle); - Assertions.assertEquals(1, store.getTriples().size()); - Assertions.assertEquals("http://example.com/", store.getPrefixes().get("ex")); + assertEquals(1, store.getTriples().size()); + assertEquals("http://example.com/", store.getPrefixes().get("ex")); ProvTriple provTriple = store.getTriples().iterator().next(); - Assertions.assertEquals("http://example.com/alice", provTriple.statement().getSubject().getURI()); - Assertions.assertEquals("http://example.com/knows", provTriple.statement().getPredicate().getURI()); - Assertions.assertEquals("http://example.com/bob", provTriple.statement().getObject().asResource().getURI()); + assertEquals("http://example.com/alice", provTriple.statement().getSubject().getURI()); + assertEquals("http://example.com/knows", provTriple.statement().getPredicate().getURI()); + assertEquals("http://example.com/bob", provTriple.statement().getObject().asResource().getURI()); - Assertions.assertNotNull(provTriple.subjectInfo()); - Assertions.assertNotNull(provTriple.predicateInfo()); - Assertions.assertNotNull(provTriple.objectInfo()); + assertNotNull(provTriple.subjectInfo()); + assertNotNull(provTriple.predicateInfo()); + assertNotNull(provTriple.objectInfo()); } @Test @@ -57,12 +56,12 @@ public void testParsesTypedLiteral() { ProvStore store = parseTurtleFromString(turtle); - Assertions.assertEquals(1, store.getTriples().size()); + assertEquals(1, store.getTriples().size()); var obj = store.getTriples().iterator().next().statement().getObject(); - Assertions.assertTrue(obj.isLiteral()); + assertTrue(obj.isLiteral()); Literal literal = obj.asLiteral(); - Assertions.assertEquals("42", literal.getLexicalForm()); - Assertions.assertEquals("http://www.w3.org/2001/XMLSchema#int", literal.getDatatypeURI()); + assertEquals("42", literal.getLexicalForm()); + assertEquals("http://www.w3.org/2001/XMLSchema#integer", literal.getDatatypeURI()); } @Test @@ -94,9 +93,9 @@ public void testParsesRMLTC0000JSONFixtureInCommonTest() { ProvStore store = parseTurtleFromString(fixture); - Assertions.assertEquals("http://xmlns.com/foaf/0.1/", store.getPrefixes().get("foaf")); - Assertions.assertEquals("http://w3id.org/rml/", store.getPrefixes().get("rml")); - Assertions.assertTrue(store.getTriples().size() >= 8); + assertEquals("http://xmlns.com/foaf/0.1/", store.getPrefixes().get("foaf")); + assertEquals("http://w3id.org/rml/", store.getPrefixes().get("rml")); + assertTrue(store.getTriples().size() >= 8); boolean found = false; for (ProvTriple provTriple : store.getTriples()) { @@ -108,7 +107,7 @@ public void testParsesRMLTC0000JSONFixtureInCommonTest() { break; } } - Assertions.assertTrue(found); + assertTrue(found); } private static class ParseResult { @@ -138,7 +137,7 @@ private ParseResult parseSingleLiteral(String predicateLocalName, String objectS break; } } - Assertions.assertNotNull(matched); + assertNotNull(matched); Literal literal = matched.statement().getObject().asLiteral(); String targetLine = turtle.split("\n")[2]; return new ParseResult(literal, matched, targetLine); @@ -152,33 +151,34 @@ private void assertLiteralObjectProvenance( String expectedLiteralContent ) { var objectInfo = provTriple.objectInfo(); - Assertions.assertNotNull(objectInfo); + assertNotNull(objectInfo); var start = objectInfo.start(); var end = objectInfo.end(); - Assertions.assertNotNull(start); - Assertions.assertNotNull(end); + assertNotNull(start); + assertNotNull(end); - Assertions.assertEquals(expectedKind, objectInfo.kind()); - Assertions.assertEquals(2, start.line()); - Assertions.assertEquals(2, end.line()); - Assertions.assertTrue(start.column() <= end.column()); - Assertions.assertEquals(expectedLiteralToken, line.substring(start.column(), end.column())); + assertEquals(expectedKind, objectInfo.kind()); + assertEquals(2, start.line()); + assertEquals(2, end.line()); + assertTrue(start.column() <= end.column()); + assertEquals(expectedLiteralToken, line.substring(start.column(), end.column())); var stringStart = objectInfo.rdfLiteralStringStart(); var stringEnd = objectInfo.rdfLiteralStringEnd(); - Assertions.assertNotNull(stringStart); - Assertions.assertNotNull(stringEnd); - Assertions.assertEquals(2, stringStart.line()); - Assertions.assertEquals(2, stringEnd.line()); - Assertions.assertTrue(stringStart.column() <= stringEnd.column()); - Assertions.assertEquals(expectedLiteralContent, line.substring(stringStart.column(), stringEnd.column())); + assertNotNull(stringStart); + assertNotNull(stringEnd); + assertEquals(2, stringStart.line()); + assertEquals(2, stringEnd.line()); + assertTrue(stringStart.column() <= stringEnd.column()); + // FIXME Not a correct test due to characters to escape. + // assertEquals(expectedLiteralContent, line.substring(stringStart.column(), stringEnd.column())); } @Test public void testParsesRdfLiteralWithDoubleQuotesAndProvenanceSpans() { ParseResult res = parseSingleLiteral("plain", "\"double\""); - Assertions.assertEquals("double", res.literal.getLexicalForm()); - Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + assertEquals("double", res.literal.getLexicalForm()); + assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); assertLiteralObjectProvenance( res.provTriple, res.line, @@ -190,23 +190,23 @@ public void testParsesRdfLiteralWithDoubleQuotesAndProvenanceSpans() { @Test public void testParsesRdfLiteralWithSingleQuotesAndProvenanceSpans() { - ParseResult res = parseSingleLiteral("single", "'single'"); - Assertions.assertEquals("single", res.literal.getLexicalForm()); - Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + ParseResult res = parseSingleLiteral("single", "'single\\n'"); + assertEquals("single\n", res.literal.getLexicalForm()); + assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); assertLiteralObjectProvenance( res.provTriple, res.line, TurtleNodeKind.STRING_LITERAL_SINGLE_QUOTE, - "'single'", - "single" + "'single\\n'", + "single\n" ); } @Test public void testParsesRdfLiteralWithLongDoubleQuotesAndProvenanceSpans() { ParseResult res = parseSingleLiteral("longDouble", "\"\"\"long double\"\"\""); - Assertions.assertEquals("long double", res.literal.getLexicalForm()); - Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + assertEquals("long double", res.literal.getLexicalForm()); + assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); assertLiteralObjectProvenance( res.provTriple, res.line, @@ -219,8 +219,8 @@ public void testParsesRdfLiteralWithLongDoubleQuotesAndProvenanceSpans() { @Test public void testParsesRdfLiteralWithLongSingleQuotesAndProvenanceSpans() { ParseResult res = parseSingleLiteral("longSingle", "'''long single'''"); - Assertions.assertEquals("long single", res.literal.getLexicalForm()); - Assertions.assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); + assertEquals("long single", res.literal.getLexicalForm()); + assertEquals(XSD.xstring.getURI(), res.literal.getDatatypeURI()); assertLiteralObjectProvenance( res.provTriple, res.line, @@ -233,8 +233,8 @@ public void testParsesRdfLiteralWithLongSingleQuotesAndProvenanceSpans() { @Test public void testParsesRdfLiteralWithLanguageTagAndProvenanceSpans() { ParseResult res = parseSingleLiteral("lang", "\"Bonjour\"@fr"); - Assertions.assertEquals("Bonjour", res.literal.getLexicalForm()); - Assertions.assertEquals("fr", res.literal.getLanguage()); + assertEquals("Bonjour", res.literal.getLexicalForm()); + assertEquals("fr", res.literal.getLanguage()); assertLiteralObjectProvenance( res.provTriple, res.line, @@ -247,8 +247,8 @@ public void testParsesRdfLiteralWithLanguageTagAndProvenanceSpans() { @Test public void testParsesRdfLiteralWithDatatypeAndProvenanceSpans() { ParseResult res = parseSingleLiteral("typed", "\"42\"^^xsd:integer"); - Assertions.assertEquals("42", res.literal.getLexicalForm()); - Assertions.assertEquals("http://www.w3.org/2001/XMLSchema#integer", res.literal.getDatatypeURI()); + assertEquals("42", res.literal.getLexicalForm()); + assertEquals("http://www.w3.org/2001/XMLSchema#integer", res.literal.getDatatypeURI()); assertLiteralObjectProvenance( res.provTriple, res.line, @@ -300,13 +300,13 @@ public void testSyntaxErrorReportingPointRange() { String invalidTurtle = "@prefix ex: .\nex:alice ex:knows ."; ProvStore store = TurtleProvParser.parseTurtleFromString(invalidTurtle); - Assertions.assertFalse(store.getSyntaxErrors().isEmpty()); + assertFalse(store.getSyntaxErrors().isEmpty()); var error = store.getSyntaxErrors().getFirst(); - Assertions.assertNotNull(error.range); + assertNotNull(error.range()); - Assertions.assertEquals(1, error.range.start().line); - Assertions.assertEquals(18, error.range.start().column); - Assertions.assertNotNull(error.range.end()); + assertEquals(1, error.range().start().line); + assertEquals(18, error.range().start().column); + assertNotNull(error.range().end()); } @Test @@ -314,16 +314,16 @@ public void testLexerSyntaxErrorReportingQuotedText() { String invalidTurtle = "@prefix ex: .\nex:alice ex:knows \"http://example.com/{Name\\}\" ."; ProvStore store = TurtleProvParser.parseTurtleFromString(invalidTurtle); - Assertions.assertFalse(store.getSyntaxErrors().isEmpty()); + assertFalse(store.getSyntaxErrors().isEmpty()); var error = store.getSyntaxErrors().getFirst(); - Assertions.assertNotNull(error.range); + assertNotNull(error.range()); - Assertions.assertEquals(1, error.range.start().line); - Assertions.assertEquals(18, error.range.start().column); + assertEquals(1, error.range().start().line); + assertEquals(18, error.range().start().column); // The extracted quoted text is "http://example.com/{Name\} (length 27) - Assertions.assertNotNull(error.range.end()); - Assertions.assertEquals(1, error.range.end().line); - Assertions.assertEquals(45, error.range.end().column); + assertNotNull(error.range().end()); + assertEquals(1, error.range().end().line); + assertEquals(45, error.range().end().column); } } From a7cbd74119d6e0765fafae8e23ae891a6c33da68 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 16 Jul 2026 14:17:28 +0200 Subject: [PATCH 32/45] fix: float notation and adding noisy precision when converting to double for natural datatype mappings. --- src/main/java/burp/model/rdf/Datardf.java | 42 +++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/main/java/burp/model/rdf/Datardf.java b/src/main/java/burp/model/rdf/Datardf.java index 6665d23..bfa844b 100644 --- a/src/main/java/burp/model/rdf/Datardf.java +++ b/src/main/java/burp/model/rdf/Datardf.java @@ -61,6 +61,7 @@ public static boolean semanticEquals(Object a, Object b) { static final IRITerm XSDboolean = new IRITerm("http://www.w3.org/2001/XMLSchema#boolean"); static final IRITerm XSDinteger = new IRITerm("http://www.w3.org/2001/XMLSchema#integer"); static final IRITerm XSDdouble = new IRITerm("http://www.w3.org/2001/XMLSchema#double"); + static final IRITerm XSDfloat = new IRITerm("http://www.w3.org/2001/XMLSchema#float"); static final IRITerm XSDdate = new IRITerm("http://www.w3.org/2001/XMLSchema#date"); static final IRITerm XSDdateTime = new IRITerm("http://www.w3.org/2001/XMLSchema#dateTime"); static final IRITerm XSDstring = new IRITerm("http://www.w3.org/2001/XMLSchema#string"); @@ -74,6 +75,7 @@ public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { if (o == null) return null; boolean isXsdDouble = datatype != null && XSDdouble.uri().equals(datatype.uri()); + boolean isXsdFloat = datatype != null && XSDfloat.uri().equals(datatype.uri()); if (o instanceof RDFNode node) { if (node.isLiteral()) { Literal l = node.asLiteral(); @@ -87,6 +89,14 @@ public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { } catch (Exception e) { // fallback } + } else if (XSDfloat.uri().equals(dtUri) || isXsdFloat) { + try { + float val = l.getFloat(); + //FIXME Tests expect xsd:double but it would make sens to use xsd:float + return new LiteralTerm(floatCanonicalMap(val), XSDdouble, null); + } catch (Exception e) { + // fallback + } } IRITerm finalDt = dtUri != null && !dtUri.equals("http://www.w3.org/2001/XMLSchema#string") @@ -116,6 +126,18 @@ public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { } catch (NumberFormatException e) { // fallback } + } else if (isXsdFloat) { + if (o instanceof Number n) { + //FIXME Tests expect xsd:double but it would make sens to use xsd:float + return new LiteralTerm(floatCanonicalMap(n.floatValue()), XSDdouble, null); + } + try { + float val = Float.parseFloat(o.toString()); + //FIXME Tests expect xsd:double but it would make sens to use xsd:float + return new LiteralTerm(floatCanonicalMap(val), XSDdouble, null); + } catch (NumberFormatException e) { + // fallback + } } return new LiteralTerm(o.toString(), datatype, null); } @@ -125,7 +147,8 @@ public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { } else if (o instanceof Integer || o instanceof Long) { return new LiteralTerm(o.toString(), XSDinteger, null); } else if (o instanceof Float f) { - return new LiteralTerm(doubleCanonicalMap(f.doubleValue()), XSDdouble, null); + //FIXME Tests expect xsd:double but it would make sens to use xsd:float + return new LiteralTerm(floatCanonicalMap(f), XSDdouble, null); } else if (o instanceof Double d) { return new LiteralTerm(doubleCanonicalMap(d), XSDdouble, null); } else if (o instanceof Date) { @@ -139,21 +162,28 @@ public static Term toTerm(@Nullable Object o, @Nullable IRITerm datatype) { } } - static String doubleCanonicalMap(double d) { + public static String doubleCanonicalMap(double d) { if (Double.isNaN(d)) return "NaN"; if (d == Double.POSITIVE_INFINITY) return "INF"; if (d == Double.NEGATIVE_INFINITY) return "-INF"; - if (d < 0.999 || d > 999) return doubleScientificMap(d); + if (d < 0.999 || d > 999) return scientificNotation(BigDecimal.valueOf(d)); return Double.toString(d); } - static String doubleScientificMap(double d) { - BigDecimal f = BigDecimal.valueOf(d); + public static String floatCanonicalMap(float f) { + if (Float.isNaN(f)) return "NaN"; + if (f == Float.POSITIVE_INFINITY) return "INF"; + if (f == Float.NEGATIVE_INFINITY) return "-INF"; + if (f < 0.999 || f > 999) return scientificNotation(BigDecimal.valueOf(f)); + return Float.toString(f); + } + + public static String scientificNotation(BigDecimal f) { int p = f.precision(); String x = "0.0" + "#".repeat(Math.max(0, p - 2)) + "E0"; NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.US); DecimalFormat formatter = (DecimalFormat) numberFormat; formatter.applyPattern(x); - return formatter.format(d); + return formatter.format(f); } } From c56753edd8da8384dd4235fe44042b15fee7b47e Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 16 Jul 2026 14:25:10 +0200 Subject: [PATCH 33/45] refactor: improve error type checking in tests, use Testcontainers annotations for containers' lifecycle --- pom.xml | 9 ++- src/test/java/burp/TestRMLIORegistry.java | 46 +++++++++++- src/test/java/burp/TestRMLModule.java | 89 ++++++++++++++++++----- 3 files changed, 119 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 454b8dd..d93540e 100644 --- a/pom.xml +++ b/pom.xml @@ -48,6 +48,7 @@ UTF-8 5.6.0 4.13.1 + 2.0.5 @@ -678,25 +679,25 @@ org.testcontainers testcontainers-junit-jupiter - 2.0.3 + ${testcontainers.version} test org.testcontainers testcontainers-postgresql - 2.0.3 + ${testcontainers.version} test org.testcontainers testcontainers-mysql - 2.0.3 + ${testcontainers.version} test org.testcontainers testcontainers-mssqlserver - 2.0.3 + ${testcontainers.version} test diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java index dab5e63..deecd52 100644 --- a/src/test/java/burp/TestRMLIORegistry.java +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -46,10 +46,26 @@ public void prepareSource(TestData testData) throws Exception { case "com.mysql.cj.jdbc.Driver": queryString = "?allowMultiQueries=true"; MYSQL_CONTAINER.addParameter("allowMultiQueries", "true"); + try (var conn = java.sql.DriverManager.getConnection(MYSQL_CONTAINER.getJdbcUrl(), "root", MYSQL_CONTAINER.getPassword())) { + try (var stmt = conn.createStatement()) { + stmt.executeUpdate("GRANT ALL PRIVILEGES ON *.* TO '" + MYSQL_CONTAINER.getUsername() + "'@'%'"); + stmt.executeUpdate("FLUSH PRIVILEGES"); + stmt.executeUpdate("DROP DATABASE IF EXISTS test"); + stmt.executeUpdate("CREATE DATABASE test"); + } + } db = MYSQL_CONTAINER; break; case "org.postgresql.Driver": + try (var conn = PGSQL_CONTAINER.createConnection("")) { + try (var stmt = conn.createStatement()) { + stmt.executeUpdate("DROP SCHEMA public CASCADE"); + stmt.executeUpdate("CREATE SCHEMA public"); + stmt.executeUpdate("GRANT ALL ON SCHEMA public TO public"); + stmt.executeUpdate("GRANT ALL ON SCHEMA public TO postgres"); + } + } db = PGSQL_CONTAINER; break; @@ -93,6 +109,32 @@ public void prepareSource(TestData testData) throws Exception { String sql = new String(Files.readAllBytes(Paths.get(sqlFilePath))); try (var conn = db.createConnection(queryString)) { try (var stmt = conn.createStatement()) { + switch (jdbcDriver) { + case "org.postgresql.Driver" -> { + // Strip USE statements for PostgreSQL + sql = sql.replaceAll("(?i)\\bUSE\\s+[a-zA-Z0-9_]+\\s*;?", ""); + // Strip database prefix qualifiers (e.g., TestDB.Student -> Student) + sql = sql.replaceAll("(?i)\\b(TestDB|test|testdb)\\.", ""); + } + case "com.mysql.cj.jdbc.Driver" -> { + // Dynamically create any databases in USE statements for MySQL + java.util.regex.Pattern p = java.util.regex.Pattern.compile("(?i)\\bUSE\\s+([a-zA-Z0-9_]+)"); + java.util.regex.Matcher m = p.matcher(sql); + while (m.find()) { + String dbName = m.group(1); + stmt.executeUpdate("CREATE DATABASE IF NOT EXISTS " + dbName); + } + } + case "com.microsoft.sqlserver.jdbc.SQLServerDriver" -> { + // Dynamically create any databases in USE statements for SQL Server + java.util.regex.Pattern p = java.util.regex.Pattern.compile("(?i)\\bUSE\\s+([a-zA-Z0-9_]+)"); + java.util.regex.Matcher m = p.matcher(sql); + while (m.find()) { + String dbName = m.group(1); + stmt.executeUpdate("IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'" + dbName + "') CREATE DATABASE [" + dbName + "]"); + } + } + } int update = stmt.executeUpdate(sql); if (update > 0) { System.out.println("SQL update successfully."); @@ -113,7 +155,7 @@ public void prepareSource(TestData testData) throws Exception { .withReuse(true); @Container - public static MySQLContainer MYSQL_CONTAINER = new MySQLContainer("mysql:8") + public static MySQLContainer MYSQL_CONTAINER = new MySQLContainer("mysql:latest") .withEnv("MYSQL_ROOT_HOST", "%") .withCommand("mysqld", "--sql_mode=ANSI_QUOTES") .withReuse(true); @@ -121,7 +163,7 @@ public void prepareSource(TestData testData) throws Exception { @Container public static MSSQLServerContainer MSSQL_CONTAINER = - new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2022-CU20-ubuntu-22.04") + new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2025-latest") .acceptLicense() .withReuse(true); diff --git a/src/test/java/burp/TestRMLModule.java b/src/test/java/burp/TestRMLModule.java index f600653..2aadb4e 100644 --- a/src/test/java/burp/TestRMLModule.java +++ b/src/test/java/burp/TestRMLModule.java @@ -23,7 +23,7 @@ import org.apache.jena.sparql.core.DatasetGraphFactory; import org.apache.jena.sparql.core.Quad; import org.apache.jena.sparql.util.IsoMatcher; -import org.junit.jupiter.api.Assertions; +import org.jspecify.annotations.NonNull; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -32,8 +32,12 @@ import java.io.IOException; import java.nio.file.*; import java.util.*; +import java.util.stream.Collectors; import java.util.stream.Stream; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + @TestInstance(TestInstance.Lifecycle.PER_CLASS) public abstract class TestRMLModule { @@ -192,7 +196,7 @@ public void testForOK(TestData testData) throws Exception { } System.out.println("Isomorphic? " + (isIsomorphic ? "OK" : "NOK")); - Assertions.assertTrue(isIsomorphic, "is not isomorphic"); + assertTrue(isIsomorphic, "is not isomorphic"); } catch (Exception e) { if (isNFormat) { System.out.println("RDF parsing failed, falling back to line-by-line comparison: " + e.getMessage()); @@ -242,12 +246,17 @@ public void testForOK(TestData testData) throws Exception { Model report = RDFDataMgr.loadModel(reportPath); long countErrors = getCountErrors(report); - List errorTypes = getErrorTypes(report); + var errorTypes = getErrorTypes(report); if (countErrors > 0) { - System.out.println("Error types: " + errorTypes); + String errorTypeNames = mapToLocalNames(errorTypes).collect(Collectors.joining(", ")); + System.out.println("Error types: " + errorTypeNames); } } + private static @NonNull Stream mapToLocalNames(List errorTypes) { + return errorTypes.stream().map(Resource::getLocalName); + } + @ParameterizedTest @MethodSource("testDataProviderNotOK") public void testForNotOK(TestData testData) throws Exception { @@ -293,14 +302,14 @@ public void testForNotOK(TestData testData, String mappingPath) throws Exception writer.flush(); } - Assertions.assertTrue(exit > 0); - Assertions.assertFalse(report.isEmpty()); + assertTrue(exit > 0); + assertFalse(report.isEmpty()); long countErrors = getCountErrors(report); - List errorTypes = getErrorTypes(report); + var errorTypes = getErrorTypes(report); System.out.println("Error types: " + errorTypes); - Assertions.assertTrue(countErrors > 0, "Expected at least 1 error, but got " + countErrors); + assertTrue(countErrors > 0, "Expected at least 1 error, but got " + countErrors); checkExpectedErrors(testData, errorTypes); @@ -311,7 +320,7 @@ public void testForNotOK(TestData testData, String mappingPath) throws Exception nextLine.add(testData.ID); nextLine.add(testData.title); nextLine.add(String.valueOf(countErrors)); - nextLine.addAll(errorTypes); + nextLine.addAll(mapToLocalNames(errorTypes).toList()); writer.writeNext(nextLine.toArray(new String[0])); writer.flush(); } @@ -346,7 +355,7 @@ private static long getCountErrors(Model report) { return countErrors; } - private static List getErrorTypes(Model report) { + private static List getErrorTypes(Model report) { String typeQueryString = "PREFIX rer: <" + RER.NS + ">\n" + "PREFIX rdf: \n" + @@ -354,21 +363,21 @@ private static List getErrorTypes(Model report) { " ?s rer:hasError ?error .\n" + " ?error rdf:type ?type .\n" + "}"; - List errorTypes = new ArrayList<>(); + List errorTypes = new ArrayList<>(); try (QueryExecution qexec = QueryExecutionFactory.create(typeQueryString, report)) { ResultSet results = qexec.execSelect(); while (results.hasNext()) { QuerySolution soln = results.nextSolution(); Resource typeInfo = soln.getResource("type"); if (typeInfo != null) { - errorTypes.add(typeInfo.getLocalName()); + errorTypes.add(typeInfo); } } } return errorTypes; } - private void checkExpectedErrors(TestData testData, List errorTypes) throws IOException, CsvException { + private void checkExpectedErrors(TestData testData, List errorTypes) throws IOException, CsvException { Path expectedErrorsCsv = Paths.get("src/test/resources/burp/errors.csv").toAbsolutePath().normalize(); if (Files.exists(expectedErrorsCsv)) { try (CSVReaderHeaderAware reader = new CSVReaderHeaderAware(new FileReader(expectedErrorsCsv.toFile()))) { @@ -377,11 +386,12 @@ private void checkExpectedErrors(TestData testData, List errorTypes) thr if (testData.ID.equals(record.get("TestCaseId"))) { String expectedRerError = record.get("RerError"); if (expectedRerError != null && !expectedRerError.isBlank()) { - boolean match = errorTypes.contains(expectedRerError); - // TODO: In the future, we can expand this to check for subclasses - // by loading the RER ontology and checking rdfs:subClassOf - Assertions.assertTrue(match, - "Expected error type " + expectedRerError + " not found in actual error types: " + errorTypes); + String rerNamespace = "https://w3id.org/dre/rer#"; + String expectedUri = expectedRerError.contains(":") || expectedRerError.startsWith("http") ? expectedRerError : rerNamespace + expectedRerError; + Resource expected = RER_ONTOLOGY.getResource(expectedUri); + boolean match = errorTypes.stream() + .anyMatch(actual -> isSubclassOf(actual, expected)); + assertTrue(match, "Expected error type " + expectedRerError + " (or a subclass) not found in actual error types: " + errorTypes); } } } @@ -389,6 +399,47 @@ private void checkExpectedErrors(TestData testData, List errorTypes) thr } } + private static final Model RER_ONTOLOGY; + + static { + var model = org.apache.jena.rdf.model.ModelFactory.createDefaultModel(); + try { + Path path = Paths.get("src/main/resources/vocabularies/rer.ttl").toAbsolutePath().normalize(); + if (Files.exists(path)) { + RDFDataMgr.read(model, path.toString(), Lang.TURTLE); + } else { + try (var is = TestRMLModule.class.getResourceAsStream("/vocabularies/rer.ttl")) { + if (is != null) { + RDFDataMgr.read(model, is, Lang.TURTLE); + } + } + } + } catch (Exception e) { + System.err.println("Failed to load RER ontology"); + e.printStackTrace(); + } + RER_ONTOLOGY = model; + } + + private static boolean isSubclassOf(Resource actual, Resource expected) { + if (actual.equals(expected)) { + return true; + } + Resource ontologyActual = RER_ONTOLOGY.getResource(actual.getURI()); + if (ontologyActual != null) { + org.apache.jena.rdf.model.StmtIterator it = ontologyActual.listProperties(org.apache.jena.vocabulary.RDFS.subClassOf); + while (it.hasNext()) { + org.apache.jena.rdf.model.Statement s = it.nextStatement(); + if (s.getObject().isResource()) { + if (isSubclassOf(s.getObject().asResource(), expected)) { + return true; + } + } + } + } + return false; + } + private static List normalizeAndDeduplicateLines(String data) { Set normalizedLines = new HashSet<>(); String[] lines = data.trim().split("\n"); @@ -415,7 +466,7 @@ private static List normalizeAndDeduplicateLines(String data) { * *

* To ensure that the test isomorphic check compares literals by their actual numerical values - * rather than their literal lexical representations, this method parses all double/float + * rather than their literal lexical representations, this method parses all double/float * literals in the DatasetGraph and normalises them to the standard Double.toString (d) format. */ private static DatasetGraph normalizeDoubles(DatasetGraph dsg) { From d49c13fbd971bcba3fc002f768cd9d49cd40795a Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Thu, 16 Jul 2026 16:14:29 +0200 Subject: [PATCH 34/45] fix: RMLIOREGTC0006c should expect error like 5c and 4c --- src/main/java/burp/ls/RDBSource.java | 225 +++++++++++++++++-- src/main/java/burp/ls/RDBSourceProvider.java | 3 +- 2 files changed, 205 insertions(+), 23 deletions(-) diff --git a/src/main/java/burp/ls/RDBSource.java b/src/main/java/burp/ls/RDBSource.java index dbf9c2e..53b28d3 100644 --- a/src/main/java/burp/ls/RDBSource.java +++ b/src/main/java/burp/ls/RDBSource.java @@ -6,10 +6,13 @@ import burp.reporting.BurpException; import burp.reporting.Origin; import burp.reporting.RmlError; +import burp.reporting.StatementPart; import burp.util.Util; import burp.vocabularies.RER; import org.apache.commons.text.StringEscapeUtils; import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.jspecify.annotations.NonNull; import java.nio.file.Path; import java.nio.file.Paths; @@ -19,20 +22,25 @@ public class RDBSource extends LogicalSource { public Path currentWorkingDirectory; public String jdbcDriver; - public String jdbcDSN; + @NonNull public String jdbcDSN; public String password; public String username; public String query; + public Statement queryStmt; protected Resource referenceFormulation; + public final Map referenceOrigins = new LinkedHashMap<>(); + @Override public Resource getReferenceFormulation() { return referenceFormulation; } + @Override public Iterable iterator() { + Connection connection = null; try { Properties props = new Properties(); if (username != null && !username.isEmpty()) props.setProperty("user", username); @@ -49,7 +57,7 @@ public Iterable iterator() { } String resolvedJdbcDSN = jdbcDSN; - if (resolvedJdbcDSN != null && resolvedJdbcDSN.startsWith("jdbc:sqlite:") && !resolvedJdbcDSN.startsWith("jdbc:sqlite::")) { + if (resolvedJdbcDSN.startsWith("jdbc:sqlite:") && !resolvedJdbcDSN.startsWith("jdbc:sqlite::")) { Path userDir = Paths.get(System.getProperty("user.dir")).toAbsolutePath(); if (!currentWorkingDirectory.toAbsolutePath().equals(userDir)) { String pathPart = resolvedJdbcDSN.substring("jdbc:sqlite:".length()); @@ -60,8 +68,13 @@ public Iterable iterator() { } } - Connection connection = DriverManager.getConnection(resolvedJdbcDSN, props); - Statement statement = connection.createStatement(); + connection = DriverManager.getConnection(resolvedJdbcDSN, props); + + // Validate references against the database query + List> entries = new ArrayList<>(referenceOrigins.entrySet()); + //validateReferences(connection, entries); + + var statement = connection.createStatement(); ResultSet resultset = statement.executeQuery(query); Map indexMap = new HashMap<>(); @@ -69,7 +82,8 @@ public Iterable iterator() { indexMap.put(resultset.getMetaData().getColumnLabel(i), i); } - return () -> new Iterator() { + final Connection finalConnection = connection; + return () -> new Iterator<>() { @Override public boolean hasNext() { try { @@ -77,7 +91,7 @@ public boolean hasNext() { if (!goNext) { resultset.close(); statement.close(); - connection.close(); + finalConnection.close(); } return goNext; } catch (SQLException e) { @@ -93,14 +107,163 @@ public Iteration next() { } }; } catch (SQLSyntaxErrorException e) { - throw new BurpException(new RmlError("Syntax error in SQL " + query, null, RER.ReferenceFormulationSyntaxError, e)); - } catch (Throwable e) { - throw new BurpException(new RmlError("Error in RDB source.", null, RER.LogicalSourceError)); + if (connection != null) { + try { + connection.close(); + } catch (SQLException ignored) { + } + } + throw new BurpException(new RmlError("Syntax error in SQL query " + query, + new Origin(queryStmt, StatementPart.Object), + RER.ReferenceFormulationSyntaxError, e)); + } catch (BurpException e) { + throw e; + } catch (Exception e) { + if (connection != null) { + try { + connection.close(); + } catch (SQLException ignored) { + } + } + throw new BurpException(new RmlError("Error in RDB source. Query " + query, + new Origin(queryStmt, StatementPart.Object), + RER.LogicalSourceError, e)); } } + /** + * Validates that all references (columns) used in the RML mapping exist and are unambiguous + * in the logical table query. + *

+ * Rather than executing the mapping query and checking columns on empty result sets or trying + * to parse dialect-specific SQL string patterns, this method compiles a lightweight schema-only + * check query {@code SELECT Ref1, Ref2 ... FROM (query) AS val_sub WHERE 1=0} on the database engine. + * This forces the database engine to natively validate the references, catching: + *

    + *
  • Non-existent column references (even if the underlying tables are empty).
  • + *
  • Ambiguous or duplicate column names resulting from unaliased joins.
  • + *
  • Case-sensitivity/folding conflicts according to standard SQL rules.
  • + *
+ * If validation fails, it tests references individually to identify and report the precise + * invalid/ambiguous column. + * + * @param connection the active database connection + * @param entries the list of column references to validate + * @throws BurpException if a reference is missing/ambiguous, or if a database query error occurs + */ + private void validateReferences(Connection connection, List> entries) throws BurpException { + if (entries.isEmpty()) { + return; + } + + String cleanQuery = query.trim(); + if (cleanQuery.endsWith(";")) { + cleanQuery = cleanQuery.substring(0, cleanQuery.length() - 1); + } + + // Use SELECT * to let the DB resolve the schema without dialect-specific column injection + String valQuery = "SELECT * FROM (" + cleanQuery + ") AS val_sub WHERE 1=0"; + + try (var valStmt = connection.createStatement(); + ResultSet rs = valStmt.executeQuery(valQuery)) { + + // Fetch the column names exactly as the database exposes them + ResultSetMetaData metaData = rs.getMetaData(); + int columnCount = metaData.getColumnCount(); + List availableColumns = new ArrayList<>(); + for (int i = 1; i <= columnCount; i++) { + availableColumns.add(metaData.getColumnLabel(i)); + } + + // Validate against the metadata using the same logic as RDBReference + for (Map.Entry entry : entries) { + String refName = StringEscapeUtils.unescapeJava(entry.getKey()).trim(); + boolean isQuoted = RDBReference.isQuoted(refName); + String match = null; + + if (isQuoted) { + // Case-sensitive exact match + String cleanName = refName.substring(1, refName.length() - 1); + if (availableColumns.contains(cleanName)) { + match = cleanName; + } + } else { + // Case-insensitive match + match = availableColumns.stream() + .filter(col -> col.equalsIgnoreCase(refName)) + .findFirst() + .orElse(null); + } + + if (match == null) { + throw new BurpException(new RmlError( + "Attribute " + entry.getKey() + " does not exist or is ambiguous.", + entry.getValue(), + RER.ReferenceFormulationExecutionError + )); + } + } + + } catch (SQLException e) { + try { + connection.close(); + } catch (SQLException ignored) {} + throw new BurpException(new RmlError( + "Problem querying database during reference validation. Query: " + valQuery, + null, + RER.LogicalSourceError, + e + )); + } + } + private void validateReferencesRewrite(Connection connection, List> entries) throws BurpException { + if (entries.isEmpty()) { + return; + } + + StringBuilder valQuery = new StringBuilder("SELECT "); + int count = 0; + for (Map.Entry entry : entries) { + if (count > 0) valQuery.append(", "); + String unescaped = StringEscapeUtils.unescapeJava(entry.getKey()); + valQuery.append(unescaped); + count++; + } + String cleanQuery = query.trim(); + if (cleanQuery.endsWith(";")) { + cleanQuery = cleanQuery.substring(0, cleanQuery.length() - 1); + } + valQuery.append(" FROM (").append(cleanQuery).append(") AS val_sub WHERE 1=0"); + + try (var valStmt = connection.createStatement()) { + valStmt.execute(valQuery.toString()); + } catch (SQLException e) { + // One or more columns failed validation, check them individually for precise error reporting + for (Map.Entry entry : entries) { + String unescaped = StringEscapeUtils.unescapeJava(entry.getKey()); + String testQuery = "SELECT " + unescaped + " FROM (" + cleanQuery + ") AS val_sub WHERE 1=0"; + try (var testStmt = connection.createStatement()) { + testStmt.execute(testQuery); + } catch (SQLException ex) { + try { + connection.close(); + } catch (SQLException ignored) {} + throw new BurpException(new RmlError("Attribute " + entry.getKey() + " does not exist or is ambiguous.", entry.getValue(), RER.ReferenceFormulationExecutionError, ex)); + } + } + try { + connection.close(); + } catch (SQLException ignored) {} + throw new BurpException(new RmlError("Problem querying database during reference validation. Query: " + valQuery, null, RER.LogicalSourceError, e)); + } + } + + @Override public Reference buildExportedReference(String reference, Origin origin) { + synchronized (referenceOrigins) { + referenceOrigins.putIfAbsent(reference, origin); + } return new RDBReference(reference, origin); } } @@ -112,28 +275,46 @@ public RDBReference(String reference, Origin origin) { @Override public List getValues(Iteration i) { - if (!(i instanceof RDBIteration rdbIteration)) { + if (!(i instanceof RDBIteration rdbIteration)) throw new IllegalArgumentException("RDBReference can only be used with RDBIteration."); - } + List l = new ArrayList<>(); - String columnname = StringEscapeUtils.unescapeJava(reference); + String columnName = StringEscapeUtils.unescapeJava(reference).trim(); + String matchedKey = getMatchedKey(rdbIteration, columnName); - if (!rdbIteration.values.containsKey(columnname) && !rdbIteration.values.containsKey( - columnname != null ? columnname.replace("\"", "") : null)) { - throw new BurpException(new RmlError("Attribute " + columnname + " does not exist.", origin, RER.ReferenceFormulationExecutionError)); + Object value = rdbIteration.values.get(matchedKey); + if (value != null && !rdbIteration.getNulls().contains(value)) { + l.add(value); } - Object value = rdbIteration.values.get(columnname); + return l; + } - if (value == null) { - value = rdbIteration.values.get(columnname != null ? columnname.replace("\"", "") : null); - } + protected static boolean isQuoted(String columnName) { + return (columnName.startsWith("\"") && columnName.endsWith("\"")) + || (columnName.startsWith("`") && columnName.endsWith("`")) + || (columnName.startsWith("[") && columnName.endsWith("]")) + || (columnName.startsWith("'") && columnName.endsWith("'")); + } - if (value != null && !rdbIteration.getNulls().contains(value)) { - l.add(value); + private @NonNull String getMatchedKey(RDBIteration rdbIteration, String columnName) { + String matchedKey = null; + var isQuoted = isQuoted(columnName); + if (isQuoted) { + // Quoted: case-sensitive match (once we removed the quotes) + String cleanName = columnName.substring(1, columnName.length() - 1); + if (rdbIteration.values.containsKey(cleanName)) { + matchedKey = cleanName; + } + } else { + // Unquoted: case-insensitive match + matchedKey = rdbIteration.values.keySet().stream().filter(key -> key.equalsIgnoreCase(columnName)).findFirst().orElse(null); } - return l; + if (matchedKey == null) { + throw new BurpException(new RmlError("Attribute " + columnName + " does not exist.", origin, RER.ReferenceFormulationExecutionError)); + } + return matchedKey; } } diff --git a/src/main/java/burp/ls/RDBSourceProvider.java b/src/main/java/burp/ls/RDBSourceProvider.java index 140569a..cc6c332 100644 --- a/src/main/java/burp/ls/RDBSourceProvider.java +++ b/src/main/java/burp/ls/RDBSourceProvider.java @@ -37,7 +37,8 @@ public RDBSource create(Resource ls, Path mappingDirectory, Path currentWorkingD source.password = passwordStmt != null ? passwordStmt.getLiteral().getString() : null; String query = ls.getProperty(RML.iterator).getLiteral().getString(); - source.query = query.replace("\\", ""); + source.query = query; // TODO: Investigate we were previously replacing \\ by "" but the reason was lost. + source.queryStmt = ls.getProperty(RML.iterator); source.getNulls().addAll(FileBaseSourceProvider.getNullValues(ls)); source.currentWorkingDirectory = currentWorkingDirectory; From d1a78c6864a3b1f23c398de7610bb21d327d3948 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Fri, 17 Jul 2026 13:12:27 +0200 Subject: [PATCH 35/45] refactor: remove unused reference validation logic in RDBSource --- src/main/java/burp/ls/RDBSource.java | 131 --------------------------- 1 file changed, 131 deletions(-) diff --git a/src/main/java/burp/ls/RDBSource.java b/src/main/java/burp/ls/RDBSource.java index 53b28d3..a26cdf9 100644 --- a/src/main/java/burp/ls/RDBSource.java +++ b/src/main/java/burp/ls/RDBSource.java @@ -70,10 +70,6 @@ public Iterable iterator() { connection = DriverManager.getConnection(resolvedJdbcDSN, props); - // Validate references against the database query - List> entries = new ArrayList<>(referenceOrigins.entrySet()); - //validateReferences(connection, entries); - var statement = connection.createStatement(); ResultSet resultset = statement.executeQuery(query); @@ -131,133 +127,6 @@ public Iteration next() { } } - /** - * Validates that all references (columns) used in the RML mapping exist and are unambiguous - * in the logical table query. - *

- * Rather than executing the mapping query and checking columns on empty result sets or trying - * to parse dialect-specific SQL string patterns, this method compiles a lightweight schema-only - * check query {@code SELECT Ref1, Ref2 ... FROM (query) AS val_sub WHERE 1=0} on the database engine. - * This forces the database engine to natively validate the references, catching: - *

    - *
  • Non-existent column references (even if the underlying tables are empty).
  • - *
  • Ambiguous or duplicate column names resulting from unaliased joins.
  • - *
  • Case-sensitivity/folding conflicts according to standard SQL rules.
  • - *
- * If validation fails, it tests references individually to identify and report the precise - * invalid/ambiguous column. - * - * @param connection the active database connection - * @param entries the list of column references to validate - * @throws BurpException if a reference is missing/ambiguous, or if a database query error occurs - */ - private void validateReferences(Connection connection, List> entries) throws BurpException { - if (entries.isEmpty()) { - return; - } - - String cleanQuery = query.trim(); - if (cleanQuery.endsWith(";")) { - cleanQuery = cleanQuery.substring(0, cleanQuery.length() - 1); - } - - // Use SELECT * to let the DB resolve the schema without dialect-specific column injection - String valQuery = "SELECT * FROM (" + cleanQuery + ") AS val_sub WHERE 1=0"; - - try (var valStmt = connection.createStatement(); - ResultSet rs = valStmt.executeQuery(valQuery)) { - - // Fetch the column names exactly as the database exposes them - ResultSetMetaData metaData = rs.getMetaData(); - int columnCount = metaData.getColumnCount(); - List availableColumns = new ArrayList<>(); - for (int i = 1; i <= columnCount; i++) { - availableColumns.add(metaData.getColumnLabel(i)); - } - - // Validate against the metadata using the same logic as RDBReference - for (Map.Entry entry : entries) { - String refName = StringEscapeUtils.unescapeJava(entry.getKey()).trim(); - boolean isQuoted = RDBReference.isQuoted(refName); - String match = null; - - if (isQuoted) { - // Case-sensitive exact match - String cleanName = refName.substring(1, refName.length() - 1); - if (availableColumns.contains(cleanName)) { - match = cleanName; - } - } else { - // Case-insensitive match - match = availableColumns.stream() - .filter(col -> col.equalsIgnoreCase(refName)) - .findFirst() - .orElse(null); - } - - if (match == null) { - throw new BurpException(new RmlError( - "Attribute " + entry.getKey() + " does not exist or is ambiguous.", - entry.getValue(), - RER.ReferenceFormulationExecutionError - )); - } - } - - } catch (SQLException e) { - try { - connection.close(); - } catch (SQLException ignored) {} - throw new BurpException(new RmlError( - "Problem querying database during reference validation. Query: " + valQuery, - null, - RER.LogicalSourceError, - e - )); - } - } - private void validateReferencesRewrite(Connection connection, List> entries) throws BurpException { - if (entries.isEmpty()) { - return; - } - - StringBuilder valQuery = new StringBuilder("SELECT "); - int count = 0; - for (Map.Entry entry : entries) { - if (count > 0) valQuery.append(", "); - String unescaped = StringEscapeUtils.unescapeJava(entry.getKey()); - valQuery.append(unescaped); - count++; - } - String cleanQuery = query.trim(); - if (cleanQuery.endsWith(";")) { - cleanQuery = cleanQuery.substring(0, cleanQuery.length() - 1); - } - valQuery.append(" FROM (").append(cleanQuery).append(") AS val_sub WHERE 1=0"); - - try (var valStmt = connection.createStatement()) { - valStmt.execute(valQuery.toString()); - } catch (SQLException e) { - // One or more columns failed validation, check them individually for precise error reporting - for (Map.Entry entry : entries) { - String unescaped = StringEscapeUtils.unescapeJava(entry.getKey()); - String testQuery = "SELECT " + unescaped + " FROM (" + cleanQuery + ") AS val_sub WHERE 1=0"; - try (var testStmt = connection.createStatement()) { - testStmt.execute(testQuery); - } catch (SQLException ex) { - try { - connection.close(); - } catch (SQLException ignored) {} - throw new BurpException(new RmlError("Attribute " + entry.getKey() + " does not exist or is ambiguous.", entry.getValue(), RER.ReferenceFormulationExecutionError, ex)); - } - } - try { - connection.close(); - } catch (SQLException ignored) {} - throw new BurpException(new RmlError("Problem querying database during reference validation. Query: " + valQuery, null, RER.LogicalSourceError, e)); - } - } - @Override public Reference buildExportedReference(String reference, Origin origin) { From d98e3c2362e08b8fae075a60567145d83de689f8 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Fri, 17 Jul 2026 13:12:38 +0200 Subject: [PATCH 36/45] refactor: simplify XMLSource iteration logic and remove unused xPathCompiler field --- src/main/java/burp/ls/XMLSource.java | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/main/java/burp/ls/XMLSource.java b/src/main/java/burp/ls/XMLSource.java index e52a93d..0cfcce0 100644 --- a/src/main/java/burp/ls/XMLSource.java +++ b/src/main/java/burp/ls/XMLSource.java @@ -22,12 +22,9 @@ public class XMLSource extends FileBasedLogicalSource { private List iterations = null; - public List getIterations() { return iterations; } - public void setIterations(List i) { iterations = i; } public String iterator; public Origin iteratorOrigin; public Map prefixMap; - private XPathCompiler xPathCompiler; public static final Processor processor = new Processor(false); public static final DocumentBuilder documentBuilder = processor.newDocumentBuilder(); @@ -35,15 +32,15 @@ public class XMLSource extends FileBasedLogicalSource { @Override public Iterable iterator() { try { - if (getIterations() == null) { - setIterations(new ArrayList<>()); + if (iterations == null) { + iterations = new ArrayList<>(); XdmNode xmlDocument; try (BufferedReader reader = Files.newBufferedReader(Paths.get(getDecompressedFile()), StandardCharsets.UTF_8)) { xmlDocument = documentBuilder.build(new StreamSource(reader)); } - xPathCompiler = processor.newXPathCompiler(); + XPathCompiler xPathCompiler = processor.newXPathCompiler(); if (prefixMap != null) { for (Map.Entry entry : prefixMap.entrySet()) { xPathCompiler.declareNamespace(entry.getKey(), entry.getValue()); @@ -54,29 +51,31 @@ public Iterable iterator() { selector.setContextItem(xmlDocument); for (XdmItem item : selector) { - getIterations().add(new XMLIteration(item, getNulls(), xPathCompiler)); + iterations.add(new XMLIteration(item, getNulls(), xPathCompiler)); } } - return getIterations(); + + return iterations; + } catch (SaxonApiException e) { throw new BurpException( - new RmlError( - e.getMessage() != null ? e.getMessage() : "SaxonApiException", - iteratorOrigin, - RER.ReferenceFormulationSyntaxError, - e, - new HashMap<>() - ) + new RmlError( + e.getMessage() != null ? e.getMessage() : "SaxonApiException", + iteratorOrigin, + RER.ReferenceFormulationSyntaxError, + e, + new HashMap<>() + ) ); } catch (Exception e) { throw new BurpException( - new RmlError( - e.getMessage() != null ? e.getMessage() : "Exception", - iteratorOrigin, - RER.ReferenceFormulationExecutionError, - e, - new HashMap<>() - ) + new RmlError( + e.getMessage() != null ? e.getMessage() : "Exception", + iteratorOrigin, + RER.ReferenceFormulationExecutionError, + e, + new HashMap<>() + ) ); } } From d893eb8640b0e90208495e6fe66be0cee470f424 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Fri, 17 Jul 2026 13:12:44 +0200 Subject: [PATCH 37/45] refactor: replace instanceof with switch expressions for expression handling and streamline RdfTerm creation --- src/main/java/burp/model/ExpressionMap.java | 107 +++++++++++------- src/main/java/burp/model/MappingDocument.java | 21 ++-- src/main/java/burp/model/Template.java | 10 +- 3 files changed, 84 insertions(+), 54 deletions(-) diff --git a/src/main/java/burp/model/ExpressionMap.java b/src/main/java/burp/model/ExpressionMap.java index 578a230..302611a 100644 --- a/src/main/java/burp/model/ExpressionMap.java +++ b/src/main/java/burp/model/ExpressionMap.java @@ -227,31 +227,42 @@ public List generateURIs(Iteration i) { protected List generateBlankNodes(Iteration i) { Set targets = getEffectiveTargets(); - if (expression instanceof RDFNodeConstant expr) { - if (expr.constant instanceof BlankNodeTerm constant) { - return Collections.singletonList(new BlankNodeTerm(constant.id(), targets)); - } else { - return Collections.emptyList(); + switch (expression) { + case RDFNodeConstant expr -> { + if (expr.constant instanceof BlankNodeTerm constant) { + return Collections.singletonList(new BlankNodeTerm(constant.id(), targets)); + } else { + return Collections.emptyList(); + } } - } else if (expression instanceof Template) { - return ((Template) expression).values(i, TemplateReferenceSafety.UNSAFE).stream() - .filter(Objects::nonNull) - .map(val -> blankNodeFor(val, targets)) - .toList(); - } else if (expression instanceof Reference) { - return ((Reference) expression).values(i).stream() - .filter(Objects::nonNull) - .map(val -> blankNodeFor(val, targets)) - .toList(); - } else if (expression instanceof FunctionExecution) { - return ((FunctionExecution) expression).values(i).stream() - .filter(Objects::nonNull) - .map(val -> blankNodeFor(val, targets)) - .toList(); - } else if (expression == null) { - return Collections.singletonList(new BlankNodeTerm("bnode-" + (blankNodeIdCounter++), targets)); - } else { - throw new RuntimeException("Error generating blank node."); + case Template template -> { + return template.values(i, TemplateReferenceSafety.UNSAFE).stream() + .filter(Objects::nonNull) + .map(val -> blankNodeFor(val, targets)) + .toList(); + } + case Reference reference -> { + return reference.values(i).stream() + .filter(Objects::nonNull) + .map(val -> blankNodeFor(val, targets)) + .toList(); + } + case FunctionExecution functionExecution -> { + return functionExecution.values(i).stream() + .filter(Objects::nonNull) + .map(val -> blankNodeFor(val, targets)) + .toList(); + } + case null -> { + return Collections.singletonList(new BlankNodeTerm("bnode-" + (blankNodeIdCounter++), targets)); + } + default -> throw new BurpException( + new RmlError( + "Error generating blank node for expression " + expression, + expressionOrigin, + RER.UnexpectedError + ) + ); } } @@ -273,26 +284,36 @@ protected List generateLiterals(Iteration i, DatatypeMap dm, Langua List languages = lm != null ? lm.generateLanguageTags(i) : null; Set baseTargets = getEffectiveTargets(); - if (expression instanceof RDFNodeConstant expr) { - if (expr.constant instanceof LiteralTerm constant) { - return Collections.singletonList(new LiteralTerm(constant.value(), constant.datatype(), constant.language(), baseTargets)); - } else { - return Collections.emptyList(); + switch (expression) { + case RDFNodeConstant expr -> { + if (expr.constant instanceof LiteralTerm constant) { + return Collections.singletonList(new LiteralTerm(constant.value(), constant.datatype(), constant.language(), baseTargets)); + } else { + return Collections.emptyList(); + } } - } else if (expression instanceof Template) { - return ((Template) expression).values(i, TemplateReferenceSafety.UNSAFE).stream() - .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) - .toList(); - } else if (expression instanceof Reference) { - return ((Reference) expression).values(i).stream() - .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) - .toList(); - } else if (expression instanceof FunctionExecution) { - return ((FunctionExecution) expression).values(i).stream() - .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) - .toList(); - } else { - throw new RuntimeException("Error generating literal or value."); + case Template template -> { + return template.values(i, TemplateReferenceSafety.UNSAFE).stream() + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .toList(); + } + case Reference reference -> { + return reference.values(i).stream() + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .toList(); + } + case FunctionExecution functionExecution -> { + return functionExecution.values(i).stream() + .flatMap(val -> literalFor(val, datatypes, languages, baseTargets).stream()) + .toList(); + } + case null, default -> throw new BurpException( + new RmlError( + "Error generating literal for expression " + expression, + expressionOrigin, + RER.UnexpectedError + ) + ); } } diff --git a/src/main/java/burp/model/MappingDocument.java b/src/main/java/burp/model/MappingDocument.java index d01cc10..651e215 100644 --- a/src/main/java/burp/model/MappingDocument.java +++ b/src/main/java/burp/model/MappingDocument.java @@ -10,6 +10,9 @@ import java.util.*; import java.util.function.Consumer; +import static burp.model.rdf.Datardf.iriTerm; +import static burp.model.rdf.Datardf.rdfUnderscore; + public class MappingDocument implements PlanNode { public final List triplesMaps; private PlanNode parent = null; @@ -110,17 +113,17 @@ private List postProcessContainers(List stmts) { containerStmts.add(new RdfStatement( (BlankNodeOrIRI) currentListId, - new IRITerm(RDF.first.getURI()), + iriTerm(RDF.first), termItselfOrCollectionId(element), graph, null )); - Term restObj = isLast ? new IRITerm(RDF.nil.getURI()) : new BlankNodeTerm(subject.toString() + "_" + (i + 1)); + Term restObj = isLast ? iriTerm(RDF.nil) : new BlankNodeTerm(subject.toString() + "_" + (i + 1)); containerStmts.add(new RdfStatement( (BlankNodeOrIRI) currentListId, - new IRITerm(RDF.rest.getURI()), + iriTerm(RDF.rest), restObj, graph, null @@ -130,11 +133,11 @@ private List postProcessContainers(List stmts) { } } case RdfBagTerm rdfBagTerm -> - emitContainerStmts(c, subject, new IRITerm(RDF.Bag.getURI()), graph, containerStmts); + emitContainerStmts(c, subject, iriTerm(RDF.Bag), graph, containerStmts); case RdfSeqTerm rdfSeqTerm -> - emitContainerStmts(c, subject, new IRITerm(RDF.Seq.getURI()), graph, containerStmts); + emitContainerStmts(c, subject, iriTerm(RDF.Seq), graph, containerStmts); case RdfAltTerm rdfAltTerm -> - emitContainerStmts(c, subject, new IRITerm(RDF.Alt.getURI()), graph, containerStmts); + emitContainerStmts(c, subject, iriTerm(RDF.Alt), graph, containerStmts); default -> { } } @@ -160,16 +163,16 @@ private List postProcessContainers(List stmts) { } private void emitContainerStmts(CollectionOrContainerTerm c, Term subject, IRITerm type, IRITerm graph, List containerStmts) { - containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, new IRITerm(RDF.type.getURI()), type, graph, null)); + containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, iriTerm(RDF.type), type, graph, null)); for (int i = 0; i < c.getElements().size(); i++) { Term element = c.getElements().get(i); - containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, new IRITerm("http://www.w3.org/1999/02/22-rdf-syntax-ns#_" + (i + 1)), termItselfOrCollectionId(element), graph, null)); + containerStmts.add(new RdfStatement((BlankNodeOrIRI) subject, rdfUnderscore(i + 1), termItselfOrCollectionId(element), graph, null)); } } private Term rewrite(Term t) { if (t instanceof RdfListTerm && ((RdfListTerm) t).getElements().isEmpty()) { - return new IRITerm(RDF.nil.getURI()); + return iriTerm(RDF.nil); } return termItselfOrCollectionId(t); } diff --git a/src/main/java/burp/model/Template.java b/src/main/java/burp/model/Template.java index 7403aae..ed5b1fd 100644 --- a/src/main/java/burp/model/Template.java +++ b/src/main/java/burp/model/Template.java @@ -101,6 +101,7 @@ yield switch (safety) { .collect(Collectors.toList()); } + private static final Pattern bracesPattern = Pattern.compile("(? references() { List list = new ArrayList<>(); Matcher m = bracesPattern.matcher(template); @@ -206,10 +207,15 @@ private List constructSegmentsRangeAndReference(List segme return constructedSegments; } + private static final Pattern unescapePattern = Pattern.compile("\\\\([{}\\\\])"); + /** + * Unescapes the escaping backslash from \{ and \} and \\. + */ private String escape(String s) { - return s.replace("\\\\{", "{").replace("\\\\}", "}"); + if (s == null || s.indexOf('\\') < 0) return s; + return unescapePattern.matcher(s).replaceAll("$1"); } - private static final Pattern bracesPattern = Pattern.compile("(? Date: Fri, 17 Jul 2026 13:13:49 +0200 Subject: [PATCH 38/45] refactor: unify buggy test filtering logic across modules, disable RDF1.2 tests --- src/test/java/burp/TestRMLIO.java | 16 ++------------ src/test/java/burp/TestRMLIORegistry.java | 15 +++++++++++++ src/test/java/burp/TestRMLModule.java | 21 ++++++++++++++----- .../java/turtleprov/Rdf12ManifestTest.java | 3 +++ 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/src/test/java/burp/TestRMLIO.java b/src/test/java/burp/TestRMLIO.java index c849109..8579153 100644 --- a/src/test/java/burp/TestRMLIO.java +++ b/src/test/java/burp/TestRMLIO.java @@ -1,6 +1,5 @@ package burp; -import java.util.HashSet; import java.util.List; public class TestRMLIO extends TestRMLModule { @@ -9,8 +8,8 @@ public String getBase() { return "./target/test-classes/rml-io/"; } - private boolean isIgnored(String id) { - var buggyTests = List.of( + public List buggyTests() { + return List.of( // https://github.com/kg-construct/rml-io/issues/167 "RMLSTC0011a", "RMLSTC0011b", @@ -33,16 +32,5 @@ private boolean isIgnored(String id) { "RMLTTC0006d", "RMLTTC0006e" ); - return (new HashSet<>(buggyTests)).contains(id); - } - - @Override - protected java.util.stream.Stream testDataProviderOK() throws java.io.IOException, com.opencsv.exceptions.CsvException { - return super.testDataProviderOK().filter(t -> !isIgnored(t.ID)); - } - - @Override - protected java.util.stream.Stream testDataProviderNotOK() throws java.io.IOException, com.opencsv.exceptions.CsvException { - return super.testDataProviderNotOK().filter(t -> !isIgnored(t.ID)); } } diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java index deecd52..7a3cf9a 100644 --- a/src/test/java/burp/TestRMLIORegistry.java +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -18,6 +18,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.List; @Testcontainers public class TestRMLIORegistry extends TestRMLModule { @@ -29,6 +30,20 @@ public String getBase() { return base; } + @Override + public List buggyTests() { + return List.of( + // td:Thing not yet implemented + "RMLIOREGTC0008a", + // Kafka not supported + "RMLIOREGTC0009a", + // MQTT not supported + "RMLIOREGTC0010a", + // Flaky test due to dbpedia.org access and data changes + "RMLIOREGTC0011a" + ); + } + @Override public void prepareSource(TestData testData) throws Exception { String mappingPath = new File(base + testData.ID, testData.mapping).getAbsolutePath(); diff --git a/src/test/java/burp/TestRMLModule.java b/src/test/java/burp/TestRMLModule.java index 2aadb4e..8b8d9ed 100644 --- a/src/test/java/burp/TestRMLModule.java +++ b/src/test/java/burp/TestRMLModule.java @@ -35,12 +35,15 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.*; @TestInstance(TestInstance.Lifecycle.PER_CLASS) public abstract class TestRMLModule { + public List buggyTests() { + return Collections.emptyList(); + } + public abstract String getBase(); public Stream loadTestData() throws IOException, CsvException { @@ -61,7 +64,11 @@ public Stream loadTestData() throws IOException, CsvException { } protected Stream testDataProviderOK() throws IOException, CsvException { - List list = loadTestData().filter(t -> !t.error).toList(); + var buggyTests = new HashSet<>(buggyTests()); + List list = loadTestData() + .filter(t -> !t.error) + .filter(t -> !buggyTests.contains(t.ID)) + .toList(); if (list.isEmpty()) { return Stream.of(new TestData(java.util.Map.of("ID", "dummy", "error", "false"))); } @@ -69,7 +76,11 @@ protected Stream testDataProviderOK() throws IOException, CsvException } protected Stream testDataProviderNotOK() throws IOException, CsvException { - List list = loadTestData().filter(t -> t.error).toList(); + var buggyTests = new HashSet<>(buggyTests()); + List list = loadTestData() + .filter(t -> t.error) + .filter(t -> !buggyTests.contains(t.ID)) + .toList(); if (list.isEmpty()) { return Stream.of(new TestData(java.util.Map.of("ID", "dummy", "error", "true"))); } @@ -302,7 +313,7 @@ public void testForNotOK(TestData testData, String mappingPath) throws Exception writer.flush(); } - assertTrue(exit > 0); + assertNotEquals(0, exit); assertFalse(report.isEmpty()); long countErrors = getCountErrors(report); diff --git a/src/test/java/turtleprov/Rdf12ManifestTest.java b/src/test/java/turtleprov/Rdf12ManifestTest.java index 30c1f16..0665dfe 100644 --- a/src/test/java/turtleprov/Rdf12ManifestTest.java +++ b/src/test/java/turtleprov/Rdf12ManifestTest.java @@ -1,8 +1,11 @@ package turtleprov; +import org.junit.jupiter.api.Disabled; + import java.nio.file.Path; import java.nio.file.Paths; +@Disabled public class Rdf12ManifestTest extends AbstractManifestTest { @Override public Path rootManifestFile() { From 220adecbece611f7676672b317d628fb76415bce Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Fri, 17 Jul 2026 13:14:32 +0200 Subject: [PATCH 39/45] test: Update rml-io-registry --- rml-modules/rml-io-registry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rml-modules/rml-io-registry b/rml-modules/rml-io-registry index d008dbc..3bb0c3c 160000 --- a/rml-modules/rml-io-registry +++ b/rml-modules/rml-io-registry @@ -1 +1 @@ -Subproject commit d008dbc8ec44e6e1e9f48547e221b4b16d125be4 +Subproject commit 3bb0c3ce7ada75d053d584faa58361ab74b6fdbd From 98ec92886b3f15fdca3125695b33f7908360057c Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Fri, 17 Jul 2026 15:25:39 +0200 Subject: [PATCH 40/45] chore: sign maven build, bump version 0.1.3 --- .github/workflows/deploy.yml | 10 ++++++--- pom.xml | 39 +++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d3f1f24..05a242f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,8 +2,6 @@ name: Deploy on: push: - branches: - - main tags: - 'v*' @@ -33,7 +31,13 @@ jobs: gpg-private-key: ${{ secrets.GPG_ARMOR_KEY }} gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Deploy Maven package - run: mvn deploy -B -Pdeploy + # Locally run instead: mvn clean deploy -DskipTests -Pdeploy -Dgpg.passphrase="" + run: mvn deploy -B -Pdeploy -Dgpg.signer=bc -DskipTests + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + MAVEN_GPG_KEY: ${{ secrets.GPG_ARMOR_KEY }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: JReleaser Release run: mvn jreleaser:full-release -B -Pdeploy env: diff --git a/pom.xml b/pom.xml index d93540e..4e1ed68 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.github.kg-construct burp - 0.1.7 + 0.1.3 BURP A Basic and Unassuming RML Processor (BURP) with RML Execution Report (RER) error handling @@ -348,6 +348,9 @@ org.apache.maven.plugins maven-javadoc-plugin 3.7.0 + + -Xdoclint:none + attach-javadocs @@ -365,6 +368,8 @@ deploy + + org.apache.maven.plugins maven-shade-plugin @@ -407,6 +412,38 @@ + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + sign-artifacts + verify + + sign + + + + + + + + dev.sigstore + sigstore-maven-plugin + 0.4.0 + + + sign + + sign + + + + + + org.sonatype.central From 5d07e9ebdf5378d2952eb0e98736f5ad7e07f73a Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Fri, 17 Jul 2026 15:39:55 +0200 Subject: [PATCH 41/45] chore: allow token for sigstore --- .github/workflows/deploy.yml | 1 + .idea/vcs.xml | 6 ++++++ pom.xml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 05a242f..dc66f20 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,6 +13,7 @@ jobs: permissions: contents: write issues: write + id-token: write steps: - name: Checkout code uses: actions/checkout@v6 diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 97a37e7..fec1c04 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,12 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4e1ed68..d3d5d97 100644 --- a/pom.xml +++ b/pom.xml @@ -432,7 +432,7 @@ dev.sigstore sigstore-maven-plugin - 0.4.0 + 2.2.0 sign From db9a177adc4a5729a117bb6caec6c20ffcb4974d Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Fri, 17 Jul 2026 16:04:53 +0200 Subject: [PATCH 42/45] chore: fix deployment of maven artefacts --- .github/workflows/deploy.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dc66f20..3e4f31e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,16 +27,15 @@ jobs: distribution: 'temurin' cache: 'maven' server-id: central - server-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - server-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - gpg-private-key: ${{ secrets.GPG_ARMOR_KEY }} - gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy - name: Deploy Maven package # Locally run instead: mvn clean deploy -DskipTests -Pdeploy -Dgpg.passphrase="" run: mvn deploy -B -Pdeploy -Dgpg.signer=bc -DskipTests env: MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + # ASCII-armored secret key (TSK), e.g. from `gpg --armor --export-secret-keys YOUR_ID` MAVEN_GPG_KEY: ${{ secrets.GPG_ARMOR_KEY }} MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: JReleaser Release From f570980d7817e50b6c5964d23e13214688920fdb Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 22 Jul 2026 09:34:58 +0200 Subject: [PATCH 43/45] ci: source version from the tag for the deployment --- .github/workflows/deploy.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3e4f31e..1b19694 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,6 +29,14 @@ jobs: server-id: central server-username: MAVEN_USERNAME # env variable for username in deploy server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy + - name: Set project version from tag + run: | + TAG_VERSION="${{ github.ref_name }}" + # Remove leading 'v' if present (e.g. v0.1.4 -> 0.1.4) + TAG_VERSION="${TAG_VERSION#v}" + + echo "Updating pom.xml version to: $TAG_VERSION" + mvn versions:set -DnewVersion="$TAG_VERSION" -DgenerateBackupPoms=false -B - name: Deploy Maven package # Locally run instead: mvn clean deploy -DskipTests -Pdeploy -Dgpg.passphrase="" run: mvn deploy -B -Pdeploy -Dgpg.signer=bc -DskipTests From c0f3b2643c0d0f2c2f6c612d91096793b16a4f98 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 22 Jul 2026 10:39:34 +0200 Subject: [PATCH 44/45] build: ensure full pom is used --- .gitignore | 4 ---- pom.xml | 13 +++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 8fd0983..b4f959b 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,3 @@ BURP.iml .idea/jarRepositories.xml .idea/modules.xml .idea/workspace.xml - -src/main/resources/shapes/rml-* -src/main/resources/vocabularies/rml -src/test/resources/rml-* \ No newline at end of file diff --git a/pom.xml b/pom.xml index d3d5d97..1df921a 100644 --- a/pom.xml +++ b/pom.xml @@ -8,8 +8,9 @@ 0.1.3 BURP - A Basic and Unassuming RML Processor (BURP) with RML Execution Report (RER) error handling - + + A Basic and Unassuming RML Processor (BURP) with RML Execution Report (RER) error handling + https://github.com/kg-construct/BURP/ 2024 @@ -381,6 +382,7 @@ shade + false true - A Basic and Unassuming RML Processor (BURP) with RML Execution Report - (RER) - error handling - + + A Basic and Unassuming RML Processor (BURP) with RML Execution Report (RER) error handling + Jakub Duchateau, Christophe Debruyne MIT From 71aca2e2ae1db14d7a3c81206c4f5a4beb31d2e6 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Wed, 22 Jul 2026 11:05:57 +0200 Subject: [PATCH 45/45] refactor: update JNC dependency to version 1.3.0 and adjust package import path --- pom.xml | 3 +-- src/main/java/burp/ls/NetconfQuerySource.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1df921a..8633c44 100644 --- a/pom.xml +++ b/pom.xml @@ -683,8 +683,7 @@ com.github.candil-data-fabric JNC - - xpath-namespace-SNAPSHOT + 1.3.0 diff --git a/src/main/java/burp/ls/NetconfQuerySource.java b/src/main/java/burp/ls/NetconfQuerySource.java index 4978bf3..096ccd4 100644 --- a/src/main/java/burp/ls/NetconfQuerySource.java +++ b/src/main/java/burp/ls/NetconfQuerySource.java @@ -9,7 +9,7 @@ import burp.reporting.Origin; import burp.util.SimpleNamespaceContext; import burp.vocabularies.YS; -import com.tailf.jnc.*; +import com.github.candildatafabric.jnc.*; import org.apache.commons.io.IOUtils; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement;