diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index f9a5477a..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Java CI with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - name: Run Unit Tests - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Set up JDK 21 - uses: actions/setup-java@v3 - with: - java-version: '21' - distribution: 'temurin' - cache: 'maven' - - name: Build and test with Maven - run: mvn test - - name: Publish Test Report - uses: mikepenz/action-junit-report@v6.0.0 - if: success() || failure() # always run even if the previous step fails - with: - report_paths: '**/target/surefire-reports/TEST-*.xml' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..1b19694b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,55 @@ +name: Deploy + +on: + push: + tags: + - 'v*' + +jobs: + deploy: + name: Deploy Release + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + id-token: write + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + submodules: true + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + 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 + 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 + 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/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..ebcf362e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Run Unit Tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + submodules: true + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + cache: '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 + if: success() || failure() # always run even if the previous step fails + with: + report_paths: '**/target/surefire-reports/TEST-*.xml' diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..9c2b66f1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,22 @@ +[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 +[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 aa00ffab..051e40b8 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,6 +1,16 @@ + + + + + + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml index 9f12a696..7fb48768 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 35eb1ddf..fec1c04d 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,12 @@ + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 56d03ca5..7cf7a97d 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,58 @@ -# 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) | ✔️ 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) | ✅️ 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: + +- 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 +69,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 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 +100,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/fetch-test-cases.bat b/fetch-test-cases.bat deleted file mode 100644 index c0586723..00000000 --- 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 fb070632..00000000 --- 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." diff --git a/pom.xml b/pom.xml index 6dc54d76..8633c449 100644 --- a/pom.xml +++ b/pom.xml @@ -2,15 +2,54 @@ 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 - Basic and Unassuming RML Processor + burp + 0.1.3 + + BURP + + 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 + 2.0.5 @@ -29,17 +68,247 @@ **/*.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 - 3.8.1 + 3.11.0 - 17 + 21 + 21 + 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 + --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 @@ -80,6 +349,9 @@ org.apache.maven.plugins maven-javadoc-plugin 3.7.0 + + -Xdoclint:none + attach-javadocs @@ -97,6 +369,8 @@ deploy + + org.apache.maven.plugins maven-shade-plugin @@ -108,18 +382,19 @@ shade + false 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 +413,152 @@ + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + sign-artifacts + verify + + sign + + + + + + + + dev.sigstore + sigstore-maven-plugin + 2.2.0 + + + sign + + sign + + + + + + + + + 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 + kg-construct + jbang-catalog + + + jduchateau + jduchateau@users.noreply.github.com + + + + + + + @@ -150,40 +571,72 @@ 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 + jsonpath4k-jvm + 3.1.1 + + + com.strumenta + antlr-kotlin-runtime-jvm + 1.0.8 - mysql - mysql-connector-java - 8.0.33 + org.jetbrains.kotlinx + kotlinx-serialization-json-jvm + 1.6.3 + + + org.mongodb + bson-kotlinx + 5.9.0 + + + com.mysql + mysql-connector-j + 9.3.0 org.postgresql @@ -193,7 +646,7 @@ com.microsoft.sqlserver mssql-jdbc - 12.6.1.jre11 + 13.2.1.jre11 org.xerial @@ -205,6 +658,41 @@ 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 + 1.3.0 + + + + + com.google.auto.service + auto-service-annotations + 1.1.1 + compile + @@ -220,50 +708,40 @@ test - org.junit.jupiter - junit-jupiter-params - 5.10.2 - test - - - org.testcontainers - junit-jupiter - 1.19.5 + org.junit.jupiter + junit-jupiter-params + 5.10.2 test org.testcontainers - postgresql - 1.19.5 + testcontainers-junit-jupiter + ${testcontainers.version} test org.testcontainers - mysql - 1.19.5 + testcontainers-postgresql + ${testcontainers.version} test - org.apache.jena - jena-fuseki-main - 4.10.0 + org.testcontainers + testcontainers-mysql + ${testcontainers.version} test - - - org.tukaani - xz - 1.9 - - com.univocity - univocity-parsers - 2.9.1 + org.testcontainers + testcontainers-mssqlserver + ${testcontainers.version} + test - com.github.candil-data-fabric - JNC - xpath-namespace-SNAPSHOT + org.apache.jena + jena-fuseki-main + ${jena.version} + test diff --git a/rml-modules/rml-cc b/rml-modules/rml-cc new file mode 160000 index 00000000..d97fddf0 --- /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 00000000..82ab28d4 --- /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 00000000..df68527f --- /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 00000000..980b9062 --- /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 00000000..3bb0c3ce --- /dev/null +++ b/rml-modules/rml-io-registry @@ -0,0 +1 @@ +Subproject commit 3bb0c3ce7ada75d053d584faa58361ab74b6fdbd diff --git a/rml-modules/rml-lv b/rml-modules/rml-lv new file mode 160000 index 00000000..a6a23ddc --- /dev/null +++ b/rml-modules/rml-lv @@ -0,0 +1 @@ +Subproject commit a6a23ddcd040f313d1ec7fe38668fc09a9ca07c0 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 00000000..b2090bb4 --- /dev/null +++ b/src/main/antlr4/burp/parse/turtleprov/Turtle.g4 @@ -0,0 +1,418 @@ +/* + [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' + | '\u{10000}' .. '\u{EFFFF}' + ; + +// [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 d7ac6597..da96ddcf 100644 --- a/src/main/java/burp/Main.java +++ b/src/main/java/burp/Main.java @@ -1,303 +1,288 @@ 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.print(PlainTextReportGenerator.generateTextReport(report)); + 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 00000000..edf173a0 --- /dev/null +++ b/src/main/java/burp/NQuadsWriter.java @@ -0,0 +1,177 @@ +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) { + write(output, statements, StandardCharsets.UTF_8); + } + + public static void write(OutputStream output, List statements, Charset charset) { + 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 00000000..62a2f066 --- /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 00000000..09b245d1 --- /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 6910aaf1..12001672 100644 --- a/src/main/java/burp/ls/CSVSource.java +++ b/src/main/java/burp/ls/CSVSource.java @@ -1,108 +1,105 @@ 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); - } - } - -} +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; -class CSVIteration extends Iteration { - - // 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); - - 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 List getStringsFor(String reference) { - return getValuesFor(reference).stream().map(Object::toString).collect(Collectors.toList()); - } +public class CSVSource extends FileBasedLogicalSource { + public char delimiter = ','; + public char quoteChar = '"'; + public String commentPrefix = null; + public boolean trim = false; + public boolean firstLineIsHeader = true; @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."); + 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) + .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; + } + + // 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(); + 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]; + for (int i = 0; i < columnCount; i++) { + header[i] = String.valueOf(i + 1); + } + } + + 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)); + } + } + return iterations; + } catch (BurpException e) { + throw e; + } catch (Exception e) { + throw new BurpException(new RmlError(e.getMessage(), new Origin(this, null), RER.Error, e)); } - return stringWriter.toString(); } + @Override + public Resource getReferenceFormulation() { + return RML.CSV; + } + + @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 00000000..f5fefb19 --- /dev/null +++ b/src/main/java/burp/ls/CSVSourceProvider.java @@ -0,0 +1,160 @@ +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.Set; +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)) { + 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.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; + } + } + + 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; + } + + 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 { + CSVReader reader = new CSVReader(new StringReader(payload)); + List all = reader.readAll(); + reader.close(); + if (all.isEmpty()) return Collections.emptyList(); + String[] header = all.removeFirst(); + 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 00000000..16cfca21 --- /dev/null +++ b/src/main/java/burp/ls/FileBaseSourceProvider.java @@ -0,0 +1,155 @@ +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 org.jspecify.annotations.Nullable; + +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)) { + @Nullable 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(); + 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 + ) + ); + } + + 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/ls/FileBasedLogicalSource.java b/src/main/java/burp/ls/FileBasedLogicalSource.java index b9c6f6c0..b4b49e28 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 eec35805..00000000 --- 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 00000000..0f775a9d --- /dev/null +++ b/src/main/java/burp/ls/JSONSourceProvider.java @@ -0,0 +1,121 @@ +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.*; +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(); + var iteratorOrigin = ls.getProperty(RML.iterator); + + FileBaseSourceProvider.FileAndOrigin fileAndOrigin = FileBaseSourceProvider.getFile(source, mappingDirectory, currentWorkingDirectory); + + JSONSourceRFC jsonSource = new JSONSourceRFC(); + 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)); + + return jsonSource; + } + + @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 + ) + ); + } + JsonPath jsonPath = new JsonPath( + iterator, new AntlrJsonPathCompiler(listener), 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 || 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 + ) + ); + } + 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, referenceFormulationOrigin); + } +} diff --git a/src/main/java/burp/ls/JSONSourceRFC.java b/src/main/java/burp/ls/JSONSourceRFC.java new file mode 100644 index 00000000..f0523121 --- /dev/null +++ b/src/main/java/burp/ls/JSONSourceRFC.java @@ -0,0 +1,291 @@ +package burp.ls; + +import at.asitplus.jsonpath.JsonPath; +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.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.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.*; + +import static java.util.Arrays.stream; +import static java.util.stream.Collectors.joining; + +public class JSONSourceRFC extends FileBasedLogicalSource { + public String iterator; + public StatementParts iteratorOrigin; + + @Override + public Iterable iterator() { + try { + String decompressedFile = getDecompressedFile(); + Path decompressedFilePath = Paths.get(decompressedFile); + + String jsonString; + if (decompressedFile.endsWith(".bson")) { + 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(decompressedFilePath, encoding); + } + + JsonElement jsonContent = Json.Default.parseToJsonElement(jsonString); + + 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<>(); + 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, List.of(iteratorOrigin)), RER.LogicalSourceError, exception, null)); + } + } + + @Override + public Resource getReferenceFormulation() { + return RML.JSONPath; + } + + @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; + CapturingErrorListener listener = new CapturingErrorListener(); + try { + if (reference != null) { + cp = new JsonPath(reference, new AntlrJsonPathCompiler(listener), JsonPath.Companion.getDefaultFunctionExtensionRepository()::getExtension); + } + } catch (BurpException be) { + throw be; + } catch (Exception 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; + } + + @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 -> + // 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 = parseJsonPrimitive(p); + if (!jsonIteration.getNulls().contains(content)) resultList.add(content); + } + default -> { + } + } + } + } catch (BurpException ex) { + throw ex; + } catch (Exception 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 { + public final NodeListEntry json; + + public JSONIteration(NodeListEntry json, Set nulls) { + super(nulls); + this.json = json; + } + + @Override + public String asString() { + return json.getValue().toString(); + } +} + +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/ls/LogicalSourceFactory.java b/src/main/java/burp/ls/LogicalSourceFactory.java index edbc7040..900499a4 100644 --- a/src/main/java/burp/ls/LogicalSourceFactory.java +++ b/src/main/java/burp/ls/LogicalSourceFactory.java @@ -1,413 +1,89 @@ 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 org.jetbrains.annotations.NotNull; -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("\\", ""); + private static final ServiceLoader LOADER = ServiceLoader.load(LogicalSourceProvider.class); - source.nulls.addAll(getNullValues(ls)); + private LogicalSourceFactory() {} - return source; - } - - 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; - } - - // 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; - } + 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); + } + } - 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; + 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 + ) + ); + } - } 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; + public static List changeIterator( + @NotNull String iterationAsString, + @NotNull Resource referenceFormulation, + String iterator, + Origin referenceFormulationOrigin + ) { + for (LogicalSourceProvider provider : LOADER) { + if (provider.supports(referenceFormulation)) { + return provider.parseStringPayload(iterationAsString, iterator, referenceFormulationOrigin); + } + } - } 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); + throw new BurpException( + new RmlError( + "Reference formulation not supported for nested string iterations: " + referenceFormulation, + referenceFormulationOrigin, + RER.UnsupportedMapping + ) + ); + } - 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 + ) + ); } } diff --git a/src/main/java/burp/ls/LogicalSourceProvider.java b/src/main/java/burp/ls/LogicalSourceProvider.java new file mode 100644 index 00000000..374df23a --- /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 e6218a27..096ccd41 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.github.candildatafabric.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,8 +46,11 @@ class NetconfQuerySource extends LogicalSource { public Resource filter; public HashMap rmlPrefixMap; + public String iterator; + public Resource referenceFormulation; + public Resource getReferenceFormulation() { return referenceFormulation; } - protected List iterations = null; + protected List iterations = null; public Charset encoding = StandardCharsets.UTF_8; private final Map datastoreMap = Map.ofEntries( @@ -62,7 +61,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 +147,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 897c9166..a26cdf9f 100644 --- a/src/main/java/burp/ls/RDBSource.java +++ b/src/main/java/burp/ls/RDBSource.java @@ -1,127 +1,214 @@ 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.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; +import java.sql.*; +import java.util.*; + +public class RDBSource extends LogicalSource { + public Path currentWorkingDirectory; + public String jdbcDriver; + @NonNull public String jdbcDSN; + public String password; + public String username; + public String query; + public Statement queryStmt; + + protected Resource referenceFormulation; -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); - } - } + 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); + 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.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 = DriverManager.getConnection(resolvedJdbcDSN, props); + + var 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); + } + + final Connection finalConnection = connection; + return () -> new Iterator<>() { + @Override + public boolean hasNext() { + try { + boolean goNext = resultset.next(); + if (!goNext) { + resultset.close(); + statement.close(); + finalConnection.close(); + } + return goNext; + } catch (SQLException e) { + throw new BurpException( + new RmlError("Problem querying database while iterating over rows.", null, RER.LogicalSourceError, e) + ); + } + } + + @Override + public Iteration next() { + return new RDBIteration(resultset, indexMap, getNulls()); + } + }; + } catch (SQLSyntaxErrorException e) { + 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)); + } + } + + + @Override + public Reference buildExportedReference(String reference, Origin origin) { + synchronized (referenceOrigins) { + referenceOrigins.putIfAbsent(reference, origin); + } + return new RDBReference(reference, origin); + } } -class RDBIteration extends Iteration { +class RDBReference extends Reference { + public RDBReference(String reference, Origin origin) { + super(reference, origin); + } + + @Override + public List getValues(Iteration i) { + if (!(i instanceof RDBIteration rdbIteration)) + throw new IllegalArgumentException("RDBReference can only be used with RDBIteration."); - 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; - } + List l = new ArrayList<>(); + String columnName = StringEscapeUtils.unescapeJava(reference).trim(); + String matchedKey = getMatchedKey(rdbIteration, columnName); + + Object value = rdbIteration.values.get(matchedKey); + if (value != null && !rdbIteration.getNulls().contains(value)) { + l.add(value); + } + + return l; + } + + protected static boolean isQuoted(String columnName) { + return (columnName.startsWith("\"") && columnName.endsWith("\"")) + || (columnName.startsWith("`") && columnName.endsWith("`")) + || (columnName.startsWith("[") && columnName.endsWith("]")) + || (columnName.startsWith("'") && columnName.endsWith("'")); + } + + 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); + } + + if (matchedKey == null) { + throw new BurpException(new RmlError("Attribute " + columnName + " does not exist.", origin, RER.ReferenceFormulationExecutionError)); + } + return matchedKey; + } +} + +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 00000000..cc6c332f --- /dev/null +++ b/src/main/java/burp/ls/RDBSourceProvider.java @@ -0,0 +1,48 @@ +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.referenceFormulation = 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; // 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; + + 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 00000000..8d71f3fb --- /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.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 2de1b886..aaa5f9c6 100644 --- a/src/main/java/burp/ls/SPARQLFileSource.java +++ b/src/main/java/burp/ls/SPARQLFileSource.java @@ -1,120 +1,152 @@ 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 final 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 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); + boolean isCSV = burp.vocabularies.RML.SPARQL_Results_CSV.equals(referenceFormulation); + return new SPARQLReference(reference, origin, isCSV); + } +} + +class SPARQLReference extends Reference { + 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 sqIteration)) { + throw new IllegalArgumentException("SPARQLReference can only be used with SPARQLIteration."); + } + List l = new ArrayList<>(); + RDFNode n = sqIteration.sol != null ? sqIteration.sol.get(reference) : null; + if (n != null && !sqIteration.getNulls().contains(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; + } +} -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 SPARQLTSVReference extends Reference { + public SPARQLTSVReference(String reference, Origin origin) { + super(reference, origin); + } + @Override + public List getValues(Iteration i) { + if (!(i instanceof SPARQLTSVIteration sqIteration)) { + throw new IllegalArgumentException("SPARQLTSVReference can only be used with SPARQLTSVIteration."); + } + 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 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 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 abb6989c..40ffbdb9 100644 --- a/src/main/java/burp/ls/SPARQLServiceSource.java +++ b/src/main/java/burp/ls/SPARQLServiceSource.java @@ -1,51 +1,92 @@ package burp.ls; -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; +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.List; -class SPARQLServiceSource extends LogicalSource { +public class SPARQLServiceSource extends LogicalSource { + private final boolean isTSV; + private Resource referenceFormulation; + private List iterations; - private List iterations = null; - private final boolean isTSV; + public String iterator; + public Origin iteratorOrigin; + public String endpoint; - public String iterator; - public String endpoint; + public SPARQLServiceSource(boolean isTSV, Resource referenceFormulation) { + this.isTSV = isTSV; + this.referenceFormulation = referenceFormulation; + } - public SPARQLServiceSource(boolean isTSV) { - this.isTSV = isTSV; - } + @Override + public Resource getReferenceFormulation() { + return referenceFormulation; + } - @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); + 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/ls/SPARQLSourceProvider.java b/src/main/java/burp/ls/SPARQLSourceProvider.java new file mode 100644 index 00000000..1fce546a --- /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 00000000..b70c174f --- /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 00000000..4b95fa12 --- /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 00000000..624f3767 --- /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 ba3dbe65..0cfcce0a 100644 --- a/src/main/java/burp/ls/XMLSource.java +++ b/src/main/java/burp/ls/XMLSource.java @@ -1,176 +1,92 @@ 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); - } - } - -} +import java.util.Map; -class XMLIteration extends Iteration { +public class XMLSource extends FileBasedLogicalSource { + private List iterations = null; + public String iterator; + public Origin iteratorOrigin; + public Map prefixMap; - private final Node node; - private final HashMap prefixMap; - - protected XMLIteration(Node node, Set nulls, HashMap prefixMap) { - super(nulls); - - 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 (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 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) { + iterations.add(new XMLIteration(item, getNulls(), xPathCompiler)); + } + } + + return iterations; + + } 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 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 00000000..0cb6ac21 --- /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 ec463091..ef6453e0 100644 --- a/src/main/java/burp/model/AbstractLogicalSource.java +++ b/src/main/java/burp/model/AbstractLogicalSource.java @@ -1,13 +1,35 @@ package burp.model; -import org.apache.jena.rdf.model.Resource; -import java.util.*; +import burp.model.lv.FieldParent; +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 00000000..7cb9020b --- /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 00000000..ca79278b --- /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 aa524326..5e1c7183 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 2e231578..b4fdf59d 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 00000000..0770e827 --- /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 b40b988a..24acbe39 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 deleted file mode 100644 index 83395558..00000000 --- a/src/main/java/burp/model/ExpressionField.java +++ /dev/null @@ -1,25 +0,0 @@ -package burp.model; - -import java.util.ArrayList; -import java.util.Iterator; -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()))){ - 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/ExpressionMap.java b/src/main/java/burp/model/ExpressionMap.java index c078d979..302611ad 100644 --- a/src/main/java/burp/model/ExpressionMap.java +++ b/src/main/java/burp/model/ExpressionMap.java @@ -1,304 +1,361 @@ 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 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 burp.model.fnml.FunctionExecution; +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 java.util.*; +import java.util.concurrent.ConcurrentHashMap; + +public abstract class ExpressionMap implements LogicalTargetScope, PlanNode { + + private Expression expression = null; + private Origin expressionOrigin = null; + private final Set logicalTargets = new HashSet<>(); + private PlanNode parent = null; + + private String baseIRI = null; + + public Expression getExpression() { + return expression; + } + + public void setExpression(Expression expression) { + this.expression = expression; + } + + public Origin getExpressionOrigin() { + return expressionOrigin; + } + + public void setExpressionOrigin(Origin expressionOrigin) { + this.expressionOrigin = expressionOrigin; + } + + @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() { + List children = new ArrayList<>(); + if (expression != null) { + children.add(expression); + } + return children; + } + + @Override + public Iterable dependencies() { + return children(); + } + + private String getBaseIRI() { + if (baseIRI == null) { + BaseIRIScope scope = (BaseIRIScope) ancestor(BaseIRIScope.class); + if (scope != null) { + baseIRI = scope.getBaseIri(); + } + } + return baseIRI; + } + + @SuppressWarnings("unchecked") + public List generateValues(Iteration i, TemplateReferenceSafety safe) { + switch (expression) { + case RDFNodeConstant expr -> { + List list = new ArrayList<>(); + if (expr.constant != null) { + list.add(expr.constant); + } + return list; + } + 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, + RER.UnsupportedMapping + ) + ); + } + } -public abstract class ExpressionMap { - - 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."); - } - - protected List generateURIs(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. But we need to test whether it is - // a URI. - - Resource r = ((RDFNodeConstant) expression).constant.asResource(); - - try { - new URI(r.getURI()); - } catch (Exception e) { - throw new RuntimeException("This is not a valid URI."); + 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 { + 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; + } - set.add(((RDFNodeConstant) expression).constant.asResource()); - return set; + 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 { + 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 result; + } + + public List generateURIs(Iteration i) { + Set targets = getEffectiveTargets(); + List values = generateValues(i, TemplateReferenceSafety.SAFE_URI); + List result = new ArrayList<>(); - if(expression instanceof Template) { - for(String v : ((Template) expression).values(i, true)) { + for (Object it : values) { + if (it == null) continue; + 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(); + } - 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"); + 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 set; } + return result; + } - if(expression instanceof Reference) { - for(Object v : ((Reference) expression).values(i)) { - String s = v.toString(); + protected List generateBlankNodes(Iteration i) { + Set targets = getEffectiveTargets(); - 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"); + switch (expression) { + case RDFNodeConstant expr -> { + if (expr.constant instanceof BlankNodeTerm constant) { + return Collections.singletonList(new BlankNodeTerm(constant.id(), targets)); + } else { + return Collections.emptyList(); + } + } + 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(); } - return set; + 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 + ) + ); } + } - if(expression instanceof FunctionExecution) { - for(Object v : ((FunctionExecution) expression).values(i, baseIRI)) { - String s = v.toString(); + private BlankNodeTerm blankNodeFor(Object value, Set targets) { + String id = blankNodeMap.computeIfAbsent(value, k -> "bnode-" + (blankNodeIdCounter++)); + return new BlankNodeTerm(id, targets); + } - 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"); + 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; + } + + 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(); + + 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(); + } + } + 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(); } - return set; + 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 + ) + ); + } + } + + private List literalFor(Object value, List datatypes, List languages, Set baseTargets) { + if (value == null) { + return Collections.emptyList(); } - throw new RuntimeException("Error generating IRI."); + if (languages != null) { + return languages.stream() + .map(langTag -> new LiteralTerm(value.toString(), null, langTag.tag(), intersectTargets(baseTargets, langTag.targets()))) + .toList(); + } + if (datatypes != null) { + return datatypes.stream() + .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 { + 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 deleted file mode 100644 index c57efe63..00000000 --- a/src/main/java/burp/model/Field.java +++ /dev/null @@ -1,75 +0,0 @@ -package burp.model; - -import java.util.ArrayList; -import java.util.List; - -public abstract class Field implements ContainsFields, FieldParent { - - public String fieldName ; - public FieldParent parent; - - public List expressionFields = new ArrayList<>(); - public List iterableFields = new ArrayList<>(); - - public static List expand(List list, List expressionFields, List iterableFields) { - List result = new ArrayList<>(list); - - if (expressionFields != null && !expressionFields.isEmpty()) { - // Let's process the expression fields - for (ExpressionField expressionField : expressionFields) { - List nlist = new ArrayList<>(); - for (LogicalIteration li : result) { - nlist.addAll(expressionField.enrich(li)); - } - result = nlist; - } - } - - if (iterableFields != null && !iterableFields.isEmpty()) { - // Let's process the iterable fields - List nlist = new ArrayList<>(); - for (LogicalIteration li : result) { - for (IterableField iterableField : iterableFields) { - nlist.addAll(iterableField.enrich(li)); - } - } - result = nlist; - } - - return result; - } - - @Override - public String getAbsoluteFieldName() { - if (parent instanceof AbstractLogicalSource) - return fieldName; - - Field parent = (Field) this.parent; - return parent.getAbsoluteFieldName() + "." + fieldName; - } - - @Override - public List getIterableFields() { - return iterableFields; - } - - @Override - public List getExpressionFields() { - return expressionFields; - } - - @Override - public void addField(Field field) { - field.parent = this; - - if (field instanceof IterableField) { - getIterableFields().add((IterableField) field); - } else if (field instanceof ExpressionField) { - getExpressionFields().add((ExpressionField) field); - } - else - throw new RuntimeException("Unknown field type."); - } - -} - diff --git a/src/main/java/burp/model/FieldParent.java b/src/main/java/burp/model/FieldParent.java deleted file mode 100644 index 3915bbb6..00000000 --- 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/FilePathTarget.java b/src/main/java/burp/model/FilePathTarget.java new file mode 100644 index 00000000..2767d8df --- /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 00000000..e12df94b --- /dev/null +++ b/src/main/java/burp/model/FormulationIterable.java @@ -0,0 +1,7 @@ +package burp.model; + +import org.apache.jena.rdf.model.Resource; + +public interface FormulationIterable extends PlanNode { + Resource getReferenceFormulation(); +} \ No newline at end of file diff --git a/src/main/java/burp/model/FunctionExecution.java b/src/main/java/burp/model/FunctionExecution.java deleted file mode 100644 index d9346daa..00000000 --- a/src/main/java/burp/model/FunctionExecution.java +++ /dev/null @@ -1,68 +0,0 @@ -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; - } - -} \ 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 31711568..37d68d64 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/GatherMap.java b/src/main/java/burp/model/GatherMap.java deleted file mode 100644 index 2d6bab74..00000000 --- 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/GraphMap.java b/src/main/java/burp/model/GraphMap.java index 5c10e27d..3df3ed05 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 e6a3cba6..ea6a6c31 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 663a15f1..59aaffa8 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 3503f3d0..00000000 --- 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 deleted file mode 100644 index 3e3a321d..00000000 --- a/src/main/java/burp/model/IterableField.java +++ /dev/null @@ -1,54 +0,0 @@ -package burp.model; - -import burp.ls.LogicalSourceFactory; -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 String iterator; - public Resource referenceFormulation; - - 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/Iteration.java b/src/main/java/burp/model/Iteration.java index bfa29bd4..99bd7f3b 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 0aa3c9b3..0498b52c 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 244286ab..f940ce05 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 00000000..769ed727 --- /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 00000000..780f3f9b --- /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 2398e463..e049592d 100644 --- a/src/main/java/burp/model/LogicalSource.java +++ b/src/main/java/burp/model/LogicalSource.java @@ -1,11 +1,8 @@ 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 LogicalSource extends AbstractLogicalSource { - + @Override + public Iterable dependencies() { + return children(); + } } \ 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 00000000..4fe89c90 --- /dev/null +++ b/src/main/java/burp/model/LogicalTarget.java @@ -0,0 +1,53 @@ +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 final 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; + } + + @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; + } + + 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 00000000..6aa09d21 --- /dev/null +++ b/src/main/java/burp/model/LogicalTargetScope.java @@ -0,0 +1,24 @@ +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 lts) { + 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 5dec733d..00000000 --- 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 00000000..651e2154 --- /dev/null +++ b/src/main/java/burp/model/MappingDocument.java @@ -0,0 +1,197 @@ +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 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; + + 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); + } + + 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<>(); + List result = new ArrayList<>(); + + for (RdfStatementLike stmt : stmts) { + 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 rStmtGraph) { + 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(); + + 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, + iriTerm(RDF.first), + termItselfOrCollectionId(element), + graph, + null + )); + + Term restObj = isLast ? iriTerm(RDF.nil) : new BlankNodeTerm(subject.toString() + "_" + (i + 1)); + + containerStmts.add(new RdfStatement( + (BlankNodeOrIRI) currentListId, + iriTerm(RDF.rest), + restObj, + graph, + null + )); + + currentListId = restObj; + } + } + case RdfBagTerm rdfBagTerm -> + emitContainerStmts(c, subject, iriTerm(RDF.Bag), graph, containerStmts); + case RdfSeqTerm rdfSeqTerm -> + emitContainerStmts(c, subject, iriTerm(RDF.Seq), graph, containerStmts); + case RdfAltTerm rdfAltTerm -> + emitContainerStmts(c, subject, iriTerm(RDF.Alt), graph, containerStmts); + default -> { + } + } + } + } + + 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() + )) + .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, 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, rdfUnderscore(i + 1), termItselfOrCollectionId(element), graph, null)); + } + } + + private Term rewrite(Term t) { + if (t instanceof RdfListTerm && ((RdfListTerm) t).getElements().isEmpty()) { + return iriTerm(RDF.nil); + } + return termItselfOrCollectionId(t); + } + + private void extractAndMergeContainers(Term t, IRITerm graph, Map> containers, Map> expandedContainer, Consumer replaceTermBy) { + 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<>()); + 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 5155310b..e0d9c485 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 65e0a1b9..c04be8d2 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 00000000..66b03dfc --- /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 00000000..1e0bea1a --- /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 0a1e894b..c5fe6b53 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 d053a225..26d5232f 100644 --- a/src/main/java/burp/model/PredicateObjectMap.java +++ b/src/main/java/burp/model/PredicateObjectMap.java @@ -1,12 +1,82 @@ 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; + +import static burp.model.LogicalTarget.unionLogicalTargets; + +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(); + } + + 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, unionLogicalTargets(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, unionLogicalTargets(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 a8414a1f..8efbe504 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 deleted file mode 100644 index 29876bf1..00000000 --- a/src/main/java/burp/model/RMLFunction.java +++ /dev/null @@ -1,10 +0,0 @@ -package burp.model; - -import java.util.List; -import java.util.Map; - -public abstract class RMLFunction { - - abstract public List apply(Map map); - -} diff --git a/src/main/java/burp/model/RMLTarget.java b/src/main/java/burp/model/RMLTarget.java new file mode 100644 index 00000000..f4e537da --- /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 00000000..6e3dd142 --- /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 00000000..075815de --- /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 00000000..fb84340c --- /dev/null +++ b/src/main/java/burp/model/RdfStatement.java @@ -0,0 +1,68 @@ +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, IRITerm graph) { + this(subject, predicate, object, graph, 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 00000000..0f43ebe6 --- /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 00000000..101e6e39 --- /dev/null +++ b/src/main/java/burp/model/RdfStatementSubjectGraph.java @@ -0,0 +1,47 @@ +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 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 11c909df..29aa6593 100644 --- a/src/main/java/burp/model/Reference.java +++ b/src/main/java/burp/model/Reference.java @@ -1,20 +1,53 @@ package burp.model; +import burp.reporting.Origin; + import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +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; + } + + public List values(Iteration i) { + return getValues(i); + } + + public abstract List getValues(Iteration i); -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 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 00000000..295ddd0c --- /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 2ea1833c..5e6d55e9 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 deleted file mode 100644 index 8b73c48d..00000000 --- a/src/main/java/burp/model/Return.java +++ /dev/null @@ -1,27 +0,0 @@ -package burp.model; - -import java.util.HashMap; -import java.util.Map; - -public class Return { - - private final Map returns = new HashMap<>(); - - public Object defaultValue = null; - - public Return(Object defaultValue) { - this.defaultValue = defaultValue; - } - - public Object get(Object key) { - Object o = returns.get(key.toString()); - if(o == null) - throw new RuntimeException("Unknown return value %s.".formatted(key)); - return o; - } - - public Object put(String key, Object value) { - return returns.put(key, value); - } - -} diff --git a/src/main/java/burp/model/ReturnMap.java b/src/main/java/burp/model/ReturnMap.java deleted file mode 100644 index a660ea52..00000000 --- a/src/main/java/burp/model/ReturnMap.java +++ /dev/null @@ -1,30 +0,0 @@ -package burp.model; - -import java.util.List; - -import org.apache.jena.rdf.model.RDFNode; - -import burp.vocabularies.RML; - -public class ReturnMap extends TermMap { - - 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 boolean isGatherMap() { - return false; - } - -} \ 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 51d20f02..45a52f9c 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 f0deae5d..ed5b1fd2 100644 --- a/src/main/java/burp/model/Template.java +++ b/src/main/java/burp/model/Template.java @@ -1,66 +1,221 @@ 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 { + + 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()); + } + + private static final Pattern bracesPattern = Pattern.compile("(? 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 static final Pattern unescapePattern = Pattern.compile("\\\\([{}\\\\])"); + /** + * Unescapes the escaping backslash from \{ and \} and \\. + */ + private String escape(String s) { + if (s == null || s.indexOf('\\') < 0) return s; + return unescapePattern.matcher(s).replaceAll("$1"); + } -import burp.util.Util; -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; - } } \ No newline at end of file diff --git a/src/main/java/burp/model/TemplateReferenceSafety.java b/src/main/java/burp/model/TemplateReferenceSafety.java new file mode 100644 index 00000000..c3b9d1d1 --- /dev/null +++ b/src/main/java/burp/model/TemplateReferenceSafety.java @@ -0,0 +1,5 @@ +package burp.model; + +public enum TemplateReferenceSafety { + UNSAFE, SAFE_IRI, SAFE_URI +} diff --git a/src/main/java/burp/model/TermGenerator.java b/src/main/java/burp/model/TermGenerator.java new file mode 100644 index 00000000..4c55cc11 --- /dev/null +++ b/src/main/java/burp/model/TermGenerator.java @@ -0,0 +1,9 @@ +package burp.model; + +import burp.model.rdf.Term; + +import java.util.List; + +public interface TermGenerator extends PlanNode { + List generateTerms(Iteration i); +} diff --git a/src/main/java/burp/model/TermMap.java b/src/main/java/burp/model/TermMap.java index 5b009128..d3d16c6d 100644 --- a/src/main/java/burp/model/TermMap.java +++ b/src/main/java/burp/model/TermMap.java @@ -1,39 +1,90 @@ 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 (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)) { + 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, + null, + Map.of( + RML.termType, termType, + BURP.allowedTermType, String.join("", allowed.stream().map(Resource::getURI).toList()) + ) + ) + ); + } + } } \ 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 1ffec0b4..96a81db4 100644 --- a/src/main/java/burp/model/TriplesMap.java +++ b/src/main/java/burp/model/TriplesMap.java @@ -1,13 +1,144 @@ 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; + +import static burp.model.LogicalTarget.unionLogicalTargets; + +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; + } + + 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 sIri)) continue; + + if (s instanceof CollectionOrContainerTerm) { + for (IRITerm g : targetGraphsForSubjectMap) { + stmts.add(new RdfStatementSubjectGraph( + sIri, g, unionLogicalTargets(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, + unionLogicalTargets(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 sIri)) continue; -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 = unionLogicalTargets(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 2000b4af..00000000 --- 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/fnml/BurpFunctions.java b/src/main/java/burp/model/fnml/BurpFunctions.java new file mode 100644 index 00000000..8b1a250c --- /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 00000000..7f473b00 --- /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/fnml/FunctionExecution.java b/src/main/java/burp/model/fnml/FunctionExecution.java new file mode 100644 index 00000000..51d9b2e5 --- /dev/null +++ b/src/main/java/burp/model/fnml/FunctionExecution.java @@ -0,0 +1,125 @@ +package burp.model.fnml; + +import burp.model.*; +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.getFirst().uri(); + + Map inputMap = 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 + )); + } + + inputMap.put(parameterUri, generatedInputs.getFirst()); + } + + Origin originCall = new Origin(this, List.of(callStmt)); + + 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) { + 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.getFirst().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/fnml/FunctionsRegistry.java b/src/main/java/burp/model/fnml/FunctionsRegistry.java new file mode 100644 index 00000000..838a5243 --- /dev/null +++ b/src/main/java/burp/model/fnml/FunctionsRegistry.java @@ -0,0 +1,64 @@ +package burp.model.fnml; + +import burp.Main; +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.getName())) { + functionsMap.put(f.getName(), f); + } else { + if (Main.report != null && Main.report.getErrors() != null) { + Main.report.getErrors().add( + new RmlError( + "Function " + f.getName() + " 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/fnml/GrelFunctions.java b/src/main/java/burp/model/fnml/GrelFunctions.java new file mode 100644 index 00000000..1e22a98b --- /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.Strings; +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 = 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())); + } + } + + @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 00000000..41d38cfe --- /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 00000000..9e3087e1 --- /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/fnml/RMLFunction.java b/src/main/java/burp/model/fnml/RMLFunction.java new file mode 100644 index 00000000..2cd7c516 --- /dev/null +++ b/src/main/java/burp/model/fnml/RMLFunction.java @@ -0,0 +1,11 @@ +package burp.model.fnml; + +import burp.reporting.Origin; + +import java.util.List; +import java.util.Map; + +public interface RMLFunction { + String getName(); + List apply(Map parameters, Origin origin); +} diff --git a/src/main/java/burp/model/fnml/Return.java b/src/main/java/burp/model/fnml/Return.java new file mode 100644 index 00000000..0e23674a --- /dev/null +++ b/src/main/java/burp/model/fnml/Return.java @@ -0,0 +1,37 @@ +package burp.model.fnml; + +import java.util.HashMap; +import java.util.Map; + +public class Return { + + private final Map returns = new HashMap<>(); + + 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; + if (additionalOutputs != null) { + this.returns.putAll(additionalOutputs); + } + } + + public Object get(Object key) { + if (!returns.containsKey(key.toString()) && !returns.isEmpty()) { + throw new RuntimeException("Unknown return value %s.".formatted(key)); + } + return returns.get(key.toString()); + } + + public Object put(String key, Object value) { + return returns.put(key, value); + } + +} diff --git a/src/main/java/burp/model/fnml/ReturnMap.java b/src/main/java/burp/model/fnml/ReturnMap.java new file mode 100644 index 00000000..c57ae746 --- /dev/null +++ b/src/main/java/burp/model/fnml/ReturnMap.java @@ -0,0 +1,22 @@ +package burp.model.fnml; + +import burp.model.TermMap; +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; + } + + @Override + public String getName() { + return "return map"; + } + + @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/fnmlutil/Functions.java b/src/main/java/burp/model/fnmlutil/Functions.java deleted file mode 100644 index 16edd345..00000000 --- a/src/main/java/burp/model/fnmlutil/Functions.java +++ /dev/null @@ -1,675 +0,0 @@ -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 org.apache.commons.text.WordUtils; -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.vocabulary.XSD; - -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); - - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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) { - 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/gathermap/GatherMap.java b/src/main/java/burp/model/gathermap/GatherMap.java new file mode 100644 index 00000000..4052d6b8 --- /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 deleted file mode 100644 index 6bed2921..00000000 --- a/src/main/java/burp/model/gathermaputil/GatherMapMixin.java +++ /dev/null @@ -1,156 +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 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 { - - 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 cf0d14b8..00000000 --- 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/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 c11cda60..29215b90 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 00000000..9dff5e74 --- /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/lv/Field.java b/src/main/java/burp/model/lv/Field.java new file mode 100644 index 00000000..77cad07e --- /dev/null +++ b/src/main/java/burp/model/lv/Field.java @@ -0,0 +1,97 @@ +package burp.model.lv; + +import burp.model.AbstractLogicalSource; +import burp.model.PlanNode; + +import java.util.ArrayList; +import java.util.List; + +public abstract class Field implements ContainsFields, FieldParent, PlanNode { + + public String fieldName ; + public FieldParent parentField; + private PlanNode planNodeParent; + + public List expressionFields = new ArrayList<>(); + public List iterableFields = new ArrayList<>(); + + public static List expand(List list, List expressionFields, List iterableFields) { + List result = new ArrayList<>(list); + + if (expressionFields != null && !expressionFields.isEmpty()) { + // Let's process the expression fields + for (ExpressionField expressionField : expressionFields) { + List nlist = new ArrayList<>(); + for (LogicalIteration li : result) { + nlist.addAll(expressionField.enrich(li)); + } + result = nlist; + } + } + + if (iterableFields != null && !iterableFields.isEmpty()) { + // Let's process the iterable fields + List nlist = new ArrayList<>(); + for (LogicalIteration li : result) { + for (IterableField iterableField : iterableFields) { + nlist.addAll(iterableField.enrich(li)); + } + } + result = nlist; + } + + return result; + } + + @Override + public String getAbsoluteFieldName() { + if (parentField instanceof AbstractLogicalSource) + return fieldName; + + Field parent = (Field) this.parentField; + return parent.getAbsoluteFieldName() + "." + fieldName; + } + + @Override + public PlanNode getParent() { + return planNodeParent; + } + + @Override + public void setParent(PlanNode parent) { + this.planNodeParent = parent; + } + + @Override + public Iterable children() { + List children = new ArrayList<>(); + children.addAll(expressionFields); + children.addAll(iterableFields); + return children; + } + + @Override + public List getIterableFields() { + return iterableFields; + } + + @Override + public List getExpressionFields() { + return expressionFields; + } + + @Override + public void addField(Field field) { + field.parentField = this; + + if (field instanceof IterableField) { + getIterableFields().add((IterableField) field); + } else if (field instanceof ExpressionField) { + getExpressionFields().add((ExpressionField) field); + } + else + throw new RuntimeException("Unknown field type."); + } + +} + 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 00000000..a688b027 --- /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 00000000..3fc58d32 --- /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/JoinType.java b/src/main/java/burp/model/lv/JoinType.java new file mode 100644 index 00000000..ef7ac5d1 --- /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 00000000..0d333d0c --- /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 00000000..6eb79796 --- /dev/null +++ b/src/main/java/burp/model/lv/LogicalView.java @@ -0,0 +1,147 @@ +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); + list.addAll(expressionFields); + list.addAll(iterableFields); + list.addAll(joins); + return list; + } + + @Override + public Iterable dependencies() { + return children(); + } + + @SuppressWarnings("unchecked") + @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.parentField = 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 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 li)) { + throw new IllegalArgumentException("LogicalReference " + reference + " can only be used with LogicalIteration."); + } + + 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 00000000..e9b9bc94 --- /dev/null +++ b/src/main/java/burp/model/lv/ViewJoin.java @@ -0,0 +1,166 @@ +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.HashSet; +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 = 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) { + return false; + } + } + return true; + } + + public void addField(Field field) { + field.parentField = 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 00000000..0b216319 --- /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 00000000..3c43bb9b --- /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 00000000..6e0ffcfe --- /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 00000000..bfa844b6 --- /dev/null +++ b/src/main/java/burp/model/rdf/Datardf.java @@ -0,0 +1,189 @@ +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; +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 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"); + + 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()); + boolean isXsdFloat = datatype != null && XSDfloat.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 + } + } 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") + ? 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 + } + } 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); + } + + 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) { + //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) { + 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); + } + } + + 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 scientificNotation(BigDecimal.valueOf(d)); + return Double.toString(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(f); + } +} 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 00000000..e3e2f701 --- /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 00000000..03433444 --- /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 00000000..76023436 --- /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 00000000..9beab723 --- /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 00000000..7c1fa2f4 --- /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 00000000..06263509 --- /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 00000000..dc5345f1 --- /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 00000000..c28322d6 --- /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 31ea5cd3..e572addc 100644 --- a/src/main/java/burp/parse/Parse.java +++ b/src/main/java/burp/parse/Parse.java @@ -1,233 +1,325 @@ 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.fnml.FunctionExecution; +import burp.model.fnml.ReturnMap; +import burp.model.gathermap.GatherMap; +import burp.model.lv.*; +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.RDF12Converter; +import burp.parse.turtleprov.TurtleProvParser; +import burp.reporting.*; +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; 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; +import java.nio.file.Path; +import java.util.*; -public class Parse { - - static Map triplesmaps = null; - static Map logicalviews = null; +import static burp.reporting.StatementPart.*; - private static String mappingPath = null; - private static String currentDirectory = null; - - public static List parseMappingFile(String mappingFile) throws Exception { - mappingPath = Paths.get(mappingFile).toAbsolutePath().getParent().toString(); - currentDirectory = Paths.get("").toAbsolutePath().toString(); +public class Parse { - triplesmaps = new HashMap<>(); - logicalviews = new HashMap<>(); + private static final OntModel RML_CORE_ONTOLOGY = loadRmlCoreOntology(); - Model mapping = RDFDataMgr.loadModel(mappingFile); + 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; + } - if(!isValid(mapping)) - throw new RuntimeException("Mapping did not satisfy shapes."); + 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 ProvStore provStore = null; + + 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()); + 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); + } - // Replace rml:subject, rml:object, ... with constant expression maps - normalizeConstants(mapping); + public List parseMappingFile(Path mappingPath, Path currentDirectory) throws Exception { + this.mappingFile = mappingPath.toAbsolutePath().normalize(); + this.mappingDirectory = this.mappingFile.getParent(); + this.currentDirectory = currentDirectory; - // Look for the triples maps - List list = mapping.listSubjectsWithProperty(RML.logicalSource).toList(); + Lang guessType = RDFDataMgr.determineLang(mappingPath.toString(), null, null); - // Process each triples map - for (Resource r : list) { - TriplesMap tm = triplesmaps.computeIfAbsent(r, (x) -> new TriplesMap()); + if (guessType == Lang.TURTLE) { + Dataset dataset = parseTurtleFromFile(mappingPath); + 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); + tm.logicalSource = prepareLogicalSource(ls); - 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(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 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(shapesModel.getGraph(), infModel.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:expressionParameter ; + 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) { + 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 -> { - lv.addField(prepareField(s.getObject().asResource())); - }); + ls.listProperties(RML.field).forEachRemaining(s -> lv.addField(prepareField(s.getObject().asResource()))); - ls.listProperties(RML.leftJoin).forEach(s -> { - lv.addJoin(prepareLeftJoin(s.getObject().asResource())); - }); + ls.listProperties(RML.leftJoin).forEachRemaining(s -> lv.addJoin(prepareLeftJoin(s.getObject().asResource()))); - ls.listProperties(RML.innerJoin).forEach(s -> { - lv.addJoin(prepareInnerJoin(s.getObject().asResource())); - }); + ls.listProperties(RML.innerJoin).forEachRemaining(s -> lv.addJoin(prepareInnerJoin(s.getObject().asResource()))); return lv; } catch (Exception e) { @@ -235,359 +327,462 @@ 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.listProperties(RML.field).forEachRemaining(s -> viewJoin.addField(prepareField(s.getObject().asResource()))); + + return viewJoin; + } + + 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.graphMap).forEachRemaining(s -> { + GraphMap gm = prepareGraphMap(s.getObject().asResource()); + subjectMap.graphMaps.add(gm); + }); - Resource jcr = s.getObject().asResource(); + Resource termType = sm.getPropertyResourceValue(RML.termType); + if (termType != null) { + subjectMap.termType = termType; + } else if (hasNoTemplateReferenceConstantOrFunction(sm)) { + subjectMap.termType = RML.BLANKNODE; + } - Resource r = jcr.getPropertyResourceValue(RML.parentMap); - if(r != null) - jc.parentMap = prepareExpressionMap(r); + Resource gm = sm.getPropertyResourceValue(RML.gather); + if (gm != null) { + subjectMap.gatherMap = prepareGatherMap(sm); + } + + return subjectMap; + } - r = jcr.getPropertyResourceValue(RML.childMap); - if(r != null) - jc.childMap = prepareExpressionMap(r); + private PredicateObjectMap preparePredicateObjectMap(Resource pom) { + PredicateObjectMap predicateObjectMap = new PredicateObjectMap(); - viewJoin.joinConditions.add(jc); + pom.listProperties(RML.graphMap).forEachRemaining(s -> { + GraphMap gm = prepareGraphMap(s.getObject().asResource()); + predicateObjectMap.graphMaps.add(gm); }); - // We need the fields on the Logical View Join - resource.listProperties(RML.field).forEach(s -> { - viewJoin.addField(prepareField(s.getObject().asResource())); + pom.listProperties(RML.predicateMap).forEachRemaining(s -> { + PredicateMap pm = preparePredicateMap(s.getObject().asResource()); + predicateObjectMap.predicateMaps.add(pm); }); - return viewJoin; + 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 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 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) { + 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) { + 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 -> { - finalField.addField(prepareField(s.getObject().asResource())); - }); + 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(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); + input.parameterMap = prepareExpression(r.getPropertyResourceValue(RML.parameterMap), new ParameterMap()); - 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) { + 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))); + } + } + 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))); + } + } + } + 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(null, null, focusResource).forEachRemaining(stmt -> { + boolean contains = results.stream().anyMatch(it -> it.stmt().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 00000000..1ede44a1 --- /dev/null +++ b/src/main/java/burp/parse/PlanWiring.java @@ -0,0 +1,62 @@ +package burp.parse; + +import burp.model.*; + +import java.util.List; + +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).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 00000000..84645901 --- /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 00000000..cccdcab6 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/Point.java @@ -0,0 +1,70 @@ +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 point)) return false; + 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 00000000..c27b9aed --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/ProvStore.java @@ -0,0 +1,44 @@ +package burp.parse.turtleprov; + +import burp.reporting.PointRange; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.NonNull; + +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; + } + + @NotNull + public List getSyntaxErrors() { + return syntaxErrors; + } + + 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 @NonNull 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 00000000..3156ccb2 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/ProvTriple.java @@ -0,0 +1,48 @@ +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 that)) return false; + 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 00000000..aa7d96d4 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/ProvTurtleVisitor.java @@ -0,0 +1,595 @@ +package burp.parse.turtleprov; + +import burp.reporting.LiteralPart; +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.datatypes.xsd.XSDDatatype; +import org.apache.jena.irix.IRIx; +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) { + 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.stmt(); + if (stmt == null || stmt.getModel() == null) { + continue; + } + var infos = RDF12Converter.fromAnnotations(stmt, stmt.getModel()); + if (gp instanceof StatementParts sp) { + if (sp.subject() && infos.subjectInfo != null && infos.subjectInfo.start() != null) { + locations.add(new PointRange(infos.subjectInfo.start(), infos.subjectInfo.end())); + } + if (sp.predicate() && infos.predicateInfo != null && infos.predicateInfo.start() != null) { + locations.add(new PointRange(infos.predicateInfo.start(), infos.predicateInfo.end())); + } + 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.objectRange().end(); + Point startPt = info.rdfLiteralStringStart(); + Point endPt = info.rdfLiteralStringEnd(); + 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)); + } + } + } + } + } + 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<>(); + + 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 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; + 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); + } + + 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 + 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); + iri = unescapeIri(iri); + if (baseURI != null) { + iri = resolveRelativeIRI(baseURI, iri); + } + 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(), true); + } + + @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; + } + + @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 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(); + TerminalNode prefixedNameCtx = ctx.PrefixedName(); + + if (irirefCtx != null) { + 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 + ); + 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); + 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); + NodeInfo nodeInfo = new NodeInfo(TurtleNodeKind.PREFIXED_NAME, getStartPoint(token), getEndPoint(token), null); + return new Pair<>(resource, nodeInfo); + } else { + throw new TurtleProvException("Invalid prefixed name: " + prefixedName, getRange(token)); + } + } else { + throw new TurtleProvException("Unknown IRI type", getRange(ctx)); + } + } + + 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 TurtleProvException("Invalid blank node label: " + text, getRange(token)); + } + } 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 TurtleProvException("Unknown blank node format: " + text, getRange(token)); + } + } + + public Resource assembleList(List list) { + if (list.isEmpty()) { + return 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))); + } + 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.getLast(), RDF.rest, (Resource) RDF.nil))); + return blankNodes.getFirst(); + } + } + + @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 TurtleProvException("Unknown verb type: " + ctx.getText(), getRange(ctx)); + } + } + + @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 + 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 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 + 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 TurtleProvException("Unknown literal type", getRange(ctx)); + } + + @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); + } + + public static String unescapeRdfLiteralString(String s) { + return unescape(s, false); + } + + @Override + public Object visitString(TurtleParser.StringContext ctx) { + String text = ctx.getText(); + 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 { + 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) { + 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(text, XSDDatatype.XSDdouble); + kind = TurtleNodeKind.DOUBLE_LITERAL; + } else if (text.contains(".")) { + literal = model.createTypedLiteral(text, XSDDatatype.XSDdecimal); + kind = TurtleNodeKind.DECIMAL_LITERAL; + } else { + literal = model.createTypedLiteral(text, XSDDatatype.XSDinteger); + 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 00000000..0c828768 --- /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 00000000..67bb5ae4 --- /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/parse/turtleprov/TurtleProvException.java b/src/main/java/burp/parse/turtleprov/TurtleProvException.java new file mode 100644 index 00000000..a7ead9cc --- /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 new file mode 100644 index 00000000..06f33d21 --- /dev/null +++ b/src/main/java/burp/parse/turtleprov/TurtleProvParser.java @@ -0,0 +1,159 @@ +package burp.parse.turtleprov; + +import burp.reporting.PointRange; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.Interval; + +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(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 = ""; + 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; + try { + store = visitor.visitTurtleDoc(parser.turtleDoc()); + } catch (TurtleProvException e) { + 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) { + // 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/BurpException.java b/src/main/java/burp/reporting/BurpException.java new file mode 100644 index 00000000..bbcd859f --- /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 00000000..c90bbdc3 --- /dev/null +++ b/src/main/java/burp/reporting/Errors.java @@ -0,0 +1,41 @@ +package burp.reporting; + +import burp.model.PlanNode; +import burp.vocabularies.RER; + +import java.nio.file.Path; + +public class Errors { + + public static String fileLocationString(Path file, PointRange location) { + String locationStr = ""; + if (location != null) { + String start = location.start().getDisplayLine() + ":" + location.start().getDisplayColumn(); + String end = null; + if (location.end() != null) { + end = location.end().getDisplayLine() + ":" + location.end().getDisplayColumn(); + } + locationStr = (end != null) ? start + "-" + end : start; + } + + return !locationStr.isEmpty() ? file.toString() + ":" + locationStr : file.toString(); + } + + 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 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/FileGeometry.java b/src/main/java/burp/reporting/FileGeometry.java new file mode 100644 index 00000000..260d2516 --- /dev/null +++ b/src/main/java/burp/reporting/FileGeometry.java @@ -0,0 +1,82 @@ +package burp.reporting; + +import java.util.*; + + +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.end() == null) continue; + + 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.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.clamp(startCol, 0, lineLen); + int safeEnd = Math.clamp(endCol, 0, 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.getFirst(); + + 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 00000000..7232951c --- /dev/null +++ b/src/main/java/burp/reporting/FileHighlight.java @@ -0,0 +1,153 @@ +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, 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; + } + + 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, severity)).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, Severity severity) { + 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); + if (severity == Severity.WARNING) { + sb.append(ansiBoldYellow(textToHighlight)); + } else if (severity == Severity.INFORMATION) { + sb.append(ansiBoldCyan(textToHighlight)); + } else { + 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"; + } + + public static String ansiYellow(String text) { + return "\u001B[33m" + text + "\u001B[0m"; + } + + public static String ansiBoldYellow(String text) { + return "\u001B[1;33m" + text + "\u001B[0m"; + } + + public static String ansiCyan(String text) { + return "\u001B[36m" + text + "\u001B[0m"; + } + + public static String ansiBoldCyan(String text) { + return "\u001B[1;36m" + text + "\u001B[0m"; + } +} diff --git a/src/main/java/burp/reporting/LiteralPart.java b/src/main/java/burp/reporting/LiteralPart.java new file mode 100644 index 00000000..23d39f0a --- /dev/null +++ b/src/main/java/burp/reporting/LiteralPart.java @@ -0,0 +1,12 @@ +package burp.reporting; + +import org.apache.jena.rdf.model.Statement; +import org.jspecify.annotations.NonNull; + +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); + } + } +} diff --git a/src/main/java/burp/reporting/Origin.java b/src/main/java/burp/reporting/Origin.java new file mode 100644 index 00000000..a5e8de25 --- /dev/null +++ b/src/main/java/burp/reporting/Origin.java @@ -0,0 +1,23 @@ +package burp.reporting; + +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(@Nullable PlanNode planNode, @Nullable 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/PlainTextReportGenerator.java b/src/main/java/burp/reporting/PlainTextReportGenerator.java new file mode 100644 index 00000000..4ba34a48 --- /dev/null +++ b/src/main/java/burp/reporting/PlainTextReportGenerator.java @@ -0,0 +1,184 @@ +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(); + + 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; + 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 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()); + + 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.removeIf(l -> l == null || l.start() == null); + sortedLocations.sort(Comparator.comparing(PointRange::start)); + + 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, severity); + if (highlight != null) { + if (!lineLocations.isEmpty()) { + sb.append(lineLocations.getFirst()).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, 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); + 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) { + 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/reporting/PointRange.java b/src/main/java/burp/reporting/PointRange.java new file mode 100644 index 00000000..28e2f89d --- /dev/null +++ b/src/main/java/burp/reporting/PointRange.java @@ -0,0 +1,26 @@ +package burp.reporting; + + +import burp.parse.turtleprov.Point; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; + +public record PointRange(@NonNull Point start, @Nullable Point end) { + + public PointRange() { + this(new Point(0, 0), null); + } + + public PointRange(Point start) { + this(start, null); + } + + 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 00000000..0b3f54de --- /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 stmt(); +} diff --git a/src/main/java/burp/reporting/RDFPointer.java b/src/main/java/burp/reporting/RDFPointer.java new file mode 100644 index 00000000..26f3946e --- /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/RdfReportGenerator.java b/src/main/java/burp/reporting/RdfReportGenerator.java new file mode 100644 index 00000000..6dd44a90 --- /dev/null +++ b/src/main/java/burp/reporting/RdfReportGenerator.java @@ -0,0 +1,162 @@ +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()) { + 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 -> { + } + } + } + } + } + } + + 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); + throwable.printStackTrace(pw); + return sw.toString(); + } +} diff --git a/src/main/java/burp/reporting/RmlError.java b/src/main/java/burp/reporting/RmlError.java new file mode 100644 index 00000000..17d352fc --- /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 00000000..2291c548 --- /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 00000000..d68b739f --- /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/Severity.java b/src/main/java/burp/reporting/Severity.java new file mode 100644 index 00000000..e3e380d0 --- /dev/null +++ b/src/main/java/burp/reporting/Severity.java @@ -0,0 +1,7 @@ +package burp.reporting; + +public enum Severity { + ERROR, + WARNING, + INFORMATION +} diff --git a/src/main/java/burp/reporting/StatementPart.java b/src/main/java/burp/reporting/StatementPart.java new file mode 100644 index 00000000..587a15bb --- /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 00000000..a770b192 --- /dev/null +++ b/src/main/java/burp/reporting/StatementParts.java @@ -0,0 +1,33 @@ +package burp.reporting; + +import org.apache.jena.rdf.model.Statement; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; + +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; + 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); + } + + 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/Statistics.java b/src/main/java/burp/reporting/Statistics.java new file mode 100644 index 00000000..d773d4b1 --- /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 00000000..71d63275 --- /dev/null +++ b/src/main/java/burp/reporting/TextFilePointer.java @@ -0,0 +1,13 @@ +package burp.reporting; + +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/java/burp/util/BURPConfiguration.java b/src/main/java/burp/util/BURPConfiguration.java index de826163..7708b219 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/SimpleNamespaceContext.java b/src/main/java/burp/util/SimpleNamespaceContext.java index efd5419f..cd508be2 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/main/java/burp/util/Util.java b/src/main/java/burp/util/Util.java index 4dae6583..13b35ce1 100644 --- a/src/main/java/burp/util/Util.java +++ b/src/main/java/burp/util/Util.java @@ -1,194 +1,229 @@ 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.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('%').append(String.format("%02X", b & 0xFF)); + } + } + 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 00000000..4dabe911 --- /dev/null +++ b/src/main/java/burp/vocabularies/BURP.java @@ -0,0 +1,49 @@ +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"); + + /** + * Indicate the allowed term types of an Expression Map. + * Extension to RER Error context. + */ + public static Property allowedTermType = property("allowedTermType"); +} diff --git a/src/main/java/burp/vocabularies/CSVW.java b/src/main/java/burp/vocabularies/CSVW.java index 4282ad59..e2e822db 100644 --- a/src/main/java/burp/vocabularies/CSVW.java +++ b/src/main/java/burp/vocabularies/CSVW.java @@ -16,5 +16,7 @@ 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"); + public static final Property trim = ResourceFactory.createProperty(NS + "trim"); } diff --git a/src/main/java/burp/vocabularies/RML.java b/src/main/java/burp/vocabularies/RML.java index c4d77e6b..5295b374 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/main/resources/shapes/rml-cc/cc.ttl b/src/main/resources/shapes/rml-cc/cc.ttl deleted file mode 100644 index a3888dfd..00000000 --- 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 79e83045..00000000 --- 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 cf053a74..00000000 --- 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 100755 index 5d4db637..00000000 --- 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 f239f596..00000000 --- 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 e9fdd848..00000000 --- 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 e37856a1..00000000 --- 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 100755 index 91dfdde8..00000000 --- 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 54f12392..00000000 --- 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 a867cea4..00000000 --- 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 75df2895..00000000 --- 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 b56da668..00000000 --- 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 35e23dbe..00000000 --- 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 066b10e1..00000000 --- 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 100755 index a480b204..00000000 --- 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 6b7d6912..00000000 --- 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 7a81f3a8..00000000 --- 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 4e2dbf85..00000000 --- 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 6ed2369b..00000000 --- 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 100755 index dabb1d24..00000000 --- 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 e10ae138..00000000 --- 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 9e338ce1..00000000 --- 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 feb37bb3..00000000 --- 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 56a6cfb1..00000000 --- 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 d4086c59..00000000 --- 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 3d264b8e..00000000 --- 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 e37856a1..00000000 --- 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 e757772d..00000000 --- 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 4de0b242..00000000 --- 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 a7bdcbaf..00000000 --- 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 100755 index 2102e28c..00000000 --- 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 a05bc109..00000000 --- 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 6b8f0dd6..00000000 --- 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 9e706792..00000000 --- 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 e5bc9eb4..00000000 --- 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 275e767a..00000000 --- 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 0c37a50d..00000000 --- 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 100755 index f6c20d6b..00000000 --- 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 bb791ee6..00000000 --- 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 efaf4408..00000000 --- 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 25bc52c0..00000000 --- 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 e9fdd848..00000000 --- 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 2e5b0446..00000000 --- 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 e37856a1..00000000 --- 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 100755 index 1cfba5c5..00000000 --- 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 100755 index ab6f2f53..00000000 --- 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 caef0b46..00000000 --- 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 b185fdf1..00000000 --- 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 c4116441..00000000 --- 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 033c8b87..00000000 --- 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 0bf5d2b8..00000000 --- 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 980d5373..00000000 --- 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 3d264b8e..00000000 --- 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 40f733c4..00000000 --- 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 9a29e45c..00000000 --- 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 82b55a0b..00000000 --- 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 100755 index ef6666ae..00000000 --- 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 437871a7..00000000 --- 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 31a23bea..00000000 --- a/src/main/resources/shapes/rml-lv/lv.ttl +++ /dev/null @@ -1,344 +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 resource as its value. - """ ; - sh:path rml:field ; - sh:minCount 1 ; - sh:nodeKind sh:BlankNodeOrIRI ; - sh:or ( - [ sh:node rmlsh:ExpressionFieldShape ] - [ sh:node rmlsh:IterableFieldShape ] - ) - ] . - -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 100755 index 033c8b87..00000000 --- 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 e9fdd848..00000000 --- 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 100755 index 8fe1fdd3..00000000 --- a/src/main/resources/shapes/rml-lv/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 = '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}') - 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 437871a7..00000000 --- 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 628ab6e2..00000000 --- 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 b58054a9..00000000 --- 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 33e47459..00000000 --- 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 dabb1d24..00000000 --- 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 7de4a219..00000000 --- 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 3d264b8e..00000000 --- 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 e37856a1..00000000 --- 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 82446fd5..00000000 --- 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 02c0f0ec..00000000 --- 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 73486a49..00000000 --- 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 317a08d7..00000000 --- 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/main/resources/vocabularies/ptr.ttl b/src/main/resources/vocabularies/ptr.ttl new file mode 100644 index 00000000..0a7696c2 --- /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/main/resources/vocabularies/rer.ttl b/src/main/resources/vocabularies/rer.ttl new file mode 100644 index 00000000..4b7f4d58 --- /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. diff --git a/src/test/java/burp/FileGeometryTest.java b/src/test/java/burp/FileGeometryTest.java new file mode 100644 index 00000000..894e5e10 --- /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 00000000..9900bce9 --- /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/IRISafeTest.java b/src/test/java/burp/IRISafeTest.java new file mode 100644 index 00000000..3c4e424a --- /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 00000000..4b97f207 --- /dev/null +++ b/src/test/java/burp/NQuadsWriterTest.java @@ -0,0 +1,143 @@ +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 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()) + ); + + 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/ParseShaclViolationTest.java b/src/test/java/burp/ParseShaclViolationTest.java new file mode 100644 index 00000000..bb262ca6 --- /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/burp/Test.java b/src/test/java/burp/Test.java deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/java/burp/TestBURP.java b/src/test/java/burp/TestBURP.java new file mode 100644 index 00000000..9a4ae098 --- /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 78a36c9f..eaffc3e3 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 37c5d5c8..5e1915c0 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 "./target/test-classes/rml-cc/"; } } diff --git a/src/test/java/burp/TestRMLCore.java b/src/test/java/burp/TestRMLCore.java index b40c64c3..0cc973df 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 "./target/test-classes/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 7aa5d0d9..00000000 --- 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 b307b7e8..00000000 --- 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 01e80120..00000000 --- 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 00000000..3b48ad4b --- /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 "./target/test-classes/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 7c623629..00000000 --- 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 0942c366..00000000 --- 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 00000000..8579153c --- /dev/null +++ b/src/test/java/burp/TestRMLIO.java @@ -0,0 +1,36 @@ +package burp; + +import java.util.List; + +public class TestRMLIO extends TestRMLModule { + @Override + public String getBase() { + return "./target/test-classes/rml-io/"; + } + + public List buggyTests() { + return 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" + ); + } +} diff --git a/src/test/java/burp/TestRMLIORegistry.java b/src/test/java/burp/TestRMLIORegistry.java new file mode 100644 index 00000000..7a3cf9a3 --- /dev/null +++ b/src/test/java/burp/TestRMLIORegistry.java @@ -0,0 +1,185 @@ +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.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; + +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.List; + +@Testcontainers +public class TestRMLIORegistry extends TestRMLModule { + + public static String base = "./target/test-classes/rml-io-registry/"; + + @Override + 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(); + String newMappingPath = mappingPath; + + if ("application/sql".equals(testData.input_format1)) { + System.out.println("Preparing 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": + 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; + + case "com.microsoft.sqlserver.jdbc.SQLServerDriver": + 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); + } + + 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 }""", + 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("Mapping updated in " + newMappingPath); + + 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()) { + 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."); + } + } + } + } + + if (!newMappingPath.equals(mappingPath)) { + testData.mapping = Path.of(newMappingPath).getFileName().toString(); + } + } + + @Container + public static PostgreSQLContainer PGSQL_CONTAINER = new PostgreSQLContainer("postgres:latest") + .withUsername("postgres") + .withPassword("test") + .withReuse(true); + + @Container + public static MySQLContainer MYSQL_CONTAINER = new MySQLContainer("mysql:latest") + .withEnv("MYSQL_ROOT_HOST", "%") + .withCommand("mysqld", "--sql_mode=ANSI_QUOTES") + .withReuse(true); + + + @Container + public static MSSQLServerContainer MSSQL_CONTAINER = + new MSSQLServerContainer("mcr.microsoft.com/mssql/server:2025-latest") + .acceptLicense() + .withReuse(true); + +} diff --git a/src/test/java/burp/TestRMLLV.java b/src/test/java/burp/TestRMLLV.java index 55f1df37..4af25cb3 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 "./target/test-classes/rml-lv/"; } } diff --git a/src/test/java/burp/TestRMLModule.java b/src/test/java/burp/TestRMLModule.java new file mode 100644 index 00000000..8b8d9ed7 --- /dev/null +++ b/src/test/java/burp/TestRMLModule.java @@ -0,0 +1,506 @@ +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.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; +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.core.DatasetGraphFactory; +import org.apache.jena.sparql.core.Quad; +import org.apache.jena.sparql.util.IsoMatcher; +import org.jspecify.annotations.NonNull; +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.Collectors; +import java.util.stream.Stream; + +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 { + 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 { + 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"))); + } + return list.stream(); + } + + protected Stream testDataProviderNotOK() throws IOException, CsvException { + 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"))); + } + return list.stream(); + } + + 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 { + if ("dummy".equals(testData.ID)) return; + 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(testData.mapping).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 = normalizeDoubles(loadDataset(decompressedExpectedPath)); + DatasetGraph actual = normalizeDoubles(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")); + 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); + var errorTypes = getErrorTypes(report); + if (countErrors > 0) { + 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 { + if ("dummy".equals(testData.ID)) return; + 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(); + } + + assertNotEquals(0, exit); + assertFalse(report.isEmpty()); + + long countErrors = getCountErrors(report); + var errorTypes = getErrorTypes(report); + + System.out.println("Error types: " + errorTypes); + 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(mapToLocalNames(errorTypes).toList()); + 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); + } + } + } + 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()) { + 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); + } + } + } + } + } + } + + 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"); + 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; + } + + + /** + * 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; + } +} diff --git a/src/test/java/turtleprov/AbstractManifestTest.java b/src/test/java/turtleprov/AbstractManifestTest.java new file mode 100644 index 00000000..5d24aa95 --- /dev/null +++ b/src/test/java/turtleprov/AbstractManifestTest.java @@ -0,0 +1,208 @@ +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; + +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 { + + 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)); + } + } + } + if (list.isEmpty()) + list.add(new TestInfo("dummy", "dummy", null, null)); + 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 { + 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)); + 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; + 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) { + if ("dummy".equals(info.name)) return; + try { + ProvStore store = TurtleProvParser.parseTurtleFromString(Files.readString(info.actionFile)); + 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 00000000..699da24c --- /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 00000000..0665dfe0 --- /dev/null +++ b/src/test/java/turtleprov/Rdf12ManifestTest.java @@ -0,0 +1,19 @@ +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() { + 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 00000000..5cf01cd1 --- /dev/null +++ b/src/test/java/turtleprov/TurtleParserTest.java @@ -0,0 +1,329 @@ +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.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.*; + +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); + + assertEquals(1, store.getTriples().size()); + assertEquals("http://example.com/", store.getPrefixes().get("ex")); + + ProvTriple provTriple = store.getTriples().iterator().next(); + 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()); + + assertNotNull(provTriple.subjectInfo()); + assertNotNull(provTriple.predicateInfo()); + assertNotNull(provTriple.objectInfo()); + } + + @Test + public void testParsesTypedLiteral() { + String turtle = """ + @prefix ex: . + ex:alice ex:age 42 . + """; + + ProvStore store = parseTurtleFromString(turtle); + + assertEquals(1, store.getTriples().size()); + var obj = store.getTriples().iterator().next().statement().getObject(); + assertTrue(obj.isLiteral()); + Literal literal = obj.asLiteral(); + assertEquals("42", literal.getLexicalForm()); + assertEquals("http://www.w3.org/2001/XMLSchema#integer", 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); + + 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()) { + 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; + } + } + 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; + } + } + 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(); + assertNotNull(objectInfo); + var start = objectInfo.start(); + var end = objectInfo.end(); + assertNotNull(start); + assertNotNull(end); + + 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(); + 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\""); + assertEquals("double", res.literal.getLexicalForm()); + 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\\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\\n'", + "single\n" + ); + } + + @Test + public void testParsesRdfLiteralWithLongDoubleQuotesAndProvenanceSpans() { + ParseResult res = parseSingleLiteral("longDouble", "\"\"\"long double\"\"\""); + assertEquals("long double", res.literal.getLexicalForm()); + 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'''"); + assertEquals("long single", res.literal.getLexicalForm()); + 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"); + assertEquals("Bonjour", res.literal.getLexicalForm()); + 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"); + assertEquals("42", res.literal.getLexicalForm()); + 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 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 + public void testSyntaxErrorReportingPointRange() { + String invalidTurtle = "@prefix ex: .\nex:alice ex:knows ."; + ProvStore store = TurtleProvParser.parseTurtleFromString(invalidTurtle); + + assertFalse(store.getSyntaxErrors().isEmpty()); + var error = store.getSyntaxErrors().getFirst(); + assertNotNull(error.range()); + + assertEquals(1, error.range().start().line); + assertEquals(18, error.range().start().column); + 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); + + assertFalse(store.getSyntaxErrors().isEmpty()); + var error = store.getSyntaxErrors().getFirst(); + assertNotNull(error.range()); + + assertEquals(1, error.range().start().line); + assertEquals(18, error.range().start().column); + + // The extracted quoted text is "http://example.com/{Name\} (length 27) + assertNotNull(error.range().end()); + assertEquals(1, error.range().end().line); + assertEquals(45, error.range().end().column); + } +} diff --git a/src/test/java/turtleprov/manifest/RdfManifest.java b/src/test/java/turtleprov/manifest/RdfManifest.java new file mode 100644 index 00000000..00d58332 --- /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 00000000..fbb6e9d3 --- /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 00000000..2ca7e216 --- /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 00000000..ae89378e --- /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 00000000..e14d3a36 --- /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 00000000..11d0238a --- /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 00000000..b88acf75 --- /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 00000000..e14d3a36 --- /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 00000000..18576815 --- /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 00000000..a60de90b --- /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 00000000..e14d3a36 --- /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 00000000..4ab549f5 --- /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 00000000..3a11edbc --- /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 00000000..e14d3a36 --- /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 00000000..22cdcd1d --- /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 00000000..ddcec807 --- /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 00000000..e14d3a36 --- /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 00000000..bd9e6d28 --- /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 00000000..ddcec807 --- /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 00000000..e14d3a36 --- /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 00000000..a04b1a44 --- /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 00000000..da7657be --- /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 00000000..cbb228df Binary files /dev/null and b/src/test/resources/burp/BURPIOTC-BSON/student.bson differ 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 00000000..cf40b17e --- /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 00000000..d42ac888 --- /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 00000000..9c165404 --- /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 00000000..30ff376a --- /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 00000000..617edb68 --- /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 00000000..2d2de884 Binary files /dev/null and b/src/test/resources/burp/BURPIOTC-SQLITE/student.db differ 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 00000000..ce1dfdd2 --- /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 00000000..44de38e0 --- /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 00000000..f8a9a718 --- /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: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" ; + ] ; + ] . + +: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/ELSDVLEE-20/output.nt b/src/test/resources/burp/ELSDVLEE-20/output.nt new file mode 100644 index 00000000..62c8015e --- /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/authors.json b/src/test/resources/burp/ELSDVLEE-21/authors.json new file mode 100644 index 00000000..4fe7ae58 --- /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 00000000..e8a48696 --- /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 00000000..06eee4ff --- /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 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 00000000..e9d67364 --- /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/errors.csv b/src/test/resources/burp/errors.csv new file mode 100644 index 00000000..e83fa2a2 --- /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 00000000..04d2cafe --- /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,,,"",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 diff --git a/src/test/resources/rdf-tests b/src/test/resources/rdf-tests new file mode 160000 index 00000000..f172950b --- /dev/null +++ b/src/test/resources/rdf-tests @@ -0,0 +1 @@ +Subproject commit f172950b7c8b42a7d2618a7905bba521847249b1 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 6c1a5014..00000000 --- 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 147b8e51..00000000 --- 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 74e2d141..00000000 --- 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 11c108f3..00000000 --- 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 d5eacf32..00000000 --- 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 147b8e51..00000000 --- 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 7b134a9b..00000000 --- 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 cefcb53e..00000000 --- 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 25824e58..00000000 --- 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 147b8e51..00000000 --- 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 0b4e8c1d..00000000 --- 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 0e837b79..00000000 --- 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 8afa22d6..00000000 --- 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 147b8e51..00000000 --- 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 e0bf7de1..00000000 --- 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 03a14754..00000000 --- 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 2af1fbd5..00000000 --- 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 147b8e51..00000000 --- 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 8b5f9571..00000000 --- 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 88fbb315..00000000 --- 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 e8635f8c..00000000 --- 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 147b8e51..00000000 --- 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 9f03fd79..00000000 --- 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 a97b431e..00000000 --- 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 66fc3969..00000000 --- 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 f7975acd..00000000 --- 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 5575c4f9..00000000 --- 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 948c61f4..00000000 --- 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 6968e66d..00000000 --- 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 f7975acd..00000000 --- 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 08797495..00000000 --- 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 07dce410..00000000 --- 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 a32fecae..00000000 --- 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 f7975acd..00000000 --- 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 d357d49b..00000000 --- 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 066ecc7a..00000000 --- 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 0d764a82..00000000 --- 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 f7975acd..00000000 --- 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 08797495..00000000 --- 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 c4877f5d..00000000 --- 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 1b565b85..00000000 --- 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 f7975acd..00000000 --- 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 3d4d463e..00000000 --- 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 cefcb53e..00000000 --- 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 89ff517f..00000000 --- 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 f7975acd..00000000 --- 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 5acbac25..00000000 --- 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 0e837b79..00000000 --- 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 2b7434bf..00000000 --- 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 f7975acd..00000000 --- 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 5acbac25..00000000 --- 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 bfeaa8ae..00000000 --- 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 a3ec666d..00000000 --- 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 7e67671c..00000000 --- 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 f2aca1cc..00000000 --- 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 5e2d7321..00000000 --- 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 eedb608d..00000000 --- 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 7e67671c..00000000 --- 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 bbde605c..00000000 --- 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 3001e5f8..00000000 --- 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 e0e52441..00000000 --- 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 f7975acd..00000000 --- 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 738b922b..00000000 --- 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 3001e5f8..00000000 --- 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 84711d18..00000000 --- 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 7e67671c..00000000 --- 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 31ab141d..00000000 --- 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 bb8af2b4..00000000 --- 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 99fd6210..00000000 --- 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 f7975acd..00000000 --- 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 65c2c2c3..00000000 --- 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 83c9751b..00000000 --- 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 95c4b898..00000000 --- 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 f0feba6b..00000000 --- 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 7fe03c50..00000000 --- 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 e2789c99..00000000 --- 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 2800e435..00000000 --- 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 520fa6fd..00000000 --- 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 90196c4e..00000000 --- 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 e2789c99..00000000 --- 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 b902b515..00000000 --- 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 f0feba6b..00000000 --- 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 08d0c5e1..00000000 --- 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 6d6f2bd9..00000000 --- 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 b9b80a2f..00000000 --- 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 0f90f8b0..00000000 --- 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 b13c08de..00000000 --- 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 6d6f2bd9..00000000 --- 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 4fc561d6..00000000 --- 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 a17afe2c..00000000 --- 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 0a2aebe1..00000000 --- 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 91bccaa0..00000000 --- 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 e5248c6d..00000000 --- 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 a17afe2c..00000000 --- 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 40500379..00000000 --- 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 6bb8841b..00000000 --- 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 a35f394c..00000000 --- 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 ab3d8c52..00000000 --- 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 d66af6fb..00000000 --- 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 23251ff9..00000000 --- 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 ed86d92b..00000000 --- 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 a17afe2c..00000000 --- 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 4141428b..00000000 --- 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 d88fe4df..00000000 --- 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 f5a8d823..00000000 --- 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 a17afe2c..00000000 --- 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 008e8e52..00000000 --- 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 4adddc15..00000000 --- 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 6c3b43d2..00000000 --- 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 ab3d8c52..00000000 --- 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 19c6f4cc..00000000 --- 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 071a777d..00000000 --- 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 7d4f7b5c..00000000 --- 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 f0feba6b..00000000 --- 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 cdfac164..00000000 --- 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 8423745d..00000000 --- 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 5f400157..00000000 --- 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 347e6c80..00000000 --- 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 fb097e85..00000000 --- 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 8a96794b..00000000 --- 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 8b5690af..00000000 --- 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 8c6f63e9..00000000 --- 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 e6707b77..00000000 --- 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 8a96794b..00000000 --- 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 733ae3e8..00000000 --- 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 cad65771..00000000 --- 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 572b5c84..00000000 --- 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 cefcb53e..00000000 --- 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 4b44f018..00000000 --- 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 cad65771..00000000 --- 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 9a73f638..00000000 --- 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 0e837b79..00000000 --- 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 870ad33c..00000000 --- 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 f85e5b77..00000000 --- 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 ac2b7e3c..00000000 --- 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 6eeb8b99..00000000 --- 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 0859ca2a..00000000 --- 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 f85e5b77..00000000 --- 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 027db1b2..00000000 --- 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 0f744299..00000000 --- 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 dd32f38d..00000000 --- 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 df4bf68b..00000000 --- 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 375747e7..00000000 --- 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 27f834b9..00000000 --- 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 abe1c494..00000000 --- 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 cfe40fdb..00000000 --- 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 2ad784eb..00000000 --- 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 2ad784eb..00000000 --- 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 12c32031..00000000 --- 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 a2c46363..00000000 --- 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 0dd78573..00000000 --- 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 bd827a7f..00000000 --- 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 919ffd53..00000000 --- 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 a747165b..00000000 --- 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 2ad784eb..00000000 --- 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 7b13b046..00000000 --- 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 f4c3ad6a..00000000 --- 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 55ab17e6..00000000 --- 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 7d81b94d..00000000 --- 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 ed812913..00000000 --- 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 f0f00d62..00000000 --- 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 0f6f797f..00000000 --- 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 7accac63..00000000 --- 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 f0f00d62..00000000 --- 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 0f6f797f..00000000 --- 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 c4473967..00000000 --- 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 e8880a51..00000000 --- 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 0f6f797f..00000000 --- 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 d687d0cb..00000000 --- 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 325669fc..00000000 --- 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 0f6f797f..00000000 --- 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 69b7a6fc..00000000 --- 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 90d3ca9f..00000000 --- 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 0f6f797f..00000000 --- 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 831a6c76..00000000 --- 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 b8bc8015..00000000 --- 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 41da352f..00000000 --- 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 ca0b9916..00000000 --- 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 81bf2f6a..00000000 --- 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 a8181987..00000000 --- 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 0a0f009a..00000000 --- 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 73f40ddf..00000000 --- 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 b3ae4c4e..00000000 --- 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 a2391102..00000000 --- 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 5d0a5678..00000000 --- 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 082a16c0..00000000 --- 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 b3ae4c4e..00000000 --- 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 fc9f8483..00000000 --- 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 7cee3d86..00000000 --- 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 cf274fb0..00000000 --- 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 0f6f797f..00000000 --- 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 09891e2a..00000000 --- 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 fb76dbc4..00000000 --- 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 be918d0b..00000000 --- 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 0f6f797f..00000000 --- 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 0324c94f..00000000 --- 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 5fff6df9..00000000 --- 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 0f6f797f..00000000 --- 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 512f5cb1..00000000 --- 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 f13174c8..00000000 --- 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 0f6f797f..00000000 --- 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 722070b0..00000000 --- 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 0b42150f..00000000 --- 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 180f90c2..00000000 --- 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 dcdd9388..00000000 --- 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 9930094b..00000000 --- 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 ff87cbc9..00000000 --- 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 164ca8ba..00000000 --- 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 5e537b36..00000000 --- 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 447cd83e..00000000 --- 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 36480e52..00000000 --- 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 b3ae4c4e..00000000 --- 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 a796f16a..00000000 --- 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 b30b9ffa..00000000 --- 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 d692582e..00000000 --- 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 64e91da4..00000000 --- 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 c901da55..00000000 --- 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 3196ff7a..00000000 --- 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 4e6fd3ef..00000000 --- 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 dcdd9388..00000000 --- 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 54b13a37..00000000 --- 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 ac7b148b..00000000 --- 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 76f87f89..00000000 --- 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 dcdd9388..00000000 --- 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 e4e921e8..00000000 --- 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 d9043524..00000000 --- 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 5c4eb261..00000000 --- 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 dcdd9388..00000000 --- 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 7d4dab80..00000000 --- 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 65764100..00000000 --- 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 ae78ddfb..00000000 --- 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 dcdd9388..00000000 --- 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 94042941..00000000 --- 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 fe8e475a..00000000 --- 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 2232abdb..00000000 --- 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 dcdd9388..00000000 --- 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 d4a1458b..00000000 --- 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 19e307c7..00000000 --- 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 c5ea4c49..00000000 --- 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 0f6f797f..00000000 --- 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 f9cff3b4..00000000 --- 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 8dd905cf..00000000 --- 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 fb6a536c..00000000 --- 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 dcdd9388..00000000 --- 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 bc7e645b..00000000 --- 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 bfacef74..00000000 --- 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 6c29bcce..00000000 --- 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 dcdd9388..00000000 --- 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 acb63958..00000000 --- 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 c79dd6ed..00000000 --- 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 dcdd9388..00000000 --- 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 a0841468..00000000 --- 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 c12600ca..00000000 --- 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 2856ef24..00000000 --- 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 cd7526f3..00000000 --- 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 8e3e8ed1..00000000 --- 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 9aba67e8..00000000 --- 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 a2678fac..00000000 --- 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 cd7526f3..00000000 --- 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 fd07d456..00000000 --- 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 a610a24c..00000000 --- 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 d36f700c..00000000 --- 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 cd7526f3..00000000 --- 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 6bb9aef6..00000000 --- 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 596bd136..00000000 --- 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 b0b89f8b..00000000 --- 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 98b89704..00000000 --- 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 a99528c1..00000000 --- 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 051d9bb5..00000000 --- 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 4a12b17f..00000000 --- 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 aef6b08c..00000000 --- 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 98b89704..00000000 --- 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 a99528c1..00000000 --- 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 f465982b..00000000 --- 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 4e8d578a..00000000 --- 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 370edb7c..00000000 --- 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 29911d6f..00000000 --- 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 a91ee546..00000000 --- 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 4e8d578a..00000000 --- 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 1f9f4db6..00000000 --- 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 c92a08b0..00000000 --- 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 62298579..00000000 --- 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 4e8d578a..00000000 --- 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 fb1afc8d..00000000 --- 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 5c7e1080..00000000 --- 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 8df6890d..00000000 --- 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 29ba8387..00000000 --- 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 6a82565e..00000000 --- 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 7d4615b0..00000000 --- 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 60771847..00000000 --- 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 19c60124..00000000 --- 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 95239e9c..00000000 --- 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 7caeb4cf..00000000 --- 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 62818b4c..00000000 --- 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 513e9890..00000000 --- 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 8f51b221..00000000 --- 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 6ffc3601..00000000 --- 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 82aa3b30..00000000 --- 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 0d556bbd..00000000 --- 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 513e9890..00000000 --- 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 c65174cf..00000000 --- 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 c458a4aa..00000000 --- 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 513e9890..00000000 --- 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 3b3dfa90..00000000 --- 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 a8baa088..00000000 --- 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 513e9890..00000000 --- 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 8a42b808..00000000 --- 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 c1bd8ddc..00000000 --- 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 e143b3ef..00000000 --- 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 d7472e18..00000000 --- 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 89812126..00000000 --- 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 84a05519..00000000 --- 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 b861adf0..00000000 --- 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 4c3a5035..00000000 --- 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 a80dd6a3..00000000 --- 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 006c0dba..00000000 --- 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 84a05519..00000000 --- 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 b861adf0..00000000 --- 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 6f485f7d..00000000 --- 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 eb11b856..00000000 --- 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 2870ff6e..00000000 --- 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 4a97fdf0..00000000 --- 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 01420506..00000000 --- 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 768c29dd..00000000 --- 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 2870ff6e..00000000 --- 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 87c4f146..00000000 --- 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 bfbd4be7..00000000 --- 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 0d2892f8..00000000 --- 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 d2b4b5f9..00000000 --- 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 3b14e8fd..00000000 --- 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 ac2bc65d..00000000 --- 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 f7a7d85a..00000000 --- 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 4488c582..00000000 --- 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 a1d5027d..00000000 --- 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 31d47a23..00000000 --- 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 761e5507..00000000 --- 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 f18b6f47..00000000 --- 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 b51a0d81..00000000 --- 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 7fe506f0..00000000 --- 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 6b0dcef9..00000000 --- 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 0f519282..00000000 --- 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 0e3c60c4..00000000 --- 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 72870ba6..00000000 --- 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 6b0dcef9..00000000 --- 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 3bc1cd72..00000000 --- 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 dcca5d82..00000000 --- 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 80535ccb..00000000 --- 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 4c4e6923..00000000 --- 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 2aa21689..00000000 --- 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 b77e6934..00000000 --- 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 e23f6935..00000000 --- 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 a905e537..00000000 --- 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 84285615..00000000 --- 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 0b46f351..00000000 --- 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 0f6f797f..00000000 --- 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 1cbc5eef..00000000 --- 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 4d56d8ab..00000000 --- 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 2aa21689..00000000 --- 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 91737abc..00000000 --- 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 98c1d29e..00000000 --- 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 a905e537..00000000 --- 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 e786a76c..00000000 --- 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 6a619068..00000000 --- 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 aa54753b..00000000 --- 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 2aa21689..00000000 --- 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 142a5bef..00000000 --- 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 387a3943..00000000 --- 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 10ebb2e1..00000000 --- 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 7ecf2ddd..00000000 --- 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 ea839cde..00000000 --- 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 e1bc9a43..00000000 --- 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 705406a9..00000000 --- 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 30a3a751..00000000 --- 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 780bd99a..00000000 --- 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 705406a9..00000000 --- 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 3472e637..00000000 --- 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 e498664c..00000000 --- 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 8fc12789..00000000 --- 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 6b67d59f..00000000 --- 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 b2201854..00000000 --- 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 41ed54da..00000000 --- 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 e6eee90f..00000000 --- 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 b7f1a04f..00000000 --- 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 618503df..00000000 --- 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 040d95d4..00000000 --- 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 9a447010..00000000 --- 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 b7f1a04f..00000000 --- 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 d07991fa..00000000 --- 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 d2825418..00000000 --- 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 e6eee90f..00000000 --- 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 b7f1a04f..00000000 --- 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 d799d4e5..00000000 --- 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 387c6254..00000000 --- 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 a6a4afac..00000000 --- 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 b7f1a04f..00000000 --- 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 83fe72a2..00000000 --- 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 07ca48ec..00000000 --- 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 4cb0cffb..00000000 --- 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 7aed1582..00000000 --- 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 2d873b5a..00000000 --- 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 0d4f5564..00000000 --- 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 c1c6e961..00000000 --- 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 748971f2..00000000 --- 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 803c17e1..00000000 --- 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 0d4f5564..00000000 --- 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 c1c6e961..00000000 --- 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 9d6d04b2..00000000 --- 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 4a03ab54..00000000 --- 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 0d4f5564..00000000 --- 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 c1c6e961..00000000 --- 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 d5d5cecc..00000000 --- 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 64a11ae8..00000000 --- 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 140141f7..00000000 --- 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 ed7a2cd1..00000000 --- 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 4428a0ae..00000000 --- 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 4087270d..00000000 --- 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 9564c1e4..00000000 --- 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 8e306356..00000000 --- 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 2a0a6d06..00000000 --- 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 64a11ae8..00000000 --- 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 8c9145de..00000000 --- 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 55246cc3..00000000 --- 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 8bc9b13b..00000000 --- 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 c5220b8f..00000000 --- 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 a80465eb..00000000 --- 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 a36285bc..00000000 --- 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 8c6f0c29..00000000 --- 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 8c6f0c29..00000000 --- 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 128b077d..00000000 --- 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 b1e604bb..00000000 --- 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 d298e7e3..00000000 --- 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 ba5fb3da..00000000 --- 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 7039cea4..00000000 --- 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 782b75e6..00000000 --- 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 782b75e6..00000000 --- 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 12c32031..00000000 --- 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 48374aac..00000000 --- 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 9f6175d1..00000000 --- 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 a5ed034d..00000000 --- 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 23b49974..00000000 --- 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 e7298444..00000000 --- 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 f4c3ad6a..00000000 --- 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 caad4497..00000000 --- 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 63cd4274..00000000 --- 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 e9dccf3e..00000000 --- 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 0a996495..00000000 --- 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 1ef0cd69..00000000 --- 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 052b9915..00000000 --- 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 625dc2ee..00000000 --- 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 4060b2de..00000000 --- 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 052b9915..00000000 --- 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 34c0372d..00000000 --- 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 b0369690..00000000 --- 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 052b9915..00000000 --- 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 ec74a6b2..00000000 --- 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 052b9915..00000000 --- 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 b34ac268..00000000 --- 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 af03220c..00000000 --- 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 052b9915..00000000 --- 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 2a4a66fb..00000000 --- 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 4aa4759e..00000000 --- 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 052b9915..00000000 --- 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 151932e3..00000000 --- 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 129b5d77..00000000 --- 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 052b9915..00000000 --- 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 a9297011..00000000 --- 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 80493637..00000000 --- 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 c33048c8..00000000 --- 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 d555b3d9..00000000 --- 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 e52c6cd8..00000000 --- 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 c33048c8..00000000 --- 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 6e6eb01e..00000000 --- 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 5556ec5d..00000000 --- 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 5c20b3cd..00000000 --- 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 e599e661..00000000 --- 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 c8c94db0..00000000 --- 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 5c20b3cd..00000000 --- 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 aea3105c..00000000 --- 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 9020be0f..00000000 --- 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 052b9915..00000000 --- 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 88a76878..00000000 --- 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 c8e15963..00000000 --- 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 e5f249e9..00000000 --- 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 17d75d77..00000000 --- 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 3c0e8a74..00000000 --- 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 5c20b3cd..00000000 --- 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 ce6664ff..00000000 --- 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 62ff2185..00000000 --- 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 23da556b..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 34245b88..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 67bb6902..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 91917c0a..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 b2a648c9..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 2043ff71..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 bc75c736..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 c0a26188..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 a09c6e65..00000000 --- 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 91db96bc..00000000 --- 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 0eac51d0..00000000 --- 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 840df8ad..00000000 --- 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 1d433e6a..00000000 --- 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 c628656b..00000000 --- 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 840df8ad..00000000 --- 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 23d95a45..00000000 --- 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 0eac51d0..00000000 --- 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 b6554e1e..00000000 --- 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 f4c72089..00000000 --- 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 052b9915..00000000 --- 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 45ce82fe..00000000 --- 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 d62d0bc7..00000000 --- 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 052b9915..00000000 --- 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 43aaba52..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 d705c2cd..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 d7791bd8..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 51787639..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 02e92618..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 6615522a..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 ccead51a..00000000 --- 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 611cba83..00000000 --- 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 052b9915..00000000 --- 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 6531add3..00000000 --- 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 4a129e8b..00000000 --- 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 052b9915..00000000 --- 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 6fdb2244..00000000 --- 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 87f17a78..00000000 --- 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 052b9915..00000000 --- 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 37f22189..00000000 --- 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 f1c8e58f..00000000 --- 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 052b9915..00000000 --- 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 88a76878..00000000 --- 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 c8e15963..00000000 --- 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 e5f249e9..00000000 --- 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 134e871a..00000000 --- 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 b5028b6d..00000000 --- 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 052b9915..00000000 --- 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 c024dac8..00000000 --- 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 09f2b3e4..00000000 --- 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 052b9915..00000000 --- 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 87c29c09..00000000 --- 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 511ac7e6..00000000 --- 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 41a5eeb6..00000000 --- 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 055dfdf2..00000000 --- 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 611cba83..00000000 --- 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 052b9915..00000000 --- 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 a9fd4fcc..00000000 --- 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 7ae52c01..00000000 --- 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 052b9915..00000000 --- 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 3ce14e6b..00000000 --- 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 87f17a78..00000000 --- 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 052b9915..00000000 --- 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 592f1009..00000000 --- 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 5d5b743d..00000000 --- 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 052b9915..00000000 --- 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 1f66b20f..00000000 --- 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 d20b57e5..00000000 --- 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 052b9915..00000000 --- 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 98a1963e..00000000 --- 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 f04f4ecb..00000000 --- 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 052b9915..00000000 --- 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 aea3105c..00000000 --- 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 9020be0f..00000000 --- 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 052b9915..00000000 --- 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 4c2e2879..00000000 --- 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 511ac7e6..00000000 --- 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 41a5eeb6..00000000 --- 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 1f7ff703..00000000 --- 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 625a34d4..00000000 --- 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 ff9e9cc6..00000000 --- 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 a76f6853..00000000 --- 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 cb323e96..00000000 --- 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 6fee2cde..00000000 --- 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 381bac4d..00000000 --- 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 d7e35a25..00000000 --- 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 cb323e96..00000000 --- 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 14526730..00000000 --- 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 a5538774..00000000 --- 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 617e154d..00000000 --- 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 97c6fdd2..00000000 --- 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 8c70fae8..00000000 --- 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 c17c9580..00000000 --- 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 a0fb12b8..00000000 --- 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 5c20b3cd..00000000 --- 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 e82355d0..00000000 --- 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 91cca314..00000000 --- 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 dc75d983..00000000 --- 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 cb323e96..00000000 --- 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 5a62c8c9..00000000 --- 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 bac6b3e3..00000000 --- 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 6629e021..00000000 --- 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 052b9915..00000000 --- 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 28181b3e..00000000 --- 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 b21a92f7..00000000 --- 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 e69de29b..00000000 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 052b9915..00000000 --- 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 bd597668..00000000 --- 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 79e7738a..00000000 --- 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 42101211..00000000 --- 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 cb323e96..00000000 --- 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 044f5c62..00000000 --- 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 63b9668c..00000000 --- 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 a51e1c4d..00000000 --- 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 cb323e96..00000000 --- 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 a146e871..00000000 --- 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 20cedd9b..00000000 --- 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 43ceda18..00000000 --- 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 ec727877..00000000 --- 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 69a77e10..00000000 --- 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 8c482d13..00000000 --- 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 efbb5543..00000000 --- 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 01546404..00000000 --- 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 0fd04319..00000000 --- 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 3669cab8..00000000 --- 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 d7e35a25..00000000 --- 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 97c6fdd2..00000000 --- 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 510edf15..00000000 --- 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 d23fd4d4..00000000 --- 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 5e4ca542..00000000 --- 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 adfc7a84..00000000 --- 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 d1011901..00000000 --- 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 7927ea4a..00000000 --- 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 47140dcf..00000000 --- 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 5c20b3cd..00000000 --- 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 3af5a785..00000000 --- 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 a78dcba3..00000000 --- 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 d0740b63..00000000 --- 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 d4588918..00000000 --- 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 c96d4b23..00000000 --- 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 ef8573ad..00000000 --- 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 ec2e5497..00000000 --- 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 56a4e2ad..00000000 --- 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 1922b26f..00000000 --- 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 d7a024ea..00000000 --- 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 cb323e96..00000000 --- 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 f9c01cc5..00000000 --- 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 a5978b6c..00000000 --- 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 e69de29b..00000000 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 052b9915..00000000 --- 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 bfe7dd0b..00000000 --- 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 96cca0c4..00000000 --- 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 e69de29b..00000000 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 5c20b3cd..00000000 --- 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 8a02a345..00000000 --- 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 dd6c647f..00000000 --- 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 e69de29b..00000000 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 5c20b3cd..00000000 --- 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 8427457d..00000000 --- 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 a1915826..00000000 --- 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 1b2422a4..00000000 --- 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 f66c763f..00000000 --- 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 c5504b93..00000000 --- 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 67b08896..00000000 --- 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 f939ec5c..00000000 --- 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 f939ec5c..00000000 --- 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 d3ddd8bb..00000000 --- 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 12c32031..00000000 --- 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 4e42105d..00000000 --- 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 9d7b4281..00000000 --- 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 9110b4a1..00000000 --- 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 c26f1b85..00000000 --- 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 3ef03d68..00000000 --- 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 f4c3ad6a..00000000 --- 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 e43b97ed..00000000 --- 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 5ba69b6d..00000000 --- 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 8dac5408..00000000 --- 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 8e554498..00000000 --- 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 21e82669..00000000 --- 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 63f28ff8..00000000 --- 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 6ebc43f3..00000000 --- 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 415e9865..00000000 Binary files a/src/test/resources/rml-io/RMLSTC0001b/Friends-UTF16.json and /dev/null differ 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 32997daa..00000000 --- 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 63f28ff8..00000000 --- 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 f669f6b3..00000000 --- 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 8e554498..00000000 --- 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 d7f3ae9a..00000000 --- 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 63f28ff8..00000000 --- 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 6ebc43f3..00000000 --- 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 18bb4516..00000000 Binary files a/src/test/resources/rml-io/RMLSTC0002b/Friends.json.gz and /dev/null differ diff --git a/src/test/resources/rml-io/RMLSTC0002b/README.md b/src/test/resources/rml-io/RMLSTC0002b/README.md deleted file mode 100644 index 2919e46e..00000000 --- a/src/test/resources/rml-io/RMLSTC0002b/README.md +++ /dev/null @@ -1,66 +0,0 @@ -## RMLSTC0002b - -**Title**: Source GZip compression - -**Description**: Test source with GZip compression - -**Error expected?** No - -**Input** - `Friends.json.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.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 63f28ff8..00000000 --- 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 c76bb87d..00000000 --- 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 13324fcc..00000000 --- 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 63f28ff8..00000000 --- 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 18a50cf2..00000000 --- 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 9b19cb56..00000000 Binary files a/src/test/resources/rml-io/RMLSTC0002d/Friends.json.tar.xz and /dev/null differ 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 74d1a384..00000000 --- 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 63f28ff8..00000000 --- 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 175631be..00000000 --- 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 b7144ef3..00000000 --- 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 63f28ff8..00000000 --- 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 d08b82bd..00000000 --- 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 d9456768..00000000 --- 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 0376f5dd..00000000 --- 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 63f28ff8..00000000 --- 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 78cbc569..00000000 --- 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 6a82739b..00000000 --- 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 21f0a61b..00000000 --- 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 63f28ff8..00000000 --- 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 aa44cf16..00000000 --- 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 6a82739b..00000000 --- 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 52cbcb47..00000000 --- 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 63f28ff8..00000000 --- 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 bb39b80c..00000000 --- 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 9fe19573..00000000 --- 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 936b9430..00000000 --- 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 63f28ff8..00000000 --- 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 e864a958..00000000 --- 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 752cdfe4..00000000 --- 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 3e7b5c95..00000000 --- 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 63f28ff8..00000000 --- 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 f8011e89..00000000 --- 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 752cdfe4..00000000 --- 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 73c9ad58..00000000 --- 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 63f28ff8..00000000 --- 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 f0d0f98e..00000000 --- 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 8e554498..00000000 --- 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 94abd46c..00000000 --- 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 63f28ff8..00000000 --- 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 00a2f99e..00000000 --- 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 752cdfe4..00000000 --- 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 90d9e4b9..00000000 --- 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 63f28ff8..00000000 --- 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 a1771888..00000000 --- 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 73fb3964..00000000 --- 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 234696f6..00000000 --- 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 63f28ff8..00000000 --- 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 a4373532..00000000 --- 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 6eb793ab..00000000 --- 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 ce969228..00000000 --- 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 63f28ff8..00000000 --- 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 14f45ed2..00000000 --- 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 8e554498..00000000 --- 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 415235fa..00000000 --- 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 20e36b20..00000000 --- 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 8751f412..00000000 --- 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 1b53bd1d..00000000 --- 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 69665237..00000000 --- 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 8e554498..00000000 --- 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 18fea470..00000000 --- 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 8751f412..00000000 --- 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 8fd68c4d..00000000 --- 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 66cc9dcc..00000000 --- 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 e8d8a64e..00000000 --- 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 a1771888..00000000 --- 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 d9456768..00000000 --- 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 1b386cf0..00000000 --- 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 d960a59b..00000000 --- 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 84392963..00000000 --- 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 1b386cf0..00000000 --- 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 83bee15a..00000000 --- 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 d4e5fe58..00000000 --- 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 bf4cdbed..00000000 --- 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 28355038..00000000 --- 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 77a21531..00000000 --- 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 ac102a3b..00000000 --- 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 6a0f0bfc..00000000 --- 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 28355038..00000000 --- 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 600758be..00000000 --- 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 91a597ea..00000000 --- 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 aed00dd3..00000000 --- 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 28355038..00000000 --- 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 c83222b8..00000000 --- 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 8c92295f..00000000 --- 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 cb2caaf1..00000000 --- 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 28355038..00000000 --- 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 bf945c75..00000000 --- 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 84360e1d..00000000 --- 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 1685d967..00000000 --- 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 28355038..00000000 --- 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 9403b1fb..00000000 --- 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 871a4e81..00000000 --- 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 35634247..00000000 --- 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 6cf391ea..00000000 --- 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 2d195a8a..00000000 --- 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 e506815c..00000000 --- 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 33121fd8..00000000 --- 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 6cf391ea..00000000 --- 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 a6ddb028..00000000 --- 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 bc6e289a..00000000 --- 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 b89b6478..00000000 --- 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 6cf391ea..00000000 --- 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 e7dab8b6..00000000 --- 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 5388d754..00000000 --- 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 a322b1af..00000000 --- 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 6cf391ea..00000000 --- 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 13a0c585..00000000 --- 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 a97be77d..00000000 --- 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 436b7cc1..00000000 --- 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 6cf391ea..00000000 --- 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 9403b1fb..00000000 --- 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 91af0f2b..00000000 --- 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 8e554498..00000000 --- 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 f7669dbb..00000000 --- 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 63f28ff8..00000000 --- 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 00a2f99e..00000000 --- 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 8e554498..00000000 --- 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 34fa66db..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 a6215d4c..00000000 --- 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 8e554498..00000000 --- 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 009ff1dd..00000000 --- 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 f2e60c86..00000000 --- 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 3fc5c8f3..00000000 --- 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 ac7eea7c..00000000 --- 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 8e554498..00000000 --- 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 eb3ac753..00000000 --- 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 f2e60c86..00000000 --- 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 3fc5c8f3..00000000 --- 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 3b58386e..00000000 --- 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 8e554498..00000000 --- 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 86577052..00000000 --- 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 e69de29b..00000000 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 adcefd04..00000000 --- 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 40b34da4..00000000 --- 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 8e554498..00000000 --- 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 ae87dfe1..00000000 --- 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 f2e60c86..00000000 --- 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 8f081be1..00000000 --- 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 51a5bbf2..00000000 --- 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 8e554498..00000000 --- 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 1fb6a2b5..00000000 --- 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 3fc5c8f3..00000000 --- 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 f2e60c86..00000000 --- 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 e8f8fac1..00000000 --- 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 8e554498..00000000 --- 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 299577a2..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 d9456768..00000000 --- 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 a6647f3c..00000000 --- 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 8e554498..00000000 --- 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 f24589b1..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 35a39502..00000000 --- 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 d218116d..00000000 --- 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 8e554498..00000000 --- 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 e1c45b0d..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 35a39502..00000000 --- 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 d5466bdc..00000000 --- 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 8e554498..00000000 --- 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 76f1adfc..00000000 --- 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 e69de29b..00000000 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 3fc5c8f3..00000000 --- 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 35a39502..00000000 --- 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 c3833569..00000000 --- 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 8e554498..00000000 --- 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 73346493..00000000 --- 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 e69de29b..00000000 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 3fc5c8f3..00000000 --- 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 35a39502..00000000 --- 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 d9456768..00000000 --- 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 9b7a9672..00000000 --- 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 8e554498..00000000 --- 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 3e480183..00000000 --- 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 e69de29b..00000000 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 0cbc7f5b..00000000 --- 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 488d76f7..00000000 --- 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 1e4138bb..00000000 --- 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 8e554498..00000000 --- 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 957cf963..00000000 --- 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 e69de29b..00000000 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 42e9dfe2..00000000 --- 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 488d76f7..00000000 --- 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 a6b87c58..00000000 --- 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 8e554498..00000000 --- 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 878af28c..00000000 --- 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 e69de29b..00000000 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 42e9dfe2..00000000 --- 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 488d76f7..00000000 --- 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 ced88d89..00000000 --- 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 8e554498..00000000 --- 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 371a4cc3..00000000 --- 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 e69de29b..00000000 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 fb4f3a4b..00000000 --- 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 8f081be1..00000000 --- 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 a5af0ef6..00000000 --- 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 8e554498..00000000 --- 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 0838260f..00000000 --- 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 e69de29b..00000000 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 35a39502..00000000 --- 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 8f081be1..00000000 --- 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 fd7f1424..00000000 --- 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 8e554498..00000000 --- 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 656b5cbb..00000000 --- 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 250e23c4..00000000 --- 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 b92731fc..00000000 --- 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 b92731fc..00000000 --- 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 17dcb839..00000000 --- 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 8e554498..00000000 --- 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 c688f6dd..00000000 --- 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 e69de29b..00000000 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 3fc5c8f3..00000000 --- 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 c3eeab33..00000000 --- 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 9fae6b4c..00000000 --- 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 8e554498..00000000 --- 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 6727d987..00000000 --- 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 e69de29b..00000000 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 3fc5c8f3..00000000 --- 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 35a39502..00000000 --- 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 d3fd84f1..00000000 --- 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 8e554498..00000000 --- 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 e0a1076f..00000000 --- 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 e69de29b..00000000 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 3fc5c8f3..00000000 --- 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 35a39502..00000000 --- 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 6371637d..00000000 --- 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 8e554498..00000000 --- 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 67d69c41..00000000 --- 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 e69de29b..00000000 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 b5a5e2b8..00000000 --- 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 61c543c5..00000000 --- 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 7ffad944..00000000 --- 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 8e554498..00000000 --- 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 8975f25b..00000000 --- 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 f2e60c86..00000000 --- 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 8f081be1..00000000 --- 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 e6de67d3..00000000 --- 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 b7d772ea..00000000 --- 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 8e554498..00000000 --- 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 e173efb3..00000000 --- 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 3fc5c8f3..00000000 --- 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 f2e60c86..00000000 --- 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 1cebdfcb..00000000 --- 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 a049f6db..00000000 --- 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 8e554498..00000000 --- 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 06d17ffa..00000000 --- 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 e69de29b..00000000 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 36247500..00000000 --- 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 97dfc619..00000000 --- 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 8e554498..00000000 --- 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 61447677..00000000 --- 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 e69de29b..00000000 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 3fc5c8f3..00000000 --- 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 35a39502..00000000 --- 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 615f15e6..00000000 --- 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 8e554498..00000000 --- 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 1233d592..00000000 --- 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 e69de29b..00000000 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 5bddb0d5..00000000 --- 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 7ed7673a..00000000 --- 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 8e554498..00000000 --- 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 86e5e6d2..00000000 --- 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 e69de29b..00000000 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 04c89772..00000000 --- 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 255349f2..00000000 --- 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 8e554498..00000000 --- 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 72e1b327..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 30977d24..00000000 --- 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 8e554498..00000000 --- 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 68b41dbc..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 e2b46141..00000000 --- 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 8e554498..00000000 --- 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 84c3c4c1..00000000 --- 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 e69de29b..00000000 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 aff9b74f..00000000 --- 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 c27fded8..00000000 --- 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 8e554498..00000000 --- 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 83c12590..00000000 --- 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 e69de29b..00000000 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 9e028bbc..00000000 --- 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 4a100eb8..00000000 --- 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 8e554498..00000000 --- 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 f44425ce..00000000 --- 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 e69de29b..00000000 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 2032b0fe..00000000 --- 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 7ebf1021..00000000 --- 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 8e554498..00000000 --- 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 3e87f9b3..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 8ec724a5..00000000 --- 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 8e554498..00000000 --- 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 6f8b8933..00000000 --- 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 e69de29b..00000000 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 0cb7fa22..00000000 Binary files a/src/test/resources/rml-io/RMLTTC0005b/dump1.nq and /dev/null differ 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 69dc45bc..00000000 --- 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 8e554498..00000000 --- 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 96554c9e..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 e2b46141..00000000 --- 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 8e554498..00000000 --- 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 52bb0398..00000000 --- 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 e69de29b..00000000 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 f486fec1..00000000 Binary files a/src/test/resources/rml-io/RMLTTC0006b/dump1.nq.gz and /dev/null differ diff --git a/src/test/resources/rml-io/RMLTTC0006b/mapping.ttl b/src/test/resources/rml-io/RMLTTC0006b/mapping.ttl deleted file mode 100644 index ad46411f..00000000 --- a/src/test/resources/rml-io/RMLTTC0006b/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.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 8e554498..00000000 --- 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 15435e90..00000000 --- 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 e69de29b..00000000 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 e4395a84..00000000 --- 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 8e554498..00000000 --- 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 d60b367d..00000000 --- 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 e69de29b..00000000 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 b671d160..00000000 Binary files a/src/test/resources/rml-io/RMLTTC0006d/dump1.nq.tar.xz and /dev/null differ 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 6c914e77..00000000 --- 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 8e554498..00000000 --- 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 42e7ca17..00000000 --- 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 e69de29b..00000000 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 c71d369d..00000000 --- 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 8e554498..00000000 --- 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 4e2f4339..00000000 --- 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 e69de29b..00000000 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 d9456768..00000000 --- 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 e2b46141..00000000 --- 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 ded0cc29..00000000 --- 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 6dc4cf95..00000000 --- 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 dca42297..00000000 --- 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 0a514b5a..00000000 --- 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 5707a03d..00000000 --- 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 87cb8a9c..00000000 --- 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 55fa3c7b..00000000 --- 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 55fa3c7b..00000000 --- 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 12c32031..00000000 --- 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 1b386867..00000000 --- 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 3f5dfbbd..00000000 --- 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 2eb9a286..00000000 --- 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 c89d031e..00000000 --- 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 5b514ad9..00000000 --- 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 f4c3ad6a..00000000 --- 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 086c84b6..00000000 --- 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 5fd1ecfb..00000000 --- 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 57adbc3f..00000000 --- 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 6fa5a1e9..00000000 --- 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 ac68a610..00000000 --- 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 1112907a..00000000 --- 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 87d56294..00000000 --- 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 f94dd6f3..00000000 --- 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 75c424e4..00000000 --- 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 f611f1d9..00000000 --- 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 edc942d0..00000000 --- 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 ba0afbb7..00000000 --- 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 3f5abf02..00000000 --- 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 1112907a..00000000 --- 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 87d56294..00000000 --- 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 ae410248..00000000 --- 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 ac68a610..00000000 --- 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 1112907a..00000000 --- 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 87d56294..00000000 --- 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 3eb3a775..00000000 --- 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 ff5012c6..00000000 --- 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 dcc01ba7..00000000 --- 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 87d56294..00000000 --- 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 d393dd62..00000000 --- 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 14291044..00000000 --- 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 69788f73..00000000 --- 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 49969657..00000000 --- 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 325b3a8e..00000000 --- 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 a380b398..00000000 --- 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 69788f73..00000000 --- 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 49969657..00000000 --- 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 b3b38af6..00000000 --- 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 34c964e3..00000000 --- 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 c4b95144..00000000 --- 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 87d56294..00000000 --- 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 658f01ec..00000000 --- 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 d7ad0c71..00000000 --- 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 83d339e1..00000000 --- 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 87d56294..00000000 --- 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 b81753d2..00000000 --- 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 01a2ad1b..00000000 --- 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 21ccc919..00000000 --- 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 485614f6..00000000 --- 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 d91733b0..00000000 --- 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 bd016a26..00000000 --- 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 39629980..00000000 --- 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 87d56294..00000000 --- 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 b968da6d..00000000 --- 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 a1f81288..00000000 --- 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 7a701645..00000000 --- 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 87d56294..00000000 --- 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 2db9a5fe..00000000 --- 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 56ec415c..00000000 --- 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 55e161ec..00000000 --- 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 c2fd489f..00000000 --- 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 63999a1a..00000000 --- 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 12e315bd..00000000 --- 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 39629980..00000000 --- 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 87d56294..00000000 --- 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 d598e0ef..00000000 --- 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 95dc2d43..00000000 --- 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 ad329751..00000000 --- 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 87d56294..00000000 --- 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 8ab10b2d..00000000 --- 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 5d4e57d7..00000000 --- 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 ad329751..00000000 --- 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 c2fd489f..00000000 --- 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 66c92b6c..00000000 --- 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 f7a7b45d..00000000 --- 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 3eda03ce..00000000 --- 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 8ed0174c..00000000 --- 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 915c20b9..00000000 --- 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 c5ff6f41..00000000 --- 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 87d56294..00000000 --- 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 d56b87eb..00000000 --- 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 3e9544bd..00000000 --- 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 87d56294..00000000 --- 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 5881d48f..00000000 --- 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 52490995..00000000 --- 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 87d56294..00000000 --- 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 6b61668e..00000000 --- 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 57e71072..00000000 --- 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 f9fd2a83..00000000 --- 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 edc942d0..00000000 --- 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 c2fd489f..00000000 --- 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 b4704924..00000000 --- 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 ee5f0a23..00000000 --- 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 24fec8f3..00000000 --- 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 edc942d0..00000000 --- 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 c2fd489f..00000000 --- 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 34ac3709..00000000 --- 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 cdcc7ec4..00000000 --- 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 43c6b6d9..00000000 --- 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 edc942d0..00000000 --- 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 c2fd489f..00000000 --- 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 103cc9b0..00000000 --- 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 203731c8..00000000 --- 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 84508df4..00000000 --- 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 dffa206c..00000000 --- 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 edc942d0..00000000 --- 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 c2fd489f..00000000 --- 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 103cc9b0..00000000 --- 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 2e9ac2e9..00000000 --- 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 8cad87cd..00000000 --- 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 2449c7d3..00000000 --- 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 edc942d0..00000000 --- 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 c2fd489f..00000000 --- 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 526c93c7..00000000 --- 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 009bccba..00000000 --- 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 3b109d96..00000000 --- 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 5a125374..00000000 --- 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 0bf782c4..00000000 --- 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 c2fd489f..00000000 --- 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 3d2571d1..00000000 --- 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 6f8c6f12..00000000 --- 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 da66633b..00000000 --- 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 cec6cb6b..00000000 --- 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 6b1c2d3c..00000000 --- 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 e984ea50..00000000 --- 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 e52543f1..00000000 --- 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 eda1eb05..00000000 --- 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 1dbd0667..00000000 --- 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 0bec70b8..00000000 --- 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 da66633b..00000000 --- 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 af0dd764..00000000 --- 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 8dab0871..00000000 --- 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 8295ade6..00000000 --- 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 bfa0672a..00000000 --- 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 fed9db6c..00000000 --- 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 f9fd2a83..00000000 --- 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 edc942d0..00000000 --- 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 c2fd489f..00000000 --- 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 2a3de1b6..00000000 --- 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 b238c10f..00000000 --- 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 87d56294..00000000 --- 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 02362e36..00000000 --- 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 6d32c26e..00000000 --- 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 87d56294..00000000 --- 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 547b9108..00000000 --- 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 a5e46121..00000000 --- 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 2361327a..00000000 --- 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 6916b82f..00000000 --- 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 458d72f0..00000000 --- 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 edc942d0..00000000 --- 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 35085f72..00000000 --- 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 88b86d15..00000000 --- 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 b5695694..00000000 --- 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 103cc9b0..00000000 --- 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 c2fd489f..00000000 --- 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 54d25229..00000000 --- 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 7973ff32..00000000 --- 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 f95d42af..00000000 --- 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 9868a5e3..00000000 --- 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 ac943f89..00000000 --- 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 8fa4666e..00000000 --- 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 3588dcc1..00000000 --- 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 f95999f8..00000000 --- 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 70bbcb8a..00000000 --- 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 b0c480a5..00000000 --- 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 c74314d0..00000000 --- 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 9cc552ae..00000000 --- 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 c74314d0..00000000 --- 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 12c32031..00000000 --- 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 2be2cb80..00000000 --- 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 7e92bc26..00000000 --- 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 3d36a935..00000000 --- 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 bff25c5c..00000000 --- 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 97a2cd6c..00000000 --- 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 f4c3ad6a..00000000 --- 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 f19d17bd..00000000 --- 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 4efe6d74..00000000 --- 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 29c5d463..00000000 --- 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 53b4c429..00000000 --- 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 63ec2335..00000000 --- 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 2d94448c..00000000 --- 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 2741ea39..00000000 --- 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 f6cfd6e0..00000000 --- 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 7de02b72..00000000 --- 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 e9826ef3..00000000 --- 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 2d94448c..00000000 --- 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 34a26c8f..00000000 --- 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 9ddd32a2..00000000 --- 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 c301bf7e..00000000 --- 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 2dc337a9..00000000 --- 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 6493c891..00000000 --- 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 bd188285..00000000 --- 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 0335530d..00000000 --- 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 372d0f92..00000000 --- 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 2dc337a9..00000000 --- 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 f45d6bea..00000000 --- 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 3d2bf5e1..00000000 --- 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 4d461697..00000000 --- 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 d6a50cbe..00000000 --- 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 4b162d6c..00000000 --- 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 3999e70c..00000000 --- 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 16d66b2d..00000000 --- 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 edab9cc6..00000000 --- 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 d6a50cbe..00000000 --- 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 267673c0..00000000 --- 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 2cfbe0fa..00000000 --- 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 06b3511b..00000000 --- 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 7a8d3131..00000000 --- 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 0e2b6c57..00000000 --- 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 97346277..00000000 --- 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 0e26a38d..00000000 --- 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 6ea45025..00000000 --- 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 7a8d3131..00000000 --- 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 36136480..00000000 --- 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 a4c3707d..00000000 --- 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 9cfe1409..00000000 --- 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 7f2be99c..00000000 --- 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 4cd0c9e9..00000000 --- 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 9fe2369b..00000000 --- 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 0e26a38d..00000000 --- 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 1b885da3..00000000 --- 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 7f2be99c..00000000 --- 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 e8680bc0..00000000 --- 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 3ca6ac76..00000000 --- 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 5de699b9..00000000 --- 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 5aa2cb20..00000000 --- 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 46aaa776..00000000 --- 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 9fe2369b..00000000 --- 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 a08b98a4..00000000 --- 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 c1baf80d..00000000 --- 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 5aa2cb20..00000000 --- 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 6857003c..00000000 --- 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 b0543404..00000000 --- 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 16a4cece..00000000 --- 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 16b9420a..00000000 --- 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 bfec08ac..00000000 --- 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 57395e8f..00000000 --- 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 f65494b9..00000000 --- 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 89ea0073..00000000 --- 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 16b9420a..00000000 --- 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 3b477451..00000000 --- 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 48f51863..00000000 --- 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 9144682f..00000000 --- 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 fe36da8e..00000000 --- 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 fa79a530..00000000 --- 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 1f57ab59..00000000 --- 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 ffa3f9ca..00000000 --- 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 ee753626..00000000 --- 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 fe36da8e..00000000 --- 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 b6c8fb65..00000000 --- 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 9e93cb60..00000000 --- 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 311477dc..00000000 --- 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 5c7fe8e7..00000000 --- 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 9e93cb60..00000000 --- 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 48960292..00000000 --- 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 a967e7c7..00000000 --- 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 69063261..00000000 --- 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 1a97616f..00000000 --- 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 d764af76..00000000 --- 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 189b11a8..00000000 --- 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 189b11a8..00000000 --- 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 d9a0567b..00000000 --- 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 311477dc..00000000 --- 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 d9a0567b..00000000 --- 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 48960292..00000000 --- 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 12c32031..00000000 --- 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 f3501f45..00000000 --- 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 e57c05c4..00000000 --- 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 95f2f27c..00000000 --- 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 e9c0960c..00000000 --- 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 177fb7a7..00000000 --- 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 f4c3ad6a..00000000 --- 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 3a3f1e99..00000000 --- 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 228143d4..00000000 --- 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 5de825f9..00000000 --- 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 63ec2335..00000000 --- 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 2d94448c..00000000 --- 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 f6cfd6e0..00000000 --- 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 15677400..00000000 --- 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 e9826ef3..00000000 --- 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 2d94448c..00000000 --- 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 c44682d4..00000000 --- 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 c301bf7e..00000000 --- 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 2dc337a9..00000000 --- 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 bd188285..00000000 --- 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 6c461cb5..00000000 --- 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 372d0f92..00000000 --- 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 2dc337a9..00000000 --- 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 98b64639..00000000 --- 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 4d461697..00000000 --- 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 d6a50cbe..00000000 --- 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 3999e70c..00000000 --- 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 76b3614a..00000000 --- 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 edab9cc6..00000000 --- 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 d6a50cbe..00000000 --- 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 6b3d2345..00000000 --- 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 06b3511b..00000000 --- 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 7a8d3131..00000000 --- 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 97346277..00000000 --- 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 d07b44ae..00000000 --- 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 6ea45025..00000000 --- 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 7a8d3131..00000000 --- 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 fc181e5f..00000000 --- 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 9cfe1409..00000000 --- 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 7f2be99c..00000000 --- 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 9fe2369b..00000000 --- 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 d07b44ae..00000000 --- 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 1b885da3..00000000 --- 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 7f2be99c..00000000 --- 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 8ffc2012..00000000 --- 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 5de699b9..00000000 --- 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 5aa2cb20..00000000 --- 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 9fe2369b..00000000 --- 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 80e83100..00000000 --- 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 c1baf80d..00000000 --- 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 5aa2cb20..00000000 --- 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 d20882cf..00000000 --- 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 16a4cece..00000000 --- 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 16b9420a..00000000 --- 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 57395e8f..00000000 --- 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 8e56adc6..00000000 --- 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 89ea0073..00000000 --- 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 16b9420a..00000000 --- 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 e495323f..00000000 --- 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 9144682f..00000000 --- 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 041b8573..00000000 --- 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 1f57ab59..00000000 --- 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 edee9b83..00000000 --- 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 ee753626..00000000 --- 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 fe36da8e..00000000 --- a/src/test/resources/rml-star/valid/RMLSTARTC008b/output.nt +++ /dev/null @@ -1 +0,0 @@ -<<<<>><<>>>><<<<>><<>>>>.