├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── question.md └── no-response.yml ├── .gitignore ├── .gitlab-ci.yml ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── README.md ├── RELEASE.md ├── action.yml ├── bin ├── generator.js └── parser.js ├── build-release.sh ├── figures ├── step1.png └── step2.png ├── get-changes.sh ├── lib ├── abstract-generator.js ├── expander.js ├── expander.test.js ├── formulations.json ├── jdbc-drivers.json ├── logger.js ├── namespaces.js ├── normalize-rml.js ├── r2rml-generator.js ├── r2rml-generator.test.js ├── rdfa-context.json ├── readable-rml.js ├── rml-generator.js ├── rml-generator.test.js ├── tools.js ├── tools.test.js ├── watcher.js ├── yarrrml-generator.js └── yarrrml-generator.test.js ├── package-lock.json ├── package.json ├── release.sh ├── resources ├── fn.rml.ttl ├── fn.yml ├── mapping.rml.ttl ├── mapping2.rml.ttl ├── mapping3.rml.ttl ├── mapping4.rml.ttl ├── mapppingA.rml.ttl ├── test-db.yml ├── test.rml.jsonld ├── test.rml.ttl ├── test.yarrr.yml ├── test1.yml └── test2.yml └── test ├── author ├── array-with-objects │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── array-with-strings │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── array-with-webids │ ├── mapping.rml.ttl │ └── mapping.yarrrml └── single-string │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── betweenourworlds ├── anime │ ├── mapping.rml.ttl │ └── mapping.yarrrml └── character │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── condition-function-on-po ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-mapping-constant ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-mapping-multiple ├── mapping.rml.ttl └── mapping.yarrr.yml ├── condition-on-mapping-nested ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-mapping-subject-function ├── input.csv ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-mapping-with-blanknode ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-mapping ├── r2rml │ ├── mapping.r2rml.ttl │ └── mapping.yml └── rml │ ├── mapping.rml.ttl │ ├── mapping.yml │ └── test.csv ├── condition-on-po-datatype ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-po-language ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-po-target ├── mapping.rml.ttl └── mapping.yarrrml ├── condition-on-po ├── r2rml │ ├── mapping.r2rml.ttl │ └── mapping.yml └── rml │ ├── mapping.rml.ttl │ ├── mapping.yml │ └── test.csv ├── condition-on-single-object ├── mapping.rml.ttl ├── mapping.yarrrml └── test.csv ├── csv-delimiter ├── semicolon │ ├── data.txt │ ├── mapping.rml.ttl │ └── mapping.yarrrml └── tab │ ├── data.tsv │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── datatype-on-function ├── mapping.rml.ttl └── mapping.yarrrml ├── dynamic-target-test ├── file-source-direct-http-target │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── file-source-file-target-id-id │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── file-source-file-target-id-key │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── file-source-file-target-multiple │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── file-source-file-target-object │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── file-source-file-target-predicate │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── file-source-file-target-variables-array │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── file-source-file-target │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml └── file-source-linked-http-target │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── equal-reverse ├── data.csv ├── mapping.rml.ttl └── mapping.yarrrml ├── equal ├── data.csv ├── mapping.rml.ttl └── mapping.yarrrml ├── escape-bracket ├── mapping.rml.ttl └── mapping.yarrrml ├── escape-character ├── mapping.rml.ttl └── mapping.yarrrml ├── escape-colon-object ├── mapping.rml.ttl └── mapping.yarrrml ├── example1 ├── r2rml │ ├── mapping.r2rml.ttl │ └── mapping.yml └── rml │ ├── mapping.rml.ttl │ └── mapping.yml ├── example3 ├── mapping.rml.ttl └── mapping.yml ├── example4 ├── r2rml │ ├── mapping.r2rml.ttl │ └── mapping.yml └── rml │ ├── mapping.rml.ttl │ └── mapping.yml ├── example5 ├── r2rml │ ├── mapping.r2rml.ttl │ └── mapping.yml └── rml │ ├── mapping.rml.ttl │ └── mapping.yml ├── example8 ├── r2rml │ ├── mapping.r2rml.ttl │ └── mapping.yml └── rml │ ├── mapping.rml.ttl │ └── mapping.yml ├── external-references ├── 1 │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 2 │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 3 │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 4 │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml └── 5 │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── fno-parameter-as-iri ├── mapping.rml.ttl └── mapping.yml ├── function-shortcut-with-2-parameters ├── mapping.rml.ttl └── mapping.yml ├── function-shortcut-with-prefix ├── mapping.rml.ttl └── mapping.yml ├── function-shortcut-without-prefix ├── mapping.rml.ttl └── mapping.yml ├── function-without-parameters ├── mapping.rml.ttl └── mapping.yarrrml ├── graph ├── mapping.rml.ttl ├── mapping.yml ├── mapping_fno.rml.ttl └── mapping_fno.yml ├── incrml-ldes ├── original-ldes │ ├── all-properties │ │ ├── mapping.rml.ttl │ │ └── mapping.yarrrml.yaml │ ├── new-member-on-temperature-change │ │ ├── mapping.rml.ttl │ │ └── mapping.yarrrml.yaml │ ├── new-member-on-timestamp-change │ │ ├── mapping.rml.ttl │ │ └── mapping.yarrrml.yaml │ └── readings.csv └── test-cases │ ├── RMLLDES0001a │ ├── base.rml.ttl │ └── base.yarrrml.yaml │ ├── RMLLDES0001e │ ├── base.rml.ttl │ └── base.yarrrml.yaml │ └── RMLLDES0002e │ ├── base.rml.ttl │ ├── base.yarrrml.yaml │ ├── change.rml.ttl │ └── change.yarrrml.yaml ├── invalid ├── invalid_yaml.yml └── po-without-o.yml ├── joincondition-template-1-reference-text ├── mapping.rml.ttl └── mapping.yarrrml ├── joincondition-template-2-references ├── mapping.rml.ttl └── mapping.yarrrml ├── joincondition-with-function ├── mapping.rml.ttl └── mapping.yml ├── language-map ├── constant-lang-string │ ├── mapping.rml.ttl │ ├── mapping.yarrrml │ └── person.json ├── constant │ ├── mapping.rml.ttl │ ├── mapping.yarrrml │ └── person.json ├── reference │ ├── mapping.rml.ttl │ ├── mapping.yarrrml │ └── person.json └── template │ ├── mapping.rml.ttl │ ├── mapping.yarrrml │ └── person.json ├── metadata ├── r2rml │ ├── mapping.r2rml.ttl │ └── mapping.yarrrml └── rml │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── multiple-input-files ├── mapping-1.yarrrml ├── mapping-2.yarrrml └── mapping.rml.ttl ├── multiple-sources-with-linked-mappings ├── mapping.rml.ttl └── mapping.yarrrml ├── multiple-sources ├── mapping.rml.ttl └── mapping.yarrrml ├── namednode ├── mapping.rml.ttl └── mapping.yarrrml.yml ├── object-blank-node ├── constant │ ├── data.csv │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── data.csv ├── mapping.rml.ttl ├── mapping.yarrrml └── template │ ├── data.csv │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── object-number ├── mapping.rml.ttl └── mapping.yarrrml ├── oracle ├── mapping.rml.ttl └── mapping.yarrrml ├── predicate-with-prefix-template ├── mapping.rml.ttl └── mapping.yml ├── prefix-expand ├── mapping.rml.ttl ├── mapping.yml └── output.1.rml.ttl ├── prettify_ttl.js ├── r2rml-test-cases ├── R2RMLTC0001a │ ├── mapping.r2rml.ttl │ └── mapping.yarrrml ├── R2RMLTC0002a │ ├── mapping.r2rml.ttl │ └── mapping.yarrrml ├── R2RMLTC0002d │ ├── mapping.r2rml.ttl │ └── mapping.yarrrml ├── R2RMLTC0002i │ ├── mapping.r2rml.ttl │ └── mapping.yarrrml └── R2RMLTC0009a │ ├── mapping.r2rml.ttl │ └── mapping.yarrrml ├── recursive-functions ├── data.csv ├── mapping.rml.ttl └── mapping.yml ├── rml2yarrrml ├── 1_simple │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yml └── 2_joins │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yml ├── rr_class ├── 1-single │ ├── mapping.r2rml.ttl │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 2-multiple │ ├── mapping.r2rml.ttl │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 3-no-iri │ ├── mapping.r2rml.ttl │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 4-rdf-type │ ├── mapping.r2rml.ttl │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 5-custom-rdf-prefix │ ├── mapping.r2rml.ttl │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 6-multiple-rows │ ├── mapping.r2rml.ttl │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── 7-function │ ├── mapping.r2rml.ttl │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml └── 8-reference │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── spec ├── graphs-all-triples │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml └── mapping-with-database-as-source │ ├── mapping.rml.ttl │ └── mapping.yarrr.yml ├── subjectmap-with-function ├── mapping.rml.ttl └── mapping.yml ├── subjectmap-with-reference ├── mapping.rml.ttl └── mapping.yml ├── target-http-request ├── direct-with-auth-in-mapping │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── direct-with-auth │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── direct-without-auth │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── linked-with-auth │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml └── linked-without-auth │ ├── mapping.rml.ttl │ └── mapping.yarrrml.yaml ├── target-reference ├── graph │ ├── mapping-inline.rml.ttl │ ├── mapping-inline.yarrrml │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── language │ ├── mapping-inline.rml.ttl │ ├── mapping-inline.yarrrml │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── object │ ├── mapping-inline.rml.ttl │ ├── mapping-inline.yarrrml │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── predicate │ ├── mapping-inline.rml.ttl │ ├── mapping-inline.yarrrml │ ├── mapping.rml.ttl │ └── mapping.yarrrml └── subject │ ├── mapping-inline.rml.ttl │ ├── mapping-inline.yarrrml │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── target-single ├── dcat │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── local-file │ ├── mapping-shortcut1.rml.ttl │ ├── mapping-shortcut1.yarrrml │ ├── mapping-shortcut2.rml.ttl │ ├── mapping-shortcut2.yarrrml │ ├── mapping-shortcut3.rml.ttl │ ├── mapping-shortcut3.yarrrml │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── sparql-update │ ├── mapping-shortcut.yarrrml │ ├── mapping.rml.ttl │ └── mapping.yarrrml └── void │ ├── mapping.rml.ttl │ └── mapping.yarrrml ├── target-supergirl ├── mapping.rml.ttl └── mapping.yarrrml ├── template-2-references ├── mapping.rml.ttl └── mapping.yarrrml ├── template-escape ├── data.json ├── mapping.rml.ttl └── mapping.yml ├── trivial ├── null.rml.ttl └── null.yml ├── wot-apisecurityscheme ├── mapping.rml.ttl └── mapping.yarrrml ├── wot-irail ├── mapping.rml.ttl └── mapping.yarrrml ├── wot-nosecurityscheme ├── mapping-shortcut.yarrrml ├── mapping.rml.ttl └── mapping.yarrrml └── wot-without-security ├── mapping.rml.ttl └── mapping.yarrrml /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Issue type: :bug: Bug 11 | 12 | ### Description 13 | _A clear and concise description of what the bug is._ 14 | 15 | ### Steps 16 | _Add the necessary steps to replicate the bug._ 17 | 18 | ### Environment 19 | _Add the version of Java and OS that is used._ 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Issue type: :unicorn: Feature 11 | 12 | ### Description 13 | _Add a clear and concise description of what the feature is_ 14 | 15 | ### Why it is useful 16 | _Add why the feature is useful._ 17 | 18 | ### Existing features it breaks 19 | _List all existing features that this new feature will break._ 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Issue type: :question: Question 11 | -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-no-response - https://github.com/probot/no-response 2 | 3 | # Number of days of inactivity before an Issue is closed for lack of response 4 | daysUntilClose: 28 5 | # Label requiring a response 6 | responseRequiredLabel: more-information-needed 7 | # Comment to post when closing an Issue for lack of response. Set to `false` to disable 8 | closeComment: > 9 | This issue has been automatically closed because there has been no response 10 | to our request for more information from the original author. With only the 11 | information that is currently in the issue, we don't have enough information 12 | to take action. Please reach out if you have or find the answers we need so 13 | that we can investigate further. 14 | 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | ############################## 2 | # # 3 | # yarrrml-parser # 4 | # # 5 | ############################## 6 | # 7 | # (c) Dylan Van Assche (2022) 8 | # IDLab - Ghent University - imec 9 | # 10 | # CI jobs for the YARRRML parser. 11 | # 12 | # 13 | # CI variables: 14 | # - GITHUB_ACCESS_TOKEN: Access token for accessing Github repositories as variable, example: sdjlsdgfkj;sk 15 | # - GITHUB_REPO: Github repo, example: github.com/RMLio/rmlmapper-java 16 | # - GITHUB_ARTIFACTS: Artifacts to upload together with th release, example: target/*.jar 17 | # - NPM_TOKEN: Access token for accessing NPM repositories, example: sdjlsdgfkj;skf145 18 | # External scripts: 19 | # - ./get-changes.sh: returns the release notes for the Github Release description 20 | # - ./build-release.sh: builds a release artifact and stores it in the $GITHUB_ARTIFACTS location 21 | # 22 | # Always use protected & masked mode if possible for CI variables! 23 | # See https://gitlab.ilabt.imec.be/rml/util/ci-templates for a detailed explanation 24 | stages: 25 | - lint 26 | - unittests 27 | - mirror 28 | - release 29 | - deploy 30 | 31 | include: 32 | # Make sure the CHANGELOG is always updated 33 | - project: 'rml/util/ci-templates' 34 | ref: main 35 | file: 'CHANGELOG.gitlab-ci.yml' 36 | 37 | # Cancel pipeline if a newer pipeline is running 38 | default: 39 | interruptible: true 40 | 41 | # Run unittests 42 | Unittests: 43 | image: alpine:latest 44 | stage: unittests 45 | before_script: 46 | - apk add nodejs npm 47 | script: 48 | - npm install 49 | - npm run test 50 | except: 51 | - development 52 | - master 53 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-alpine 2 | 3 | WORKDIR /app 4 | 5 | ADD . . 6 | 7 | RUN npm ci 8 | 9 | ENTRYPOINT ["node", "/app/bin/parser.js"] 10 | CMD ["-h"] 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 RDF Mapping Language (RML) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Releases 2 | 3 | Make a release by **unning the `release.sh` script** as followed: 4 | 5 | `./release.sh $TAG` 6 | 7 | For example (v1.0.0): 8 | 9 | `./release.sh 1.0.0` 10 | 11 | After making the release, also publish a **release manually on GitHub**. 12 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | # GitHub Actions to run the RML Mapper 2 | name: 'YARRRML Parser' 3 | description: 'Convert YARRRML rules to RML rules using the YARRRML Parser.' 4 | branding: 5 | icon: 'edit-3' 6 | color: 'blue' 7 | inputs: 8 | input: 9 | description: 'Input YARRRML file to convert to RML' 10 | required: true 11 | default: 'input.yarrr.yml' 12 | output: 13 | description: 'Path to output file' 14 | required: true 15 | default: 'output.rml.ttl' 16 | format: 17 | description: 'RML or R2RML (default: RML)' 18 | required: false 19 | default: 'RML' 20 | outputs: 21 | rml_output: 22 | description: 'RML rules generated from the YARRRML rules.' 23 | runs: 24 | using: 'docker' 25 | image: 'Dockerfile' 26 | args: 27 | - "--input" 28 | - ${{ inputs.input }} 29 | - "--output" 30 | - ${{ inputs.output }} 31 | - "--format" 32 | - ${{ inputs.format }} 33 | -------------------------------------------------------------------------------- /build-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Nothing to build for NPM packages" 4 | exit 0 5 | -------------------------------------------------------------------------------- /figures/step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RMLio/yarrrml-parser/2d167442baaa1fde492f6da34af53d7f4f88b909/figures/step1.png -------------------------------------------------------------------------------- /figures/step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RMLio/yarrrml-parser/2d167442baaa1fde492f6da34af53d7f4f88b909/figures/step2.png -------------------------------------------------------------------------------- /get-changes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TAG=$(git tag -l "v*" --sort=-creatordate | head -n1 | cut -c2-) 4 | FOUND_CHANGES=false 5 | cat CHANGELOG.md | while read line; do 6 | # Detect end of new changes 7 | if [[ "$line" == "## "* ]] && [[ "$FOUND_CHANGES" == true ]]; then 8 | exit 0 9 | fi 10 | 11 | # Print new changes 12 | if [[ $FOUND_CHANGES == true ]]; then 13 | echo "$line" 14 | fi 15 | 16 | # Detect start of new changes 17 | if [[ "$line" == "## $TAG"* ]]; then 18 | FOUND_CHANGES=true 19 | fi 20 | done 21 | -------------------------------------------------------------------------------- /lib/formulations.json: -------------------------------------------------------------------------------- 1 | { 2 | "query": { 3 | "sql2008": "http://www.w3.org/ns/r2rml#SQL2008", 4 | "oracle": "http://www.w3.org/ns/r2rml#Oracle", 5 | "mysql": "http://www.w3.org/ns/r2rml#MySQL", 6 | "mssql": "http://www.w3.org/ns/r2rml#MSSQLServer", 7 | "hsql": "http://www.w3.org/ns/r2rml#HSQLDB", 8 | "postgresql": "http://www.w3.org/ns/r2rml#PostgreSQL", 9 | "db2": "http://www.w3.org/ns/r2rml#DB2", 10 | "informix": "Informix", 11 | "ingres": "http://www.w3.org/ns/r2rml#Ingres", 12 | "progress": "http://www.w3.org/ns/r2rml#Progress", 13 | "sybasease": "http://www.w3.org/ns/r2rml#SybaseASE", 14 | "sybasesqlanywhere": "http://www.w3.org/ns/r2rml#SybaseSQLAnywhere", 15 | "virtuoso": "http://www.w3.org/ns/r2rml#Virtuoso", 16 | "firebird": "http://www.w3.org/ns/r2rml#Firebird" 17 | }, 18 | 19 | "reference": { 20 | "jsonpath": "http://semweb.mmlab.be/ns/ql#JSONPath", 21 | "xpath": "http://semweb.mmlab.be/ns/ql#XPath", 22 | "csv": "http://semweb.mmlab.be/ns/ql#CSV", 23 | "css3": "http://semweb.mmlab.be/ns/ql#CSS3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/jdbc-drivers.json: -------------------------------------------------------------------------------- 1 | { 2 | "oracle": "oracle.jdbc.driver.OracleDriver", 3 | "mysql": "com.mysql.cj.jdbc.Driver", 4 | "postgresql": "org.postgresql.Driver", 5 | "mssql": "com.microsoft.sqlserver.jdbc.SQLServerDriver", 6 | "db2": "com.ibm.as400.access.AS400JDBCDriver" 7 | } 8 | -------------------------------------------------------------------------------- /lib/namespaces.js: -------------------------------------------------------------------------------- 1 | // initialize (common) prefixes and namespaces from prefix.cc 2 | // Unknown prefixes can be added here, and "wrong" prefixes can be overridden 3 | 4 | const _namespaces = require('prefix-ns').asMap(); 5 | _namespaces['comp'] = 'http://semweb.mmlab.be/ns/rml-compression#'; 6 | _namespaces['idlab-fn'] = 'https://w3id.org/imec/idlab/function#'; 7 | _namespaces['rml'] = 'http://semweb.mmlab.be/ns/rml#'; // this one is the only official one for now, but prefix.cc returns the wrong one. 8 | _namespaces['rmlt'] = 'http://semweb.mmlab.be/ns/rml-target#'; 9 | _namespaces['dc'] = 'http://purl.org/dc/terms/'; 10 | _namespaces['ql'] = 'http://semweb.mmlab.be/ns/ql#'; 11 | _namespaces['idsa'] = 'https://w3id.org/idsa/core/'; 12 | _namespaces['ldes'] = 'https://w3id.org/ldes#'; // prefix.cc returns the http (without s) version 13 | _namespaces['tree'] = 'https://w3id.org/tree#'; // prefix.cc returns the http (without s) version 14 | _namespaces['rmle'] = 'https://w3id.org/imec/rml/ns/extensions#'; 15 | _namespaces['htv'] = 'http://www.w3.org/2011/http#'; 16 | _namespaces['sd'] = 'http://www.w3.org/ns/sparql-service-description#'; 17 | 18 | /** 19 | * Returns the namepace for a given prefix 20 | * @param {string} prefix The prefix to get the namespace for. 21 | * @returns {string} The namespace for the given prefix. 22 | */ 23 | function asMap() { 24 | return _namespaces; 25 | } 26 | 27 | module.exports = { 28 | asMap 29 | }; 30 | -------------------------------------------------------------------------------- /lib/watcher.js: -------------------------------------------------------------------------------- 1 | /** 2 | * author: Pieter Heyvaert (pheyvaer.heyvaert@ugent.be) 3 | * Ghent University - imec - IDLab 4 | */ 5 | 6 | const fs = require('fs'); 7 | const Y2R = require('./rml-generator.js'); 8 | const Y2R2 = require('./r2rml-generator.js'); 9 | const N3 = require('n3'); 10 | const namespaces = require('./namespaces').asMap(); 11 | const path = require('path'); 12 | const Logger = require('./logger'); 13 | 14 | let inputFile; 15 | let outputFile; 16 | let initial = true; 17 | let toYARRRML; 18 | 19 | function watch(input, output, format) { 20 | inputFile = input[0]; 21 | outputFile = output; 22 | 23 | if (!format || format === 'RML') { 24 | toYARRRML = new Y2R(); 25 | } else { 26 | toYARRRML = new Y2R2(); 27 | } 28 | 29 | try { 30 | fs.watchFile(inputFile, convert); 31 | convert(); 32 | 33 | Logger.log(`Watching ${input} for changes...`); 34 | } catch (e) { 35 | if (e.errno === 'ENOENT') { 36 | Logger.log("Error no such file", output); 37 | } else { 38 | Logger.log(e); 39 | } 40 | } 41 | } 42 | 43 | function convert() { 44 | 45 | if (!initial) { 46 | Logger.log(`File has changed...`); 47 | } 48 | 49 | initial = false; 50 | 51 | const inputData = fs.readFileSync(inputFile, 'utf8'); 52 | 53 | const rml = toYARRRML.convert(inputData); 54 | 55 | const writer = new N3.Writer({ 56 | prefixes: { 57 | rr: namespaces.rr, 58 | rml: namespaces.rml, 59 | rdf: namespaces.rdf, 60 | rdfs: namespaces.rdfs 61 | } 62 | }); 63 | writer.addQuads(rml); 64 | writer.end((error, result) => { 65 | if (!path.isAbsolute(outputFile)) { 66 | output = path.join(process.cwd(), outputFile); 67 | } 68 | 69 | try { 70 | fs.writeFileSync(outputFile, result); 71 | } catch (e) { 72 | Logger.error(`The RML could not be written to the output file ${outputFile}`); 73 | } 74 | }); 75 | } 76 | 77 | module.exports = watch; 78 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@rmlio/yarrrml-parser", 3 | "version": "1.10.0", 4 | "description": "Parse YARRRML descriptions into RML RDF statements", 5 | "main": "lib/yarrrml2rml.js", 6 | "scripts": { 7 | "test": "mocha \"./lib/*.test.js\"" 8 | }, 9 | "keywords": [ 10 | "RML", 11 | "YAML", 12 | "parser", 13 | "generator" 14 | ], 15 | "author": "Ben De Meester", 16 | "contributors": [ 17 | "Pieter Heyvaert (https://pieterheyvaert.com/)" 18 | ], 19 | "license": "MIT", 20 | "dependencies": { 21 | "commander": "^9.4.1", 22 | "extend": "^3.0.2", 23 | "glob": "^8.0.3", 24 | "graphy": "^4.3.5", 25 | "js-logger": "^1.6.1", 26 | "n3": "^1.16.3", 27 | "parse-author": "^2.0.0", 28 | "pkginfo": "^0.4.1", 29 | "prefix-ns": "^0.1.2", 30 | "q": "^1.5.1", 31 | "rdf-isomorphic": "^1.3.1", 32 | "yamljs": "^0.3.0" 33 | }, 34 | "devDependencies": { 35 | "mocha": "^10.1.0" 36 | }, 37 | "bin": { 38 | "yarrrml-parser": "./bin/parser.js", 39 | "yarrrml-generator": "./bin/generator.js" 40 | }, 41 | "repository": { 42 | "type": "git", 43 | "url": "https://github.com/RMLio/yarrrml-parser.git" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | TAG=$1 5 | DEV_BRANCH="development" 6 | RELEASE_BRANCH="master" 7 | 8 | if [ -z "$1" ]; then 9 | echo "Supply release tag as 'X.Y.Z'. For example: ./release.sh 1.0.0" 10 | exit 1 11 | fi 12 | 13 | # Dependencies and branch 14 | echo "Installing dependencies and branch..." 15 | 16 | if ! changefrog --help > /dev/null; then 17 | npm install -g changefrog > /dev/null 18 | fi 19 | git checkout "$DEV_BRANCH" 20 | 21 | # Update NPM package 22 | echo "Updating NPM package release" 23 | npm config set git-tag-version false 24 | npm version "$TAG" > /dev/null 25 | 26 | # Update CHANGELOG.md 27 | echo "Updating CHANGELOG.md" 28 | changefrog -n "$TAG" > /dev/null 29 | 30 | # Create release commit 31 | echo "Creating git commit and tag" 32 | git add . 33 | git commit -m "release v$TAG" 34 | git tag "v$TAG" 35 | 36 | # Add release commit to master branch 37 | echo "Rebasing $DEV_BRANCH upon $RELEASE_BRANCH" 38 | git checkout "$RELEASE_BRANCH" 39 | git rebase "$DEV_BRANCH" 40 | 41 | # Push to branches 42 | echo "Pushing branches..." 43 | git push origin "$DEV_BRANCH" 44 | git push origin "$RELEASE_BRANCH" 45 | git push --tags origin "$RELEASE_BRANCH" 46 | git checkout "$DEV_BRANCH" 47 | 48 | # NPM 49 | echo "Uploading release to NPM" 50 | 51 | # Check if logging in is needed 52 | set +e 53 | if ! npm whoami; then 54 | echo "NPM requires login to publish release." 55 | npm login 56 | fi 57 | set -e 58 | 59 | # Upload release to NPM 60 | npm publish 61 | 62 | echo "Done!" 63 | -------------------------------------------------------------------------------- /resources/fn.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com#7 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - ['data/person.json~jsonpath', '$'] 8 | s: http://example.com/$(ID) 9 | po: 10 | - [a, foaf:Person] 11 | - p: ex:value 12 | o: 13 | fn: ex:MyFunction 14 | pms: 15 | - ['ex:input', '$(firstname)'] -------------------------------------------------------------------------------- /resources/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rml: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | 6 | rml:logicalSource . 7 | a rml:LogicalSource; 8 | rml:source "data/person2.json"; 9 | rml:iterator "$"; 10 | rml:referenceFormulation . 11 | a rr:TriplesMap; 12 | rdfs:label "person". 13 | a rr:SubjectMap. 14 | rr:subjectMap . 15 | rr:template "http://example.com/{ID}". 16 | -------------------------------------------------------------------------------- /resources/mapping2.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rml: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | 6 | rml:logicalSource . 7 | a rml:LogicalSource; 8 | rml:source "data/person.json"; 9 | rml:iterator "$"; 10 | rml:referenceFormulation . 11 | a rr:TriplesMap; 12 | rdfs:label "person". 13 | a rr:SubjectMap. 14 | rr:subjectMap . 15 | rr:template "http://example.com/{ID}". 16 | a rr:PredicateObjectMap. 17 | rr:predicateObjectMap . 18 | a rr:PredicateMap. 19 | rr:predicateMap . 20 | rr:constant rdf:type. 21 | a rr:ObjectMap. 22 | rr:objectMap . 23 | rr:constant "http://xmlns.com/foaf/0.1/Person"; 24 | rr:termType rr:IRI. 25 | a rr:PredicateObjectMap. 26 | rr:predicateObjectMap . 27 | a rr:PredicateMap. 28 | rr:predicateMap . 29 | rr:constant . 30 | a rr:ObjectMap. 31 | rr:objectMap . 32 | rr:template "{firstname}"; 33 | rr:termType rr:Literal. 34 | -------------------------------------------------------------------------------- /resources/mapping3.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rml: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | 6 | rml:logicalSource . 7 | a rml:LogicalSource; 8 | rml:source "data/person.json"; 9 | rml:iterator "$"; 10 | rml:referenceFormulation . 11 | a rr:TriplesMap; 12 | rdfs:label "person". 13 | a rr:SubjectMap. 14 | rr:subjectMap . 15 | rr:template "http://example.com/{ID}". 16 | a rr:PredicateObjectMap. 17 | rr:predicateObjectMap . 18 | a rr:PredicateMap. 19 | rr:predicateMap . 20 | rr:constant rdf:type. 21 | a rr:ObjectMap. 22 | rr:objectMap . 23 | rr:constant "http://xmlns.com/foaf/0.1/Person"; 24 | rr:termType rr:IRI. 25 | a rr:PredicateObjectMap. 26 | rr:predicateObjectMap . 27 | a rr:PredicateMap. 28 | rr:predicateMap . 29 | rr:constant . 30 | a rr:ObjectMap. 31 | rr:objectMap . 32 | rml:reference "firstname". 33 | rr:language "en"; 34 | rr:termType rr:Literal. 35 | -------------------------------------------------------------------------------- /resources/mapping4.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rml: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | @prefix xsd: . 6 | 7 | rml:logicalSource . 8 | a rml:LogicalSource; 9 | rml:source "data/person.json"; 10 | rml:iterator "$"; 11 | rml:referenceFormulation . 12 | a rr:TriplesMap; 13 | rdfs:label "person". 14 | a rr:SubjectMap. 15 | rr:subjectMap . 16 | rr:template "http://example.com/{ID}". 17 | a rr:PredicateObjectMap. 18 | rr:predicateObjectMap . 19 | a rr:PredicateMap. 20 | rr:predicateMap . 21 | rr:constant rdf:type. 22 | a rr:ObjectMap. 23 | rr:objectMap . 24 | rr:constant "http://xmlns.com/foaf/0.1/Person"; 25 | rr:termType rr:IRI. 26 | a rr:PredicateObjectMap. 27 | rr:predicateObjectMap . 28 | a rr:PredicateMap. 29 | rr:predicateMap . 30 | rr:constant . 31 | a rr:ObjectMap. 32 | rr:objectMap . 33 | rml:reference "firstname". 34 | rr:datatype xsd:string; 35 | rr:termType rr:Literal. 36 | -------------------------------------------------------------------------------- /resources/mapppingA.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rml: . 3 | @prefix rdf: . 4 | @prefix rdfs: . 5 | 6 | rml:logicalSource . 7 | a rml:LogicalSource; 8 | rml:source "data/person.json"; 9 | rml:iterator "$"; 10 | rml:referenceFormulation . 11 | a rr:TriplesMap; 12 | rdfs:label "person". 13 | a rr:SubjectMap. 14 | rr:subjectMap . 15 | rr:template "http://example.com/{ID}". 16 | a rr:PredicateObjectMap. 17 | rr:predicateObjectMap . 18 | a rr:PredicateMap. 19 | rr:predicateMap . 20 | rr:constant rdf:type. 21 | a rr:ObjectMap. 22 | rr:objectMap . 23 | rr:constant "http://xmlns.com/foaf/0.1/Person"; 24 | rr:termType rr:IRI. 25 | a rr:PredicateObjectMap. 26 | rr:predicateObjectMap . 27 | a rr:PredicateMap. 28 | rr:predicateMap . 29 | rr:constant . 30 | a rr:ObjectMap. 31 | rr:objectMap . 32 | rr:template "{firstname}"; 33 | rr:termType rr:Literal. 34 | -------------------------------------------------------------------------------- /resources/test-db.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com#7 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - queryFormulation: sql2008 8 | query: > 9 | SELECT * FROM STAFF 10 | GROUP BY GENDER 11 | s: http://example.com/$(ID) 12 | po: 13 | - [a, foaf:Person] 14 | - [ex:name, $(firstname)] -------------------------------------------------------------------------------- /resources/test.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | dbf: http://dbpedia.org/function/ 3 | 4 | sources: 5 | country-source: http://en.dbpedia.org/resource/Mapping_en:Infobox_country/Infobox_country/LogicalSource 6 | 7 | mappings: 8 | dbf:doc: 9 | sources: country-source 10 | subjects: http://en.dbpedia.org/resource/$({wikititle}) 11 | predicateobjects: 12 | - predicates: http://dbpedia.org/ontology/anthem 13 | objects: 14 | - function: dbf:simplePropertyFunction 15 | parameters: 16 | - parameter: dbf:dataTypeParameter 17 | value: owl:Thing 18 | datatype: xsd:string 19 | - parameter: dbf:propertyParameter 20 | value: $(national_anthem) -------------------------------------------------------------------------------- /resources/test1.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com#7 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - ['data/person.json~jsonpath', '$'] 8 | s: http://example.com/$(ID) 9 | po: 10 | - [a, foaf:Person] 11 | - [ex:name, $(firstname)] -------------------------------------------------------------------------------- /resources/test2.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | source1: ['data/person.json~jsonpath', '$'] 3 | 4 | mappings: 5 | person: 6 | source: 7 | - source1 8 | s: http://example.com/$(ID) 9 | po: 10 | - [a, foaf:Person] 11 | - [ex:name, $(firstname), xsd:string] -------------------------------------------------------------------------------- /test/author/array-with-objects/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :rules_000 rdf:type void:Dataset ; 16 | dc:contributor :person_000, :person_001 ; 17 | void:exampleResource :map_person_000 . 18 | 19 | :person_000 dc:contributor foaf:Person ; 20 | rdfs:label "John Doe" ; 21 | foaf:mbox . 22 | 23 | :person_001 dc:contributor foaf:Person ; 24 | rdfs:label "Jane Doe" ; 25 | foaf:homepage . 26 | 27 | :map_person_000 rml:logicalSource :source_000 ; 28 | rdf:type rr:TriplesMap ; 29 | rdfs:label "person" ; 30 | rr:subjectMap :s_000 ; 31 | rr:predicateObjectMap :pom_000 . 32 | 33 | :source_000 rdf:type rml:LogicalSource ; 34 | rml:source "data.json" ; 35 | rml:iterator "$.persons[*]" ; 36 | rml:referenceFormulation ql:JSONPath . 37 | 38 | :s_000 rdf:type rr:SubjectMap ; 39 | rr:template "http://example.com/{firstname}" . 40 | 41 | :pom_000 rdf:type rr:PredicateObjectMap ; 42 | rr:predicateMap :pm_000 ; 43 | rr:objectMap :om_000 . 44 | 45 | :pm_000 rdf:type rr:PredicateMap ; 46 | rr:constant rdf:type . 47 | 48 | :om_000 rdf:type rr:ObjectMap ; 49 | rr:constant "http://example.com/Person" ; 50 | rr:termType rr:IRI . 51 | 52 | -------------------------------------------------------------------------------- /test/author/array-with-objects/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | authors: 5 | - name: John Doe 6 | email: john@doe.com 7 | - name: Jane Doe 8 | website: https://janedoe.com 9 | 10 | mappings: 11 | person: 12 | sources: 13 | - ['data.json~jsonpath', '$.persons[*]'] 14 | s: http://example.com/$(firstname) 15 | po: 16 | - [a, ex:Person] 17 | -------------------------------------------------------------------------------- /test/author/array-with-strings/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :rules_000 rdf:type void:Dataset ; 16 | dc:contributor :person_000, :person_001 ; 17 | void:exampleResource :map_person_000 . 18 | 19 | :person_000 dc:contributor foaf:Person ; 20 | rdfs:label "John Doe" ; 21 | foaf:mbox . 22 | 23 | :person_001 dc:contributor foaf:Person ; 24 | rdfs:label "Jane Doe" ; 25 | foaf:homepage . 26 | 27 | :map_person_000 rml:logicalSource :source_000 ; 28 | rdf:type rr:TriplesMap ; 29 | rdfs:label "person" ; 30 | rr:subjectMap :s_000 ; 31 | rr:predicateObjectMap :pom_000 . 32 | 33 | :source_000 rdf:type rml:LogicalSource ; 34 | rml:source "data.json" ; 35 | rml:iterator "$.persons[*]" ; 36 | rml:referenceFormulation ql:JSONPath . 37 | 38 | :s_000 rdf:type rr:SubjectMap ; 39 | rr:template "http://example.com/{firstname}" . 40 | 41 | :pom_000 rdf:type rr:PredicateObjectMap ; 42 | rr:predicateMap :pm_000 ; 43 | rr:objectMap :om_000 . 44 | 45 | :pm_000 rdf:type rr:PredicateMap ; 46 | rr:constant rdf:type . 47 | 48 | :om_000 rdf:type rr:ObjectMap ; 49 | rr:constant "http://example.com/Person" ; 50 | rr:termType rr:IRI . 51 | 52 | -------------------------------------------------------------------------------- /test/author/array-with-strings/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | authors: 5 | - John Doe 6 | - Jane Doe (https://janedoe.com) 7 | 8 | mappings: 9 | person: 10 | sources: 11 | - ['data.json~jsonpath', '$.persons[*]'] 12 | s: http://example.com/$(firstname) 13 | po: 14 | - [a, ex:Person] 15 | -------------------------------------------------------------------------------- /test/author/array-with-webids/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :rules_000 rdf:type void:Dataset ; 16 | dc:contributor , ; 17 | void:exampleResource :map_person_000 . 18 | 19 | :map_person_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "person" ; 22 | rr:subjectMap :s_000 ; 23 | rr:predicateObjectMap :pom_000 . 24 | 25 | :source_000 rdf:type rml:LogicalSource ; 26 | rml:source "data.json" ; 27 | rml:iterator "$.persons[*]" ; 28 | rml:referenceFormulation ql:JSONPath . 29 | 30 | :s_000 rdf:type rr:SubjectMap ; 31 | rr:template "http://example.com/{firstname}" . 32 | 33 | :pom_000 rdf:type rr:PredicateObjectMap ; 34 | rr:predicateMap :pm_000 ; 35 | rr:objectMap :om_000 . 36 | 37 | :pm_000 rdf:type rr:PredicateMap ; 38 | rr:constant rdf:type . 39 | 40 | :om_000 rdf:type rr:ObjectMap ; 41 | rr:constant "http://example.com/Person" ; 42 | rr:termType rr:IRI . 43 | 44 | -------------------------------------------------------------------------------- /test/author/array-with-webids/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | authors: 5 | - http://johndoe.com/#me 6 | - http://janedoe.com/#me 7 | 8 | mappings: 9 | person: 10 | sources: 11 | - ['data.json~jsonpath', '$.persons[*]'] 12 | s: http://example.com/$(firstname) 13 | po: 14 | - [a, ex:Person] 15 | -------------------------------------------------------------------------------- /test/author/single-string/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :rules_000 rdf:type void:Dataset ; 16 | dc:contributor :person_000 ; 17 | void:exampleResource :map_person_000 . 18 | 19 | :person_000 dc:contributor foaf:Person ; 20 | rdfs:label "John Doe" ; 21 | foaf:mbox . 22 | 23 | :map_person_000 rml:logicalSource :source_000 ; 24 | rdf:type rr:TriplesMap ; 25 | rdfs:label "person" ; 26 | rr:subjectMap :s_000 ; 27 | rr:predicateObjectMap :pom_000 . 28 | 29 | :source_000 rdf:type rml:LogicalSource ; 30 | rml:source "data.json" ; 31 | rml:iterator "$.persons[*]" ; 32 | rml:referenceFormulation ql:JSONPath . 33 | 34 | :s_000 rdf:type rr:SubjectMap ; 35 | rr:template "http://example.com/{firstname}" . 36 | 37 | :pom_000 rdf:type rr:PredicateObjectMap ; 38 | rr:predicateMap :pm_000 ; 39 | rr:objectMap :om_000 . 40 | 41 | :pm_000 rdf:type rr:PredicateMap ; 42 | rr:constant rdf:type . 43 | 44 | :om_000 rdf:type rr:ObjectMap ; 45 | rr:constant "http://example.com/Person" ; 46 | rr:termType rr:IRI . 47 | 48 | -------------------------------------------------------------------------------- /test/author/single-string/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | authors: John Doe 5 | 6 | mappings: 7 | person: 8 | sources: 9 | - ['data.json~jsonpath', '$.persons[*]'] 10 | s: http://example.com/$(firstname) 11 | po: 12 | - [a, ex:Person] 13 | -------------------------------------------------------------------------------- /test/betweenourworlds/character/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | bow: https://betweenourworlds.org/ontology/ 4 | dbo: http://dbpedia.org/ontology/ 5 | 6 | mappings: 7 | character: 8 | source: 9 | - ['character-0.json~jsonpath', '$.data[*]'] 10 | s: https://betweenourworlds.org/character/$(attributes.slug) 11 | po: 12 | - [a, [bow:Character, schema:Thing]] 13 | - [[rdfs:label, schema:name, dbo:title], $(attributes.name)] 14 | - [[rdfs:label, schema:name, dbo:title], $(attributes.names.en), en~lang] 15 | - [[rdfs:label, schema:name, dbo:title], $(attributes.names.ja_jp), ja~lang] 16 | - [schema:mainEntityOfPage, https://myanimelist.net/character/$(attributes.malId), schema:URL] 17 | - [[schema:description, rdfs:comment], $(attributes.description)] 18 | - [schema:image, $(attributes.image.original), schema:URL] 19 | - [schema:alternateName, $(attributes.otherNames)] 20 | -------------------------------------------------------------------------------- /test/condition-function-on-po/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | idlab-fn: https://w3id.org/imec/idlab/function# 4 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 5 | 6 | mappings: 7 | person: 8 | sources: 9 | - ['data.json~jsonpath', '$.persons[*]'] 10 | s: http://example.com/$(firstname) 11 | po: 12 | - [a, foaf:Person] 13 | - predicates: foaf:firstName 14 | objects: 15 | - function: grel:toUpperCase 16 | parameters: 17 | - parameter: grel:valueParameter 18 | value: $(firstname) 19 | condition: 20 | function: idlab-fn:stringContainsOtherString 21 | parameters: 22 | - [idlab-fn:str, $(firstname)] 23 | - [idlab-fn:otherStr, "J"] 24 | - [idlab-fn:delimiter, ""] 25 | -------------------------------------------------------------------------------- /test/condition-on-mapping-constant/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | track: 6 | sources: 7 | - ['data.json~jsonpath', '$.features.[*].properties'] 8 | s: http://example.com/sector/$(sector) 9 | po: 10 | - [ex:name, $(sector)] 11 | 12 | sector0: 13 | sources: 14 | - ['source_1.csv~csv'] 15 | s: ex:Lap$(Lap)/Sector1/$(Athlete) 16 | po: 17 | - p: ex:Sector 18 | o: 19 | mapping: track 20 | condition: 21 | function: equal 22 | parameters: 23 | - [str1, "0", s] ### <-- constant value ### 24 | - [str2, $(sector), o] 25 | -------------------------------------------------------------------------------- /test/condition-on-mapping-multiple/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com# 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | idlab-fn: "https://w3id.org/imec/idlab/function#" 5 | 6 | mappings: 7 | myMapping: 8 | sources: 9 | - ["data.csv~csv"] 10 | s: ex:$(ID) 11 | po: 12 | - [a, ex:Person] 13 | - [ex:label, $(name)] 14 | - p: ex:isFriendsWith 15 | o: 16 | - mapping: myOtherMapping 17 | condition: 18 | - function: idlab-fn:equal 19 | parameters: 20 | - [grel:valueParameter, "$(otherID)", s] 21 | - [grel:valueParameter2, "$(friendID)", o] 22 | - function: idlab-fn:equal 23 | parameters: 24 | - [grel:valueParameter, "$(name)", s] 25 | - [grel:valueParameter2, "$(friendName)", o] 26 | myOtherMapping: 27 | sources: 28 | - ["data2.csv~csv"] 29 | s: http://example.com#heroes_$(ID) 30 | po: 31 | - [a, ex:Hero] 32 | - [ex:label, $(name)] 33 | -------------------------------------------------------------------------------- /test/condition-on-mapping-nested/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com# 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | idlab-fn: "https://w3id.org/imec/idlab/function#" 5 | 6 | mappings: 7 | myMapping: 8 | sources: 9 | - ["data.csv~csv"] 10 | s: ex:$(ID) 11 | po: 12 | - [a, ex:Person] 13 | - p: ex:isFriendsWith 14 | o: 15 | - mapping: myOtherMapping 16 | condition: 17 | function: grel:boolean_and 18 | parameters: 19 | - parameter: grel:param_rep_b 20 | value: 21 | function: idlab-fn:equal 22 | parameters: 23 | - [grel:valueParameter, "$(otherID)", s] 24 | - [grel:valueParameter2, "$(friendID)", o] 25 | - parameter: grel:param_rep_b 26 | value: 27 | mapping: myOtherMapping 28 | function: idlab-fn:equal 29 | parameters: 30 | - [grel:valueParameter, "$(name)", s] 31 | - [grel:valueParameter2, "$(friendName)", o] 32 | myOtherMapping: 33 | sources: 34 | - ["data2.csv~csv"] 35 | s: http://example.com#heroes_$(ID) 36 | po: 37 | - [a, ex:Hero] 38 | -------------------------------------------------------------------------------- /test/condition-on-mapping-subject-function/input.csv: -------------------------------------------------------------------------------- 1 | id 2 | 0 3 | "" 4 | 1 5 | -------------------------------------------------------------------------------- /test/condition-on-mapping-subject-function/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 3 | idlab-fn: https://w3id.org/imec/idlab/function# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - [input.csv~csv] 9 | s: 10 | function: grel:array_join 11 | parameters: 12 | - [grel:p_array_a, "http://example.org/"] 13 | - [grel:p_array_a, "$(id)"] 14 | condition: 15 | function: idlab-fn:notEqual 16 | parameters: 17 | - [grel:valueParameter, "$(id)"] 18 | - [grel:valueParameter2, ""] 19 | po: 20 | - [a, schema:Person] 21 | -------------------------------------------------------------------------------- /test/condition-on-mapping-with-blanknode/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | idlab-fn: https://w3id.org/imec/idlab/function# 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | 5 | mappings: 6 | test: 7 | sources: 8 | - [test.csv~csv] 9 | condition: 10 | function: idlab-fn:equal 11 | parameters: 12 | - [grel:valueParameter, $(id)] 13 | - [grel:valueParameter2, 1] 14 | po: 15 | - [a, http://example.com/Test] 16 | -------------------------------------------------------------------------------- /test/condition-on-mapping/r2rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | idlab-fn: https://w3id.org/imec/idlab/function# 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | 5 | mappings: 6 | test: 7 | sources: 8 | - table: test 9 | queryFormulation: mysql 10 | s: http://example.com/$(id) 11 | condition: 12 | function: idlab-fn:equal 13 | parameters: 14 | - [grel:valueParameter, $(id)] 15 | - [grel:valueParameter2, 1] 16 | po: 17 | - [a, http://example.com/Test] 18 | -------------------------------------------------------------------------------- /test/condition-on-mapping/rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | idlab-fn: https://w3id.org/imec/idlab/function# 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | 5 | mappings: 6 | test: 7 | sources: 8 | - [test.csv~csv] 9 | s: http://example.com/$(id) 10 | condition: 11 | function: idlab-fn:equal 12 | parameters: 13 | - [grel:valueParameter, $(id)] 14 | - [grel:valueParameter2, 1] 15 | po: 16 | - [a, http://example.com/Test] 17 | -------------------------------------------------------------------------------- /test/condition-on-mapping/rml/test.csv: -------------------------------------------------------------------------------- 1 | id 2 | 0 3 | 1 4 | 2 5 | -------------------------------------------------------------------------------- /test/condition-on-po-datatype/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "https://example.org/ns/test#" 3 | idlab-fn: "https://w3id.org/imec/idlab/function#" 4 | grel: "http://users.ugent.be/~bjdmeest/function/grel.ttl#" 5 | xsd: "http://www.w3.org/2001/XMLSchema#" 6 | prov: "http://www.w3.org/ns/prov#" 7 | 8 | mappings: 9 | 10 | events: 11 | sources: 12 | - ['data.csv~csv'] 13 | s: ex:event_$(id) 14 | po: 15 | - p: prov:endedAtTime 16 | o: 17 | - value: $(end_date) 18 | datatype: xsd:dateTime 19 | condition: 20 | function: idlab-fn:notEqual 21 | parameters: 22 | - [grel:valueParameter, $(end_date)] 23 | - [grel:valueParameter2, ""] 24 | -------------------------------------------------------------------------------- /test/condition-on-po-language/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "https://example.org/ns/test#" 3 | idlab-fn: "https://w3id.org/imec/idlab/function#" 4 | grel: "http://users.ugent.be/~bjdmeest/function/grel.ttl#" 5 | xsd: "http://www.w3.org/2001/XMLSchema#" 6 | prov: "http://www.w3.org/ns/prov#" 7 | 8 | mappings: 9 | 10 | events: 11 | sources: 12 | - ['data.csv~csv'] 13 | s: ex:event_$(id) 14 | po: 15 | - p: ex:hasName 16 | o: 17 | - value: $(name) 18 | language: en 19 | condition: 20 | function: idlab-fn:notEqual 21 | parameters: 22 | - [grel:valueParameter, $(name)] 23 | - [grel:valueParameter2, ""] 24 | -------------------------------------------------------------------------------- /test/condition-on-po-target/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "https://example.org/ns/test#" 3 | idlab-fn: "https://w3id.org/imec/idlab/function#" 4 | grel: "http://users.ugent.be/~bjdmeest/function/grel.ttl#" 5 | xsd: "http://www.w3.org/2001/XMLSchema#" 6 | prov: "http://www.w3.org/ns/prov#" 7 | 8 | targets: 9 | venus_target: 10 | access: data/venus.ttl 11 | type: void 12 | serialization: turtle 13 | 14 | mappings: 15 | events: 16 | sources: 17 | - ['data.csv~csv'] 18 | s: ex:event_$(id) 19 | po: 20 | - p: ex:hasName 21 | o: 22 | - value: $(name) 23 | language: en 24 | targets: venus_target 25 | condition: 26 | function: idlab-fn:notEqual 27 | parameters: 28 | - [grel:valueParameter, $(name)] 29 | - [grel:valueParameter2, ""] 30 | -------------------------------------------------------------------------------- /test/condition-on-po/r2rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 3 | idlab-fn: https://w3id.org/imec/idlab/function# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - table: test 9 | queryFormulation: mysql 10 | subject: http://example.org/$(firstname) 11 | predicateobjects: 12 | - predicates: foaf:firstName 13 | objects: $(firstname) 14 | condition: 15 | function: idlab-fn:equal 16 | parameters: 17 | - [grel:valueParameter, $(firstname)] 18 | - [grel:valueParameter2, "test"] 19 | -------------------------------------------------------------------------------- /test/condition-on-po/rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 3 | idlab-fn: https://w3id.org/imec/idlab/function# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - [test.csv~csv] 9 | subject: http://example.org/$(firstname) 10 | predicateobjects: 11 | - predicates: foaf:firstName 12 | objects: $(firstname) 13 | condition: 14 | function: idlab-fn:equal 15 | parameters: 16 | - [grel:valueParameter, $(firstname)] 17 | - [grel:valueParameter2, "test"] 18 | -------------------------------------------------------------------------------- /test/condition-on-po/rml/test.csv: -------------------------------------------------------------------------------- 1 | firstname 2 | test, 3 | test2 4 | -------------------------------------------------------------------------------- /test/condition-on-single-object/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 3 | idlab-fn: https://w3id.org/imec/idlab/function# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - [test.csv~csv] 9 | subject: http://example.org/$(firstname) 10 | predicateobjects: 11 | - predicates: foaf:firstName 12 | objects: 13 | - value: $(firstname) 14 | condition: 15 | function: idlab-fn:equal 16 | parameters: 17 | - [grel:valueParameter, $(firstname)] 18 | - [grel:valueParameter2, "test"] 19 | -------------------------------------------------------------------------------- /test/condition-on-single-object/test.csv: -------------------------------------------------------------------------------- 1 | firstname 2 | test, 3 | test2 4 | -------------------------------------------------------------------------------- /test/csv-delimiter/semicolon/data.txt: -------------------------------------------------------------------------------- 1 | id;name 2 | 1;john 3 | -------------------------------------------------------------------------------- /test/csv-delimiter/semicolon/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | @prefix csvw: . 15 | 16 | :rules_000 rdf:type void:Dataset ; 17 | void:exampleResource :map_person_000 . 18 | 19 | :map_person_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "person" ; 22 | rr:subjectMap :s_000 ; 23 | rr:predicateObjectMap :pom_000 . 24 | 25 | :source_000 rdf:type rml:LogicalSource ; 26 | rml:source :csvw_000 ; 27 | rml:referenceFormulation ql:CSV . 28 | 29 | :csvw_000 rdf:type csvw:Table ; 30 | csvw:url "data.txt" ; 31 | csvw:dialect :csvw-dialect_000 . 32 | 33 | :csvw-dialect_000 rdf:type csvw:Dialect ; 34 | csvw:delimiter ";" . 35 | 36 | :s_000 rdf:type rr:SubjectMap ; 37 | rr:template "http://example.com/{id}" . 38 | 39 | :pom_000 rdf:type rr:PredicateObjectMap ; 40 | rr:predicateMap :pm_000 ; 41 | rr:objectMap :om_000 . 42 | 43 | :pm_000 rdf:type rr:PredicateMap ; 44 | rr:constant rdf:type . 45 | 46 | :om_000 rdf:type rr:ObjectMap ; 47 | rr:constant "http://xmlns.com/foaf/0.1/Person" ; 48 | rr:termType rr:IRI . 49 | 50 | -------------------------------------------------------------------------------- /test/csv-delimiter/semicolon/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - access: data.txt 8 | referenceFormulation: csv 9 | delimiter: ';' 10 | s: http://example.com/$(id) 11 | po: 12 | - [a, foaf:Person] 13 | -------------------------------------------------------------------------------- /test/csv-delimiter/tab/data.tsv: -------------------------------------------------------------------------------- 1 | id name 2 | 1 john 3 | -------------------------------------------------------------------------------- /test/csv-delimiter/tab/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | @prefix csvw: . 15 | 16 | :rules_000 rdf:type void:Dataset ; 17 | void:exampleResource :map_person_000 . 18 | 19 | :map_person_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "person" ; 22 | rr:subjectMap :s_000 ; 23 | rr:predicateObjectMap :pom_000 . 24 | 25 | :source_000 rdf:type rml:LogicalSource ; 26 | rml:source :csvw_000 ; 27 | rml:referenceFormulation ql:CSV . 28 | 29 | :csvw_000 rdf:type csvw:Table ; 30 | csvw:url "data.tsv" ; 31 | csvw:dialect :csvw-dialect_000 . 32 | 33 | :csvw-dialect_000 rdf:type csvw:Dialect ; 34 | csvw:delimiter "\\t" . 35 | 36 | :s_000 rdf:type rr:SubjectMap ; 37 | rr:template "http://example.com/{id}" . 38 | 39 | :pom_000 rdf:type rr:PredicateObjectMap ; 40 | rr:predicateMap :pm_000 ; 41 | rr:objectMap :om_000 . 42 | 43 | :pm_000 rdf:type rr:PredicateMap ; 44 | rr:constant rdf:type . 45 | 46 | :om_000 rdf:type rr:ObjectMap ; 47 | rr:constant "http://xmlns.com/foaf/0.1/Person" ; 48 | rr:termType rr:IRI . 49 | 50 | -------------------------------------------------------------------------------- /test/csv-delimiter/tab/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - access: data.tsv 8 | referenceFormulation: csv 9 | delimiter: '\t' 10 | s: http://example.com/$(id) 11 | po: 12 | - [a, foaf:Person] 13 | -------------------------------------------------------------------------------- /test/datatype-on-function/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | @prefix grel: . 12 | 13 | :application rdf:type rr:TriplesMap ; 14 | rdfs:label "application" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000 . 17 | 18 | :s_000 rdf:type rr:SubjectMap ; 19 | rr:termType rr:BlankNode . 20 | 21 | :pom_000 rdf:type rr:PredicateObjectMap ; 22 | rr:predicateMap :pm_000 ; 23 | rr:objectMap :om_000 . 24 | 25 | :pm_000 rdf:type rr:PredicateMap ; 26 | rr:constant ex:numberOfApplications . 27 | 28 | :om_000 rdf:type fnml:FunctionTermMap ; 29 | rr:termType rr:Literal ; 30 | rr:datatype ; 31 | fnml:functionValue :fn_000 . 32 | 33 | :fn_000 rr:predicateObjectMap :pomexec_000, :pom_001 . 34 | 35 | :pomexec_000 rr:predicateMap :pmexec_000 ; 36 | rr:objectMap :omexec_000 . 37 | 38 | :pmexec_000 rr:constant fno:executes . 39 | 40 | :omexec_000 rr:constant "http://example.com/grel/trim" ; 41 | rr:termType rr:IRI . 42 | 43 | :pom_001 rdf:type rr:PredicateObjectMap ; 44 | rr:predicateMap :pm_001 ; 45 | rr:objectMap :om_001 . 46 | 47 | :pm_001 rdf:type rr:PredicateMap ; 48 | rr:constant grel:valueParameter . 49 | 50 | :om_001 rdf:type rr:ObjectMap ; 51 | rml:reference "Number of applications" ; 52 | rr:termType rr:Literal . 53 | 54 | -------------------------------------------------------------------------------- /test/datatype-on-function/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | grel: http://example.com/grel/ 4 | 5 | mappings: 6 | application: 7 | po: 8 | - p: ex:numberOfApplications 9 | o: 10 | - function: grel:trim 11 | parameters: 12 | - [grel:valueParameter, $(Number of applications)] 13 | datatype: xsd:int 14 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-direct-http-target/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | type: directhttprequest 8 | access: https://mypod/person-$(id) 9 | authentication: auth 10 | 11 | authentications: 12 | auth: 13 | type: cssclientcredentials 14 | email: hello@mypod.com 15 | password: abc123 16 | webId: https://mypod/profile/card#me 17 | oidcIssuer: https://mypod/ 18 | 19 | mappings: 20 | persons: 21 | sources: ls_persons 22 | subjects: 23 | - value: http://example.org/$(number) 24 | targets: 25 | - person_target 26 | po: 27 | - [foaf:age, $(number)] 28 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-file-target-id-id/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | id: id_person_target_$(goesto) 8 | type: void 9 | access: $(goesto).ttl 10 | serialization: turtle 11 | 12 | mappings: 13 | persons: 14 | sources: ls_persons 15 | subjects: 16 | - value: http://example.org/$(number) 17 | targets: 18 | - id_person_target_$(goesto) 19 | 20 | po: 21 | - [foaf:age, $(number)] 22 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-file-target-id-key/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | id: id_person_target_$(goesto) 8 | type: void 9 | access: $(goesto).ttl 10 | serialization: turtle 11 | 12 | mappings: 13 | persons: 14 | sources: ls_persons 15 | subjects: 16 | - value: http://example.org/$(number) 17 | targets: 18 | - person_target 19 | po: 20 | - [foaf:age, $(number)] 21 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-file-target-multiple/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | type: void 8 | access: $(goesto).ttl 9 | serialization: turtle 10 | person_target2: 11 | source: ls_persons 12 | type: void 13 | access: $(goesto)-bis.ttl 14 | serialization: turtle 15 | mappings: 16 | persons: 17 | sources: ls_persons 18 | subjects: 19 | - value: http://example.org/$(number) 20 | targets: 21 | - person_target 22 | - person_target2 23 | po: 24 | - [foaf:age, $(number)] 25 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-file-target-object/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | type: void 8 | access: $(goesto).ttl 9 | serialization: turtle 10 | 11 | mappings: 12 | persons: 13 | sources: ls_persons 14 | subjects: 15 | - value: http://example.org/$(number) 16 | po: 17 | - p: foaf:age 18 | o: 19 | - value: $(number) 20 | targets: person_target 21 | 22 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-file-target-predicate/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | type: void 8 | access: $(goesto).ttl 9 | serialization: turtle 10 | 11 | mappings: 12 | persons: 13 | sources: ls_persons 14 | subjects: 15 | - value: http://example.org/$(number) 16 | po: 17 | - p: 18 | - value: foaf:age 19 | targets: person_target 20 | o: $(number) 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-file-target-variables-array/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | type: void 8 | access: $(firstname)_$(lastname).ttl 9 | serialization: turtle 10 | 11 | mappings: 12 | persons: 13 | sources: ls_persons 14 | subjects: 15 | - value: http://example.org/$(firstname)_$(lastname) 16 | targets: 17 | - person_target 18 | po: 19 | - [foaf:age, $(number)] 20 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-file-target/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | ls_persons: ['data.csv~csv'] 3 | 4 | targets: 5 | person_target: 6 | source: ls_persons 7 | type: void 8 | access: $(goesto).ttl 9 | serialization: turtle 10 | 11 | mappings: 12 | persons: 13 | sources: ls_persons 14 | subjects: 15 | - value: http://example.org/$(number) 16 | targets: 17 | - person_target 18 | po: 19 | - [foaf:age, $(number)] 20 | -------------------------------------------------------------------------------- /test/dynamic-target-test/file-source-linked-http-target/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | 7 | targets: 8 | linked-http-target: 9 | source: people-source 10 | type: linkedhttprequest 11 | access: https://electronics_user1/ceon/product-$(Part Number code) 12 | rel: acl 13 | serialization: turtle 14 | authentication: auth 15 | 16 | authentications: 17 | auth: 18 | type: cssclientcredentials 19 | email: electronics_user1@example.com 20 | password: electronics_user1 21 | oidcIssuer: https://css11/ 22 | webId: https://electronics_user1/profile/card#me 23 | 24 | mappings: 25 | persons: 26 | sources: people-source 27 | subjects: 28 | - value: http://example.org/$(id) 29 | targets: linked-http-target 30 | po: 31 | - [foaf:name, $(name)] 32 | -------------------------------------------------------------------------------- /test/equal-reverse/data.csv: -------------------------------------------------------------------------------- 1 | id,type 2 | a,0 3 | b,1 4 | -------------------------------------------------------------------------------- /test/equal-reverse/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | mappings: 5 | mapping: 6 | sources: 7 | - ['data.csv~csv'] 8 | s: ex:$(id) 9 | po: 10 | - p: ex:p 11 | o: ex:o 12 | condition: 13 | function: equal 14 | parameters: 15 | - [str2, $(type), s] 16 | - [str1, "1", o] 17 | -------------------------------------------------------------------------------- /test/equal/data.csv: -------------------------------------------------------------------------------- 1 | id,type 2 | a,0 3 | b,1 4 | -------------------------------------------------------------------------------- /test/equal/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | mappings: 5 | mapping: 6 | sources: 7 | - ['data.csv~csv'] 8 | s: ex:$(id) 9 | po: 10 | - p: ex:p 11 | o: ex:o 12 | condition: 13 | function: equal 14 | parameters: 15 | - [str1, $(type)] 16 | - [str2, "1"] 17 | -------------------------------------------------------------------------------- /test/escape-bracket/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | 11 | :map_person_000 rml:logicalSource :source_000 ; 12 | rdf:type rr:TriplesMap ; 13 | rdfs:label "person" ; 14 | rr:subjectMap :s_000 ; 15 | rr:predicateObjectMap :pom_000 . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rml:source "input.csv" ; 19 | rml:referenceFormulation ql:CSV . 20 | 21 | :s_000 rdf:type rr:SubjectMap ; 22 | rr:template "http://example.com/{(test)}" . 23 | 24 | :pom_000 rdf:type rr:PredicateObjectMap ; 25 | rr:predicateMap :pm_000 ; 26 | rr:objectMap :om_000 . 27 | 28 | :pm_000 rdf:type rr:PredicateMap ; 29 | rr:constant rdf:type . 30 | 31 | :om_000 rdf:type rr:ObjectMap ; 32 | rr:constant "http://xmlns.com/foaf/0.1/Person" ; 33 | rr:termType rr:IRI . 34 | 35 | -------------------------------------------------------------------------------- /test/escape-bracket/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | sources: 4 | - ['input.csv~csv'] 5 | s: http://example.com/$((test\)) 6 | po: 7 | - [a, foaf:Person] 8 | -------------------------------------------------------------------------------- /test/escape-character/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | 11 | :map_person_000 rml:logicalSource :source_000 ; 12 | rdf:type rr:TriplesMap ; 13 | rdfs:label "person" ; 14 | rr:subjectMap :s_000 ; 15 | rr:predicateObjectMap :pom_000 . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rml:source "person.csv" ; 19 | rml:referenceFormulation ql:CSV . 20 | 21 | :s_000 rdf:type rr:SubjectMap ; 22 | rr:template "{id}::number" . 23 | 24 | :pom_000 rdf:type rr:PredicateObjectMap ; 25 | rr:predicateMap :pm_000 ; 26 | rr:objectMap :om_000 . 27 | 28 | :pm_000 rdf:type rr:PredicateMap ; 29 | rr:constant rdf:type . 30 | 31 | :om_000 rdf:type rr:ObjectMap ; 32 | rr:constant "http://schema.org/Person" ; 33 | rr:termType rr:IRI . 34 | 35 | -------------------------------------------------------------------------------- /test/escape-character/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | sources: 4 | - ["person.csv~csv"] 5 | s: $(id)\:\:number 6 | po: 7 | - [a, schema:Person] 8 | -------------------------------------------------------------------------------- /test/escape-colon-object/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | @prefix n1: . 12 | 13 | :map_person_000 rml:logicalSource :source_000 ; 14 | rdf:type rr:TriplesMap ; 15 | rdfs:label "person" ; 16 | rr:subjectMap :s_000 ; 17 | rr:predicateObjectMap :pom_000 . 18 | 19 | :source_000 rdf:type rml:LogicalSource ; 20 | rml:source "test.csv" ; 21 | rml:referenceFormulation ql:CSV . 22 | 23 | :s_000 rdf:type rr:SubjectMap ; 24 | rr:template "http://example.com/{id}" . 25 | 26 | :pom_000 rdf:type rr:PredicateObjectMap ; 27 | rr:predicateMap :pm_000 ; 28 | rr:objectMap :om_000 . 29 | 30 | :pm_000 rdf:type rr:PredicateMap ; 31 | rr:constant ex:name . 32 | 33 | :om_000 rdf:type rr:ObjectMap ; 34 | rr:template "http://n1.com/{name}/test:hello" ; 35 | rr:termType rr:Literal . 36 | 37 | -------------------------------------------------------------------------------- /test/escape-colon-object/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | n1: http://n1.com/ 4 | mappings: 5 | person: 6 | sources: 7 | - [test.csv~csv] 8 | s: http://example.com/$(id) 9 | po: 10 | - p: ex:name 11 | o: n1:$(name)/test\:hello 12 | -------------------------------------------------------------------------------- /test/example1/r2rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | table: example 8 | queryFormulation: mysql 9 | mappings: 10 | FromToMaps: 11 | sources: source1 12 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 13 | predicateobjects: 14 | - [a, mail:note~iri] 15 | - [mail:when,$(@year)-$(@month)-$(@day), xsd:date] #~iri or literal (default for object) 16 | - [mail:from,$(from)] 17 | - [mail:to, $(to)] 18 | - [mail:heading,$(heading)] 19 | - [mail:body,$(body)] 20 | DateTime: 21 | source: source1 22 | subject: "http://www.example.com/DateTime/$(@year)$(@month)$(@day)" 23 | predicateobjects: 24 | - [a, ex:DateTime~iri] 25 | - [ex:day,--$(@day),xsd:gDay] 26 | - [ex:month,--$(@month),xsd:gMonth] 27 | - [ex:year, $(@year), xsd:gYear] 28 | -------------------------------------------------------------------------------- /test/example1/rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | FromToMaps: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [a, mail:note~iri] 17 | - [mail:when,$(@year)-$(@month)-$(@day), xsd:date] #~iri or literal (default for object) 18 | - [mail:from,$(from)] 19 | - [mail:to, $(to)] 20 | - [mail:heading,$(heading)] 21 | - [mail:body,$(body)] 22 | DateTime: 23 | source: source1 24 | subject: "http://www.example.com/DateTime/$(@year)$(@month)$(@day)" 25 | predicateobjects: 26 | - [a, ex:DateTime~iri] 27 | - [ex:day,--$(@day),xsd:gDay] 28 | - [ex:month,--$(@month),xsd:gMonth] 29 | - [ex:year, $(@year), xsd:gYear] 30 | -------------------------------------------------------------------------------- /test/example4/r2rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | wgs84_pos: "http://www.w3.org/2003/01/geo/wgs84_pos#" 3 | gn: "http://www.geonames.org/ontology#" 4 | geosp: "http://www.telegraphis.net/ontology/geography/geography#" 5 | 6 | mappings: 7 | venue: 8 | sources: 9 | - table: Venue4 10 | queryFormulation: mysql 11 | subjects: "http://loc.example.com/city/$(city)" 12 | po: 13 | - [a, schema:City] 14 | - [wgs84_pos:lat,$(latitude)] 15 | - [wgs84_pos:long, $(longtitude)] 16 | - [geosp:onContinent, $(continent)] 17 | - [gn:countryCode,$(country)] 18 | -------------------------------------------------------------------------------- /test/example4/rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | wgs84_pos: "http://www.w3.org/2003/01/geo/wgs84_pos#" 3 | gn: "http://www.geonames.org/ontology#" 4 | geosp: "http://www.telegraphis.net/ontology/geography/geography#" 5 | 6 | mappings: 7 | venue: 8 | sources: 9 | - access: src/test/resources/example4/Venue4.json 10 | referenceFormulation: jsonpath 11 | iterator: $ 12 | subjects: "http://loc.example.com/city/$(city)" 13 | po: 14 | - [a, schema:City] 15 | - [wgs84_pos:lat,$(venue.latitude)] 16 | - [wgs84_pos:long, $(venue.longtitude)] 17 | - [geosp:onContinent, $(continent)] 18 | - [gn:countryCode,$(country)] 19 | -------------------------------------------------------------------------------- /test/example8/r2rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | simmodel: "http://www.lbl.gov/namespaces/Sim/Model/" 3 | simres: "http://www.lbl.gov/namespaces/Sim/ResourcesGeneral/" 4 | 5 | mappings: 6 | SimModelMapping: 7 | sources: 8 | - table: simergy 9 | queryFormulation: mysql 10 | subjects: "http://www.lbl.gov/namespaces/Sim/Model/$(@RefId)" 11 | predicateobjects: 12 | - [a, simmodel:SimAppLibraryDefault_AppLibraryDefault_GlobalLibrary] 13 | - [simmodel:refId, "$(@RefId)"] 14 | - [simres:simModelType, "$(simres:SimModelType)"] 15 | - [simres:SimModelSubtype, "$(simres:SimModelSubtype)"] 16 | - [simres:SimModelName,"$(simres:SimModelName)"] 17 | - [simres:SourceModelSchema,"$(simres:SourceModelSchema)"] 18 | - [simres:DefaultPreferenceIndex,"$(simres:DefaultPreferenceIndex)", xsd:int] 19 | - [simres:LibraryLocation,"$(simres:LibraryLocation)"] 20 | - [simres:LibraryName,"$(simres\:LibraryName)"] 21 | -------------------------------------------------------------------------------- /test/example8/rml/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | simmodel: "http://www.lbl.gov/namespaces/Sim/Model/" 3 | simres: "http://www.lbl.gov/namespaces/Sim/ResourcesGeneral/" 4 | 5 | mappings: 6 | SimModelMapping: 7 | sources: 8 | - access: src/test/resources/example8/simergy.xml 9 | referenceFormulation: xpath 10 | iterator: "/SimModel/simmodel:SimAppLibraryDefault_AppLibraryDefault_GlobalLibrary" 11 | subjects: "http://www.lbl.gov/namespaces/Sim/Model/$(@RefId)" 12 | predicateobjects: 13 | - [a, simmodel:SimAppLibraryDefault_AppLibraryDefault_GlobalLibrary] 14 | - [simmodel:refId, "$(@RefId)"] 15 | - [simres:simModelType, "$(simres:SimModelType)"] 16 | - [simres:SimModelSubtype, "$(simres:SimModelSubtype)"] 17 | - [simres:SimModelName,"$(simres:SimModelName)"] 18 | - [simres:SourceModelSchema,"$(simres:SourceModelSchema)"] 19 | - [simres:DefaultPreferenceIndex,"$(simres:DefaultPreferenceIndex)", xsd:int] 20 | - [simres:LibraryLocation,"$(simres:LibraryLocation)"] 21 | - [simres:LibraryName,"$(simres\:LibraryName)"] -------------------------------------------------------------------------------- /test/external-references/1/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_director_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "director" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001, :pom_002 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "https://ex.com/people/John" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant ex:livesIn . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:constant "Schellebelle" ; 34 | rr:termType rr:Literal . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:home . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rml:reference "_city" ; 45 | rr:termType rr:Literal . 46 | 47 | :pom_002 rdf:type rr:PredicateObjectMap ; 48 | rr:predicateMap :pm_002 ; 49 | rr:objectMap :om_002 . 50 | 51 | :pm_002 rdf:type rr:PredicateMap ; 52 | rr:constant ex:worksAt . 53 | 54 | :om_002 rdf:type rr:ObjectMap ; 55 | rml:reference "company" ; 56 | rr:termType rr:Literal . 57 | 58 | -------------------------------------------------------------------------------- /test/external-references/1/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | external: 5 | name: John 6 | city: Schellebelle 7 | 8 | mappings: 9 | director: 10 | sources: 11 | - [data.csv~csv] 12 | s: https://ex.com/people/$(_name) 13 | po: 14 | - p: ex:livesIn 15 | o: $(_city) 16 | - p: ex:home 17 | o: $(\_city) 18 | - p: ex:worksAt 19 | o: $(company) 20 | -------------------------------------------------------------------------------- /test/external-references/2/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_director_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "director" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001, :pom_002 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "https://ex.com/people/John/Schellebelle" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant ex:livesIn . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:constant "Schellebelle" ; 34 | rr:termType rr:Literal . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:home . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rml:reference "_city" ; 45 | rr:termType rr:Literal . 46 | 47 | :pom_002 rdf:type rr:PredicateObjectMap ; 48 | rr:predicateMap :pm_002 ; 49 | rr:objectMap :om_002 . 50 | 51 | :pm_002 rdf:type rr:PredicateMap ; 52 | rr:constant ex:worksAt . 53 | 54 | :om_002 rdf:type rr:ObjectMap ; 55 | rml:reference "company" ; 56 | rr:termType rr:Literal . 57 | 58 | -------------------------------------------------------------------------------- /test/external-references/2/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | external: 5 | name: John 6 | city: Schellebelle 7 | 8 | mappings: 9 | director: 10 | sources: 11 | - [data.csv~csv] 12 | s: https://ex.com/people/$(_name)/$(_city) 13 | po: 14 | - p: ex:livesIn 15 | o: $(_city) 16 | - p: ex:home 17 | o: $(\_city) 18 | - p: ex:worksAt 19 | o: $(company) 20 | -------------------------------------------------------------------------------- /test/external-references/3/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_director_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "director" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001, :pom_002 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "https://ex.com/people/John/{city}" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant ex:livesIn . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:constant "Schellebelle" ; 34 | rr:termType rr:Literal . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:home . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rml:reference "_city" ; 45 | rr:termType rr:Literal . 46 | 47 | :pom_002 rdf:type rr:PredicateObjectMap ; 48 | rr:predicateMap :pm_002 ; 49 | rr:objectMap :om_002 . 50 | 51 | :pm_002 rdf:type rr:PredicateMap ; 52 | rr:constant ex:worksAt . 53 | 54 | :om_002 rdf:type rr:ObjectMap ; 55 | rml:reference "company" ; 56 | rr:termType rr:Literal . 57 | 58 | -------------------------------------------------------------------------------- /test/external-references/3/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | external: 5 | name: John 6 | city: Schellebelle 7 | 8 | mappings: 9 | director: 10 | sources: 11 | - [data.csv~csv] 12 | s: https://ex.com/people/$(_name)/$(city) 13 | po: 14 | - p: ex:livesIn 15 | o: $(_city) 16 | - p: ex:home 17 | o: $(\_city) 18 | - p: ex:worksAt 19 | o: $(company) 20 | -------------------------------------------------------------------------------- /test/external-references/4/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_director_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "director" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001, :pom_002 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "https://ex.com/people/John/{city}" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant ex:livesIn . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:template "Schellebelle_{name}" ; 34 | rr:termType rr:Literal . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:home . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rml:reference "_city" ; 45 | rr:termType rr:Literal . 46 | 47 | :pom_002 rdf:type rr:PredicateObjectMap ; 48 | rr:predicateMap :pm_002 ; 49 | rr:objectMap :om_002 . 50 | 51 | :pm_002 rdf:type rr:PredicateMap ; 52 | rr:constant ex:worksAt . 53 | 54 | :om_002 rdf:type rr:ObjectMap ; 55 | rml:reference "company" ; 56 | rr:termType rr:Literal . 57 | 58 | -------------------------------------------------------------------------------- /test/external-references/4/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | external: 5 | name: John 6 | city: Schellebelle 7 | 8 | mappings: 9 | director: 10 | sources: 11 | - [data.csv~csv] 12 | s: https://ex.com/people/$(_name)/$(city) 13 | po: 14 | - p: ex:livesIn 15 | o: $(_city)_$(name) 16 | - p: ex:home 17 | o: $(\_city) 18 | - p: ex:worksAt 19 | o: $(company) 20 | -------------------------------------------------------------------------------- /test/external-references/5/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_director_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "director" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001, :pom_002 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "https://ex.com/people/John/{city}" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant ex:livesIn . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:template "{_city}_{name}" ; 34 | rr:termType rr:Literal . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:home . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rml:reference "_city" ; 45 | rr:termType rr:Literal . 46 | 47 | :pom_002 rdf:type rr:PredicateObjectMap ; 48 | rr:predicateMap :pm_002 ; 49 | rr:objectMap :om_002 . 50 | 51 | :pm_002 rdf:type rr:PredicateMap ; 52 | rr:constant ex:worksAt . 53 | 54 | :om_002 rdf:type rr:ObjectMap ; 55 | rml:reference "company" ; 56 | rr:termType rr:Literal . 57 | 58 | -------------------------------------------------------------------------------- /test/external-references/5/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | external: 5 | name: John 6 | 7 | mappings: 8 | director: 9 | sources: 10 | - [data.csv~csv] 11 | s: https://ex.com/people/$(_name)/$(city) 12 | po: 13 | - p: ex:livesIn 14 | o: $(_city)_$(name) 15 | - p: ex:home 16 | o: $(\_city) 17 | - p: ex:worksAt 18 | o: $(company) 19 | -------------------------------------------------------------------------------- /test/fno-parameter-as-iri/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | dyversify: http://example.com/idlab/functions/dyversify/ 4 | idlab-fn: https://w3id.org/imec/idlab/function# 5 | 6 | mappings: 7 | metadata: 8 | sources: 9 | - [api-metadata.json~jsonpath, $] 10 | s: ex:$(id) 11 | po: 12 | - [a, ex:Sensor] 13 | - p: ex:test 14 | o: 15 | function: dyversify:getSensorClasses 16 | parameters: 17 | - [idlab-fn:list, "$(allMetrics[*].id)~iri"] 18 | -------------------------------------------------------------------------------- /test/function-shortcut-with-2-parameters/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - [data.csv~csv] 9 | s: http://example.com/$(id) 10 | po: 11 | - p: schema:name 12 | o: 13 | - function: grel:toUpperCase(valueParameter = $(name), valueParameter2 = $(id)) 14 | -------------------------------------------------------------------------------- /test/function-shortcut-with-prefix/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | @prefix grel: . 12 | 13 | :map_person_000 rml:logicalSource :source_000 ; 14 | rdf:type rr:TriplesMap ; 15 | rdfs:label "person" ; 16 | rr:subjectMap :s_000 ; 17 | rr:predicateObjectMap :pom_000 . 18 | 19 | :source_000 rdf:type rml:LogicalSource ; 20 | rml:source "data.csv" ; 21 | rml:referenceFormulation ql:CSV . 22 | 23 | :s_000 rdf:type rr:SubjectMap ; 24 | rr:template "http://example.com/{id}" . 25 | 26 | :pom_000 rdf:type rr:PredicateObjectMap ; 27 | rr:predicateMap :pm_000 ; 28 | rr:objectMap :om_000 . 29 | 30 | :pm_000 rdf:type rr:PredicateMap ; 31 | rr:constant . 32 | 33 | :om_000 rdf:type fnml:FunctionTermMap ; 34 | rr:termType rr:Literal ; 35 | fnml:functionValue :fn_000 . 36 | 37 | :fn_000 rml:logicalSource :source_000 ; 38 | rr:predicateObjectMap :pomexec_000, :pom_001 . 39 | 40 | :pomexec_000 rr:predicateMap :pmexec_000 ; 41 | rr:objectMap :omexec_000 . 42 | 43 | :pmexec_000 rr:constant fno:executes . 44 | 45 | :omexec_000 rr:constant "http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase" ; 46 | rr:termType rr:IRI . 47 | 48 | :pom_001 rdf:type rr:PredicateObjectMap ; 49 | rr:predicateMap :pm_001 ; 50 | rr:objectMap :om_001 . 51 | 52 | :pm_001 rdf:type rr:PredicateMap ; 53 | rr:constant grel:valueParameter . 54 | 55 | :om_001 rdf:type rr:ObjectMap ; 56 | rml:reference "name" ; 57 | rr:termType rr:Literal . 58 | 59 | -------------------------------------------------------------------------------- /test/function-shortcut-with-prefix/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - [data.csv~csv] 9 | s: http://example.com/$(id) 10 | po: 11 | - p: schema:name 12 | o: 13 | - function: grel:toUpperCase(grel:valueParameter = $(name)) 14 | -------------------------------------------------------------------------------- /test/function-shortcut-without-prefix/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | @prefix grel: . 12 | 13 | :map_person_000 rml:logicalSource :source_000 ; 14 | rdf:type rr:TriplesMap ; 15 | rdfs:label "person" ; 16 | rr:subjectMap :s_000 ; 17 | rr:predicateObjectMap :pom_000 . 18 | 19 | :source_000 rdf:type rml:LogicalSource ; 20 | rml:source "data.csv" ; 21 | rml:referenceFormulation ql:CSV . 22 | 23 | :s_000 rdf:type rr:SubjectMap ; 24 | rr:template "http://example.com/{id}" . 25 | 26 | :pom_000 rdf:type rr:PredicateObjectMap ; 27 | rr:predicateMap :pm_000 ; 28 | rr:objectMap :om_000 . 29 | 30 | :pm_000 rdf:type rr:PredicateMap ; 31 | rr:constant . 32 | 33 | :om_000 rdf:type fnml:FunctionTermMap ; 34 | rr:termType rr:Literal ; 35 | fnml:functionValue :fn_000 . 36 | 37 | :fn_000 rml:logicalSource :source_000 ; 38 | rr:predicateObjectMap :pomexec_000, :pom_001 . 39 | 40 | :pomexec_000 rr:predicateMap :pmexec_000 ; 41 | rr:objectMap :omexec_000 . 42 | 43 | :pmexec_000 rr:constant fno:executes . 44 | 45 | :omexec_000 rr:constant "http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase" ; 46 | rr:termType rr:IRI . 47 | 48 | :pom_001 rdf:type rr:PredicateObjectMap ; 49 | rr:predicateMap :pm_001 ; 50 | rr:objectMap :om_001 . 51 | 52 | :pm_001 rdf:type rr:PredicateMap ; 53 | rr:constant grel:valueParameter . 54 | 55 | :om_001 rdf:type rr:ObjectMap ; 56 | rml:reference "name" ; 57 | rr:termType rr:Literal . 58 | 59 | -------------------------------------------------------------------------------- /test/function-shortcut-without-prefix/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - [data.csv~csv] 9 | s: http://example.com/$(id) 10 | po: 11 | - p: schema:name 12 | o: 13 | - function: grel:toUpperCase(valueParameter = $(name)) 14 | -------------------------------------------------------------------------------- /test/function-without-parameters/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | grel: "http://users.ugent.be/~bjdmeest/function/grel.ttl#" 4 | idlab-fn: "https://w3id.org/imec/idlab/function#" 5 | 6 | mappings: 7 | person: 8 | sources: 9 | - ['student.csv~csv'] 10 | s: 11 | function: grel:array_join 12 | parameters: 13 | - [grel:p_array_a, "http://example.com/person/"] 14 | - parameter: grel:p_array_a 15 | value: 16 | function: idlab-fn:random 17 | po: 18 | - [a, ex:Person] 19 | -------------------------------------------------------------------------------- /test/graph/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :people rdf:type rr:TriplesMap ; 13 | rdfs:label "people" ; 14 | rr:subjectMap :s_000 . 15 | 16 | :s_000 rdf:type rr:SubjectMap ; 17 | rr:template "http://example.org/{id}" ; 18 | rr:graphMap :gm_000 . 19 | 20 | :gm_000 rdf:type rr:GraphMap ; 21 | rr:constant "http://example.com/myGraph" . 22 | 23 | :cities rdf:type rr:TriplesMap ; 24 | rdfs:label "cities" ; 25 | rr:subjectMap :s_001 . 26 | 27 | :s_001 rdf:type rr:SubjectMap ; 28 | rr:template "http://example.org/{id}" ; 29 | rr:graphMap :gm_001 . 30 | 31 | :gm_001 rdf:type rr:GraphMap ; 32 | rr:template "http://example.com/{h}" . 33 | 34 | :houses rdf:type rr:TriplesMap ; 35 | rdfs:label "houses" ; 36 | rr:subjectMap :s_002 ; 37 | rr:predicateObjectMap :pom_000 . 38 | 39 | :s_002 rdf:type rr:SubjectMap ; 40 | rr:template "http://example.org/{id}" . 41 | 42 | :pom_000 rdf:type rr:PredicateObjectMap ; 43 | rr:predicateMap :pm_000 ; 44 | rr:objectMap :om_000 ; 45 | rr:graphMap :gm_002 . 46 | 47 | :pm_000 rdf:type rr:PredicateMap ; 48 | rr:constant . 49 | 50 | :om_000 rdf:type rr:ObjectMap ; 51 | rml:reference "name" ; 52 | rr:termType rr:Literal . 53 | 54 | :gm_002 rdf:type rr:GraphMap ; 55 | rr:constant "http://example.com/myHouseGraph" . 56 | 57 | -------------------------------------------------------------------------------- /test/graph/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | 4 | mappings: 5 | people: 6 | graph: ex:myGraph 7 | subject: http://example.org/$(id) 8 | cities: 9 | graph: ex:$(h) 10 | subject: http://example.org/$(id) 11 | houses: 12 | subject: http://example.org/$(id) 13 | po: 14 | - p: schema:name 15 | o: $(name) 16 | g: ex:myHouseGraph 17 | -------------------------------------------------------------------------------- /test/graph/mapping_fno.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | gbfs: "http://example.com/terms#" 3 | ex: "http://example.com/" 4 | geo: "http://www.w3.org/2003/01/geo/wgs84_pos#" 5 | myfun: "http://example.com/functions#" 6 | 7 | sources: 8 | station: 9 | access: data.json 10 | referenceFormulation: jsonpath 11 | iterator: $[*].fields 12 | 13 | mappings: 14 | # System 15 | system_info: 16 | graphs: 17 | - function: myfun:parseDate 18 | parameters: 19 | - [myfun:valueParameter, ex:stations/$(number)?last_updated=] 20 | - [myfun:valueParameter2, $(last_update)] 21 | sources: station 22 | s: ex:stations/$(number) 23 | po: 24 | - [gbfs:name, $(name)] 25 | -------------------------------------------------------------------------------- /test/incrml-ldes/original-ldes/all-properties/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | # Generate new LDES member if the timestamp changes (every reading) 2 | # for a certain sensor. 3 | 4 | prefixes: 5 | ex: http://example.org/ 6 | 7 | sources: 8 | data-source: [../readings.csv~csv] 9 | 10 | targets: 11 | target-ldes: 12 | access: output.ttl 13 | type: void 14 | serialization: turtle 15 | ldes: 16 | id: ex:ldes 17 | timestampPath: ex:ts 18 | 19 | mappings: 20 | temperature-reading: 21 | sources: data-source 22 | subjects: 23 | - value: ex:$(SensorID) 24 | targets: 25 | - target-ldes 26 | 27 | changeDetection: 28 | create: 29 | explicit: false 30 | update: 31 | explicit: false 32 | watchedProperties: [$(SensorID), $(Timestamp), $(Temperature)] 33 | 34 | po: 35 | - [a, ex:Thermometer] 36 | - [ex:temp, $(Temperature)] 37 | - [ex:ts, $(Timestamp), xsd:dateTime] 38 | -------------------------------------------------------------------------------- /test/incrml-ldes/original-ldes/new-member-on-temperature-change/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | # Generate new LDES member only if the temperature changes 2 | # for a certain sensor. 3 | 4 | prefixes: 5 | ex: http://example.org/ 6 | 7 | sources: 8 | data-source: [../readings.csv~csv] 9 | 10 | targets: 11 | target-ldes: 12 | access: output.ttl 13 | type: void 14 | serialization: turtle 15 | ldes: 16 | id: ex:ldes 17 | timestampPath: ex:ts 18 | 19 | mappings: 20 | temperature-reading: 21 | sources: data-source 22 | subjects: 23 | - value: ex:$(SensorID) 24 | targets: 25 | - target-ldes 26 | 27 | changeDetection: 28 | create: 29 | explicit: false 30 | update: 31 | explicit: false 32 | watchedProperties: $(Temperature) 33 | 34 | po: 35 | - [a, ex:Thermometer] 36 | - [ex:temp, $(Temperature)] 37 | - [ex:ts, $(Timestamp), xsd:dateTime] 38 | -------------------------------------------------------------------------------- /test/incrml-ldes/original-ldes/new-member-on-timestamp-change/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | # Generate new LDES member if the timestamp changes (every reading) 2 | # for a certain sensor. 3 | 4 | prefixes: 5 | ex: http://example.org/ 6 | 7 | sources: 8 | data-source: [../readings.csv~csv] 9 | 10 | targets: 11 | target-ldes: 12 | access: output.ttl 13 | type: void 14 | serialization: turtle 15 | ldes: 16 | id: ex:ldes 17 | timestampPath: ex:ts 18 | 19 | mappings: 20 | temperature-reading: 21 | sources: data-source 22 | subjects: 23 | - value: ex:$(SensorID) 24 | targets: 25 | - target-ldes 26 | 27 | changeDetection: 28 | create: 29 | explicit: false 30 | update: 31 | explicit: false 32 | watchedProperties: $(Timestamp) 33 | 34 | po: 35 | - [a, ex:Thermometer] 36 | - [ex:temp, $(Temperature)] 37 | - [ex:ts, $(Timestamp), xsd:dateTime] 38 | -------------------------------------------------------------------------------- /test/incrml-ldes/original-ldes/readings.csv: -------------------------------------------------------------------------------- 1 | SensorID,Timestamp,Temperature 2 | 1,2023-01-01T08:00:00,8 3 | 2,2023-01-01T08:00:00,9 4 | 1,2023-01-01T09:00:00,9 5 | 2,2023-01-01T09:00:00,9 6 | -------------------------------------------------------------------------------- /test/incrml-ldes/test-cases/RMLLDES0002e/base.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | # Explicit create, update and delete. 2 | # Although the source is the same file, changes are made explicit in 3 | # different JSON fields, thus we need 3 sources with another iterator. 4 | 5 | prefixes: 6 | ex: http://example.com/ 7 | as: https://www.w3.org/ns/activitystreams# 8 | 9 | sources: 10 | sensors: [base.json~jsonpath, '$.sensors[*]'] 11 | 12 | targets: 13 | target-ldes: 14 | access: output-base.nq 15 | type: void 16 | serialization: nquads 17 | ldes: 18 | id: ex:ldes 19 | timestampPath: dcterms:created # Added to the EventStream object, but not used in member objects in this test case 20 | versionOfPath: dcterms:isVersionOf # Added to the EventStream object, but not used in member objects in this test case 21 | generateImmutableIRI: false 22 | 23 | mappings: 24 | 25 | # The values of the sensors. These 'sensor objects' become member of an LDES 26 | sensor-reading: 27 | 28 | sources: sensors 29 | 30 | subjects: 31 | - value: ex:sensor/$(sensor) 32 | targets: target-ldes 33 | 34 | predicateobjects: 35 | - [ex:pressure, $(pressure)] 36 | - [ex:temperature, $(temperature)] 37 | 38 | changeDetection: 39 | create: 40 | explicit: false 41 | mappingAdd: 42 | graphs: ex:create 43 | 44 | update: 45 | explicit: false 46 | mappingAdd: 47 | graphs: ex:update 48 | watchedProperties: $(temperature) 49 | 50 | 51 | # Each LDES member is part of a graph, which describes the operation 52 | # performed: create, update or delete. We describe the graphs as 53 | # Activity Streams event 54 | # This should generate a static triples map (and new RML has this feature!) 55 | 56 | graph-create: 57 | subjects: ex:create 58 | predicateobjects: 59 | - [a, as:Create~iri] 60 | - [as:actor, ex:dataset~iri] 61 | 62 | graph-update: 63 | subjects: ex:update 64 | predicateobjects: 65 | - [a, as:Update~iri] 66 | - [as:actor, ex:dataset~iri] 67 | -------------------------------------------------------------------------------- /test/invalid/invalid_yaml.yml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | sources: 4 | - [test.json~jsonpath, $.[*]] -------------------------------------------------------------------------------- /test/invalid/po-without-o.yml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | po: 4 | - [a] -------------------------------------------------------------------------------- /test/joincondition-template-1-reference-text/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | sources: 4 | - [test.csv~csv] 5 | s: http://example.com/person/$(id) 6 | po: 7 | - p: schema:creator 8 | o: 9 | mapping: project 10 | condition: 11 | function: equal 12 | parameters: 13 | - [str1, $(id)_, s] 14 | - [str2, $(id), o] 15 | project: 16 | sources: 17 | - [test.csv~csv] 18 | s: http://example.com/project/$(id) 19 | po: 20 | - [a, schema:Project] 21 | -------------------------------------------------------------------------------- /test/joincondition-template-2-references/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | sources: 4 | - [test.csv~csv] 5 | s: http://example.com/person/$(id) 6 | po: 7 | - p: schema:creator 8 | o: 9 | mapping: project 10 | condition: 11 | function: equal 12 | parameters: 13 | - [str1, $(id)_$(name), s] 14 | - [str2, $(id)_$(name), o] 15 | project: 16 | sources: 17 | - [test.csv~csv] 18 | s: http://example.com/project/$(id) 19 | po: 20 | - [a, schema:Project] 21 | -------------------------------------------------------------------------------- /test/joincondition-with-function/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | 4 | mappings: 5 | person: 6 | source: 7 | - [test.csv~csv] 8 | s: http://ex.org/$(id) 9 | po: 10 | - [a, ex:Person] 11 | book: 12 | source: 13 | - [test2.csv~csv] 14 | s: http://ex.org/book/$(id) 15 | po: 16 | - [a, ex:Book] 17 | - p: ex:author 18 | o: 19 | mapping: person 20 | condition: 21 | function: equal 22 | parameters: 23 | - [str1, $(author), s] 24 | - parameter: str2 25 | value: 26 | function: ex:toLowerCase 27 | parameters: 28 | - [ex:input, $(name), o] 29 | -------------------------------------------------------------------------------- /test/language-map/constant-lang-string/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :map_person_000 rml:logicalSource :source_000 ; 16 | rdf:type rr:TriplesMap ; 17 | rdfs:label "person" ; 18 | rr:subjectMap :s_000 ; 19 | rr:predicateObjectMap :pom_000 . 20 | 21 | :source_000 rdf:type rml:LogicalSource ; 22 | rml:source "person.json" ; 23 | rml:iterator "$.[*]" ; 24 | rml:referenceFormulation ql:JSONPath . 25 | 26 | :s_000 rdf:type rr:SubjectMap ; 27 | rr:template "http://example.org/{entityid}" . 28 | 29 | :pom_000 rdf:type rr:PredicateObjectMap ; 30 | rr:predicateMap :pm_000 ; 31 | rr:objectMap :om_000 . 32 | 33 | :pm_000 rdf:type rr:PredicateMap ; 34 | rr:constant ex:value . 35 | 36 | :om_000 rdf:type rr:ObjectMap ; 37 | rml:reference "value" ; 38 | rr:termType rr:Literal ; 39 | rml:languageMap :language_000 . 40 | 41 | :language_000 rr:constant "en" . 42 | 43 | -------------------------------------------------------------------------------- /test/language-map/constant-lang-string/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - [ 'person.json~jsonpath', "$.[*]" ] 8 | s: ex:$(entityid) 9 | po: 10 | - p: ex:value 11 | o: 12 | - value: $(value) 13 | language: en 14 | datatype: rdf:langString 15 | -------------------------------------------------------------------------------- /test/language-map/constant-lang-string/person.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "entityid": 0, 4 | "value": "test" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /test/language-map/constant/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :map_person_000 rml:logicalSource :source_000 ; 16 | rdf:type rr:TriplesMap ; 17 | rdfs:label "person" ; 18 | rr:subjectMap :s_000 ; 19 | rr:predicateObjectMap :pom_000 . 20 | 21 | :source_000 rdf:type rml:LogicalSource ; 22 | rml:source "person.json" ; 23 | rml:iterator "$.[*]" ; 24 | rml:referenceFormulation ql:JSONPath . 25 | 26 | :s_000 rdf:type rr:SubjectMap ; 27 | rr:template "http://example.org/{entityid}" . 28 | 29 | :pom_000 rdf:type rr:PredicateObjectMap ; 30 | rr:predicateMap :pm_000 ; 31 | rr:objectMap :om_000 . 32 | 33 | :pm_000 rdf:type rr:PredicateMap ; 34 | rr:constant ex:value . 35 | 36 | :om_000 rdf:type rr:ObjectMap ; 37 | rml:reference "value" ; 38 | rr:termType rr:Literal ; 39 | rml:languageMap :language_000 . 40 | 41 | :language_000 rr:constant "en" . 42 | 43 | -------------------------------------------------------------------------------- /test/language-map/constant/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - [ 'person.json~jsonpath', "$.[*]" ] 8 | s: ex:$(entityid) 9 | po: 10 | - p: ex:value 11 | o: 12 | - value: $(value) 13 | language: en 14 | -------------------------------------------------------------------------------- /test/language-map/constant/person.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "entityid": 0, 4 | "value": "test" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /test/language-map/reference/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :map_person_000 rml:logicalSource :source_000 ; 16 | rdf:type rr:TriplesMap ; 17 | rdfs:label "person" ; 18 | rr:subjectMap :s_000 ; 19 | rr:predicateObjectMap :pom_000 . 20 | 21 | :source_000 rdf:type rml:LogicalSource ; 22 | rml:source "person.json" ; 23 | rml:iterator "$.[*]" ; 24 | rml:referenceFormulation ql:JSONPath . 25 | 26 | :s_000 rdf:type rr:SubjectMap ; 27 | rr:template "http://example.org/{entityid}" . 28 | 29 | :pom_000 rdf:type rr:PredicateObjectMap ; 30 | rr:predicateMap :pm_000 ; 31 | rr:objectMap :om_000 . 32 | 33 | :pm_000 rdf:type rr:PredicateMap ; 34 | rr:constant ex:value . 35 | 36 | :om_000 rdf:type rr:ObjectMap ; 37 | rml:reference "value" ; 38 | rr:termType rr:Literal ; 39 | rml:languageMap :language_000 . 40 | 41 | :language_000 rml:reference "locale" . 42 | 43 | -------------------------------------------------------------------------------- /test/language-map/reference/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - [ 'person.json~jsonpath', "$.[*]" ] 8 | s: ex:$(entityid) 9 | po: 10 | - p: ex:value 11 | o: 12 | - value: $(value) 13 | language: $(locale) 14 | -------------------------------------------------------------------------------- /test/language-map/reference/person.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "entityid": 0, 4 | "locale": "en", 5 | "value": "test" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /test/language-map/template/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :map_person_000 rml:logicalSource :source_000 ; 16 | rdf:type rr:TriplesMap ; 17 | rdfs:label "person" ; 18 | rr:subjectMap :s_000 ; 19 | rr:predicateObjectMap :pom_000 . 20 | 21 | :source_000 rdf:type rml:LogicalSource ; 22 | rml:source "person.json" ; 23 | rml:iterator "$.[*]" ; 24 | rml:referenceFormulation ql:JSONPath . 25 | 26 | :s_000 rdf:type rr:SubjectMap ; 27 | rr:template "http://example.org/{entityid}" . 28 | 29 | :pom_000 rdf:type rr:PredicateObjectMap ; 30 | rr:predicateMap :pm_000 ; 31 | rr:objectMap :om_000 . 32 | 33 | :pm_000 rdf:type rr:PredicateMap ; 34 | rr:constant ex:value . 35 | 36 | :om_000 rdf:type rr:ObjectMap ; 37 | rml:reference "value" ; 38 | rr:termType rr:Literal ; 39 | rml:languageMap :language_000 . 40 | 41 | :language_000 rr:template "en-{locale}" . 42 | 43 | -------------------------------------------------------------------------------- /test/language-map/template/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - [ 'person.json~jsonpath', "$.[*]" ] 8 | s: ex:$(entityid) 9 | po: 10 | - p: ex:value 11 | o: 12 | - value: $(value) 13 | language: en-$(locale) 14 | -------------------------------------------------------------------------------- /test/language-map/template/person.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "entityid": 0, 4 | "locale": "gb", 5 | "value": "test" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /test/metadata/r2rml/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | table: example 8 | queryFormulation: mysql 9 | mappings: 10 | FromToMaps: 11 | sources: source1 12 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 13 | predicateobjects: 14 | - [a, mail:note~iri] 15 | - [mail:when,$(@year)-$(@month)-$(@day), xsd:date] #~iri or literal (default for object) 16 | - [mail:from,$(from)] 17 | - [mail:to, $(to)] 18 | - [mail:heading,$(heading)] 19 | - [mail:body,$(body)] 20 | DateTime: 21 | source: source1 22 | subject: "http://www.example.com/DateTime/$(@year)$(@month)$(@day)" 23 | predicateobjects: 24 | - [a, ex:DateTime~iri] 25 | - [ex:day,--$(@day),xsd:gDay] 26 | - [ex:month,--$(@month),xsd:gMonth] 27 | - [ex:year, $(@year), xsd:gYear] 28 | -------------------------------------------------------------------------------- /test/metadata/rml/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | FromToMaps: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [a, mail:note~iri] 17 | - [mail:when,$(@year)-$(@month)-$(@day), xsd:date] #~iri or literal (default for object) 18 | - [mail:from,$(from)] 19 | - [mail:to, $(to)] 20 | - [mail:heading,$(heading)] 21 | - [mail:body,$(body)] 22 | DateTime: 23 | source: source1 24 | subject: "http://www.example.com/DateTime/$(@year)$(@month)$(@day)" 25 | predicateobjects: 26 | - [a, ex:DateTime~iri] 27 | - [ex:day,--$(@day),xsd:gDay] 28 | - [ex:month,--$(@month),xsd:gMonth] 29 | - [ex:year, $(@year), xsd:gYear] 30 | -------------------------------------------------------------------------------- /test/multiple-input-files/mapping-1.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | FromToMaps: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [a, mail:note~iri] 17 | - [mail:when,$(@year)-$(@month)-$(@day), xsd:date] #~iri or literal (default for object) 18 | - [mail:from,$(from)] 19 | - [mail:to, $(to)] 20 | - [mail:heading,$(heading)] 21 | - [mail:body,$(body)] 22 | -------------------------------------------------------------------------------- /test/multiple-input-files/mapping-2.yarrrml: -------------------------------------------------------------------------------- 1 | 2 | mappings: 3 | DateTime: 4 | source: source1 5 | subject: "http://www.example.com/DateTime/$(@year)$(@month)$(@day)" 6 | predicateobjects: 7 | - [a, ex:DateTime~iri] 8 | - [ex:day,--$(@day),xsd:gDay] 9 | - [ex:month,--$(@month),xsd:gMonth] 10 | - [ex:year, $(@year), xsd:gYear] 11 | -------------------------------------------------------------------------------- /test/multiple-sources-with-linked-mappings/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | 4 | mappings: 5 | employee: 6 | sources: 7 | - [data-1.csv~csv] 8 | - [data-2.csv~csv] 9 | s: ex:$(id) 10 | po: 11 | - p: ex:project 12 | o: 13 | mapping: project 14 | condition: 15 | function: equal 16 | parameters: 17 | - [str1, $(project-id)] 18 | - [str2, $(id)] 19 | 20 | project: 21 | sources: 22 | - [data-1.csv~csv] 23 | - [data-2.csv~csv] 24 | s: ex:$(slug) -------------------------------------------------------------------------------- /test/multiple-sources/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix ex: . 14 | 15 | :map_m1_000 rml:logicalSource :source_000 ; 16 | rdf:type rr:TriplesMap ; 17 | rdfs:label "m1" ; 18 | rr:subjectMap :s_000 ; 19 | rr:predicateObjectMap :pom_000 . 20 | 21 | :source_000 rdf:type rml:LogicalSource ; 22 | rml:source "f1.csv" ; 23 | rml:referenceFormulation ql:CSV . 24 | 25 | :s_000 rdf:type rr:SubjectMap ; 26 | rr:template "http://example.com/ex/{Id}" . 27 | 28 | :pom_000 rdf:type rr:PredicateObjectMap ; 29 | rr:predicateMap :pm_000 ; 30 | rr:objectMap :om_000 . 31 | 32 | :pm_000 rdf:type rr:PredicateMap ; 33 | rr:constant ex:myProperty . 34 | 35 | :om_000 rdf:type rr:ObjectMap ; 36 | rr:constant "http://example.com/ex/myObject" ; 37 | rr:termType rr:IRI . 38 | 39 | :map_m1_001 rml:logicalSource :source_001 ; 40 | rdf:type rr:TriplesMap ; 41 | rdfs:label "m1" ; 42 | rr:subjectMap :s_001 ; 43 | rr:predicateObjectMap :pom_001 . 44 | 45 | :source_001 rdf:type rml:LogicalSource ; 46 | rml:source "f2.csv" ; 47 | rml:referenceFormulation ql:CSV . 48 | 49 | :s_001 rdf:type rr:SubjectMap ; 50 | rr:template "http://example.com/ex/{Id}" . 51 | 52 | :pom_001 rdf:type rr:PredicateObjectMap ; 53 | rr:predicateMap :pm_001 ; 54 | rr:objectMap :om_001 . 55 | 56 | :pm_001 rdf:type rr:PredicateMap ; 57 | rr:constant ex:myProperty . 58 | 59 | :om_001 rdf:type rr:ObjectMap ; 60 | rr:constant "http://example.com/ex/myObject" ; 61 | rr:termType rr:IRI . 62 | 63 | -------------------------------------------------------------------------------- /test/multiple-sources/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/ex/" 3 | 4 | mappings: 5 | m1: 6 | sources: 7 | - ['f1.csv~csv'] 8 | - ['f2.csv~csv'] 9 | s: ex:$(Id) 10 | po: 11 | - [ex:myProperty, ex:myObject~iri] -------------------------------------------------------------------------------- /test/namednode/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | 11 | :map_test_000 rml:logicalSource :source_000 ; 12 | rdf:type rr:TriplesMap ; 13 | rdfs:label "test" ; 14 | rr:subjectMap :s_000 ; 15 | rr:predicateObjectMap :pom_000 . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rml:source "test.csv" ; 19 | rml:referenceFormulation ql:CSV . 20 | 21 | :s_000 rdf:type rr:SubjectMap ; 22 | rr:constant . 23 | 24 | :pom_000 rdf:type rr:PredicateObjectMap ; 25 | rr:predicateMap :pm_000 ; 26 | rr:objectMap :om_000 . 27 | 28 | :pm_000 rdf:type rr:PredicateMap ; 29 | rr:constant . 30 | 31 | :om_000 rdf:type rr:ObjectMap ; 32 | rr:constant ; 33 | rr:termType rr:IRI . 34 | -------------------------------------------------------------------------------- /test/namednode/mapping.yarrrml.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | mappings: 4 | test: 5 | sources: 6 | - [test.csv~csv] 7 | s: ex:some_subject_iri 8 | po: 9 | - [ex:my_predicate, ex:my_object_iri~iri] -------------------------------------------------------------------------------- /test/object-blank-node/constant/data.csv: -------------------------------------------------------------------------------- 1 | id 2 | 0 3 | 1 4 | -------------------------------------------------------------------------------- /test/object-blank-node/constant/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_person_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "person" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "http://example.com/{id}" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant rdf:type . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:constant "http://xmlns.com/foaf/0.1/Person" ; 34 | rr:termType rr:IRI . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:test . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rr:constant "test" ; 45 | rr:termType rr:BlankNode . 46 | 47 | -------------------------------------------------------------------------------- /test/object-blank-node/constant/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - ['data.csv~csv'] 8 | s: http://example.com/$(id) 9 | po: 10 | - [a, foaf:Person] 11 | - p: ex:test 12 | o: 13 | value: test 14 | type: blank 15 | -------------------------------------------------------------------------------- /test/object-blank-node/data.csv: -------------------------------------------------------------------------------- 1 | id 2 | 0 3 | 1 4 | -------------------------------------------------------------------------------- /test/object-blank-node/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_person_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "person" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "http://example.com/{id}" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant rdf:type . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:constant "http://xmlns.com/foaf/0.1/Person" ; 34 | rr:termType rr:IRI . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:test . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rr:termType rr:BlankNode . 45 | 46 | -------------------------------------------------------------------------------- /test/object-blank-node/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - ['data.csv~csv'] 8 | s: http://example.com/$(id) 9 | po: 10 | - [a, foaf:Person] 11 | - p: ex:test 12 | o: 13 | type: blank 14 | -------------------------------------------------------------------------------- /test/object-blank-node/template/data.csv: -------------------------------------------------------------------------------- 1 | id 2 | 0 3 | 1 4 | -------------------------------------------------------------------------------- /test/object-blank-node/template/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_person_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "person" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rr:template "http://example.com/{id}" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant rdf:type . 31 | 32 | :om_000 rdf:type rr:ObjectMap ; 33 | rr:constant "http://xmlns.com/foaf/0.1/Person" ; 34 | rr:termType rr:IRI . 35 | 36 | :pom_001 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_001 ; 38 | rr:objectMap :om_001 . 39 | 40 | :pm_001 rdf:type rr:PredicateMap ; 41 | rr:constant ex:test . 42 | 43 | :om_001 rdf:type rr:ObjectMap ; 44 | rr:template "{id}-abc" ; 45 | rr:termType rr:BlankNode . 46 | 47 | -------------------------------------------------------------------------------- /test/object-blank-node/template/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - ['data.csv~csv'] 8 | s: http://example.com/$(id) 9 | po: 10 | - [a, foaf:Person] 11 | - p: ex:test 12 | o: 13 | value: $(id)-abc 14 | type: blank 15 | -------------------------------------------------------------------------------- /test/object-number/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | 11 | :map_person_000 rml:logicalSource :source_000 ; 12 | rdf:type rr:TriplesMap ; 13 | rdfs:label "person" ; 14 | rr:subjectMap :s_000 ; 15 | rr:predicateObjectMap :pom_000, :pom_001 . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rml:source "test.csv" ; 19 | rml:referenceFormulation ql:CSV . 20 | 21 | :s_000 rdf:type rr:SubjectMap ; 22 | rr:termType rr:BlankNode . 23 | 24 | :pom_000 rdf:type rr:PredicateObjectMap ; 25 | rr:predicateMap :pm_000 ; 26 | rr:objectMap :om_000 . 27 | 28 | :pm_000 rdf:type rr:PredicateMap ; 29 | rr:constant . 30 | 31 | :om_000 rdf:type rr:ObjectMap ; 32 | rr:constant "2" ; 33 | rr:termType rr:Literal . 34 | 35 | :pom_001 rdf:type rr:PredicateObjectMap ; 36 | rr:predicateMap :pm_001 ; 37 | rr:objectMap :om_001 . 38 | 39 | :pm_001 rdf:type rr:PredicateMap ; 40 | rr:constant . 41 | 42 | :om_001 rdf:type rr:ObjectMap ; 43 | rr:constant "2.1" ; 44 | rr:termType rr:Literal . 45 | 46 | -------------------------------------------------------------------------------- /test/object-number/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | source: 4 | - [test.csv~csv] 5 | po: 6 | - [schema:test, 2] 7 | - [schema:test2, 2.1] 8 | -------------------------------------------------------------------------------- /test/oracle/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix rc: . 11 | @prefix rd: . 12 | @prefix idlab-fn: . 13 | @prefix grel: . 14 | 15 | :map_human_resources_000 rml:logicalSource :source_000 ; 16 | rdf:type rr:TriplesMap ; 17 | rdfs:label "human_resources" ; 18 | rr:subjectMap :s_000 ; 19 | rr:predicateObjectMap :pom_000 . 20 | 21 | :source_000 rdf:type rml:LogicalSource ; 22 | rml:source :database_000 ; 23 | rml:query "SELECT * from OUR_TABLE" ; 24 | rr:sqlVersion rr:SQL2008 ; 25 | rml:referenceFormulation ql:CSV . 26 | 27 | :database_000 rdf:type d2rq:Database ; 28 | d2rq:jdbcDSN "//1.2.3.4:6789" ; 29 | d2rq:jdbcDriver "oracle.jdbc.driver.OracleDriver" ; 30 | d2rq:username "TEST" ; 31 | d2rq:password "test" . 32 | 33 | :s_000 rdf:type rr:SubjectMap ; 34 | rr:template "https://example.org/person_{ID}" . 35 | 36 | :pom_000 rdf:type rr:PredicateObjectMap ; 37 | rr:predicateMap :pm_000 ; 38 | rr:objectMap :om_000 . 39 | 40 | :pm_000 rdf:type rr:PredicateMap ; 41 | rr:constant rdf:type . 42 | 43 | :om_000 rdf:type rr:ObjectMap ; 44 | rr:constant "http://example.com/Person" ; 45 | rr:termType rr:IRI . 46 | 47 | -------------------------------------------------------------------------------- /test/oracle/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | rc: "http://example.com/" 3 | rd: "https://example.org/" 4 | idlab-fn: https://w3id.org/imec/idlab/function# 5 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 6 | 7 | mappings: 8 | 9 | human_resources: 10 | sources: 11 | - access: //1.2.3.4:6789 12 | type: oracle 13 | credentials: 14 | username: TEST 15 | password: test 16 | queryFormulation: sql2008 17 | query: SELECT * from OUR_TABLE 18 | referenceFormulation: csv 19 | s: rd:person_$(ID) 20 | po: 21 | - [a, rc:Person] 22 | -------------------------------------------------------------------------------- /test/predicate-with-prefix-template/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_nodes_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "nodes" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "track_metadata.xml" ; 20 | rml:iterator "/osm/node" ; 21 | rml:referenceFormulation ql:XPath . 22 | 23 | :s_000 rdf:type rr:SubjectMap ; 24 | rr:template "http://example.com/node/{@id}" . 25 | 26 | :pom_000 rdf:type rr:PredicateObjectMap ; 27 | rr:predicateMap :pm_000 ; 28 | rr:objectMap :om_000 . 29 | 30 | :pm_000 rdf:type rr:PredicateMap ; 31 | rr:template "http://example.com/test{@id}" . 32 | 33 | :om_000 rdf:type rr:ObjectMap ; 34 | rml:reference "tag/@v" ; 35 | rr:termType rr:Literal . 36 | 37 | -------------------------------------------------------------------------------- /test/predicate-with-prefix-template/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | nodes: 6 | sources: 7 | - [track_metadata.xml~xpath, /osm/node] 8 | s: "ex:node/$(@id)" 9 | po: 10 | - ["ex:test$(@id)", "$(tag/@v)"] 11 | -------------------------------------------------------------------------------- /test/prefix-expand/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_statement_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "statement" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000, :pom_001, :pom_002 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data.json" ; 20 | rml:iterator "$[*]" ; 21 | rml:referenceFormulation ql:JSONPath . 22 | 23 | :s_000 rdf:type rr:SubjectMap ; 24 | rr:template "http://example.com/{id}" . 25 | 26 | :pom_000 rdf:type rr:PredicateObjectMap ; 27 | rr:predicateMap :pm_000 ; 28 | rr:objectMap :om_000 . 29 | 30 | :pm_000 rdf:type rr:PredicateMap ; 31 | rr:constant rdf:type . 32 | 33 | :om_000 rdf:type rr:ObjectMap ; 34 | rr:constant "http://example.com/statement" ; 35 | rr:termType rr:IRI . 36 | 37 | :pom_001 rdf:type rr:PredicateObjectMap ; 38 | rr:predicateMap :pm_001 ; 39 | rr:objectMap :om_001 . 40 | 41 | :pm_001 rdf:type rr:PredicateMap ; 42 | rr:constant rdf:type . 43 | 44 | :om_001 rdf:type rr:ObjectMap ; 45 | rr:constant "sp:statement" ; 46 | rr:termType rr:IRI . 47 | 48 | :pom_002 rdf:type rr:PredicateObjectMap ; 49 | rr:predicateMap :pm_002 ; 50 | rr:objectMap :om_002 . 51 | 52 | :pm_002 rdf:type rr:PredicateMap ; 53 | rr:constant ex:name . 54 | 55 | :om_002 rdf:type rr:ObjectMap ; 56 | rr:template "sp: {name}" ; 57 | rr:termType rr:Literal . 58 | 59 | -------------------------------------------------------------------------------- /test/prefix-expand/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | 4 | mappings: 5 | statement: 6 | sources: 7 | - ['data.json~jsonpath', '$[*]'] 8 | s: http://example.com/$(id) 9 | po: 10 | - [a, ex:statement] 11 | - [a, sp:statement] 12 | - [ex:name, 'sp: $(name)'] -------------------------------------------------------------------------------- /test/prefix-expand/output.1.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rml: . 3 | @prefix ql: . 4 | @prefix : . 5 | 6 | :map_statement_0 rml:logicalSource _:g0 ; 7 | rr:subjectMap _:g1 ; 8 | rr:predicateObjectMap _:g2 . 9 | 10 | _:g0 rml:referenceFormulation ql:JSONPath ; 11 | rml:iterator "$[*]" ; 12 | rml:source "data.json" . 13 | 14 | _:g1 rr:template "http://example.com/{id}" ; 15 | rr:class "http://example.com/statement", "sp:statement" . 16 | 17 | _:g2 rr:objectMap _:g3 ; 18 | rr:predicate . 19 | 20 | _:g3 rr:template "sp: {name}" . 21 | 22 | -------------------------------------------------------------------------------- /test/prettify_ttl.js: -------------------------------------------------------------------------------- 1 | const glob = require('glob'); 2 | const path = require('path'); 3 | const fs = require('fs/promises'); 4 | const { canonicalize } = require('../lib/tools'); 5 | 6 | const files = glob.sync('./**/*.ttl', { cwd: path.resolve(__dirname) }); 7 | files.forEach(async (file) => { 8 | const content = await fs.readFile(path.resolve(__dirname, file), 'utf8'); 9 | const prettyContent = await canonicalize(content); 10 | await fs.writeFile(path.resolve(__dirname, file), prettyContent, 'utf8'); 11 | console.log('fixed ' + file); 12 | }) 13 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0001a/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | 9 | :map_student_000 rr:logicalTable :source_000 ; 10 | rdf:type rr:TriplesMap ; 11 | rdfs:label "student" ; 12 | rr:subjectMap :s_000 ; 13 | rr:predicateObjectMap :pom_000 . 14 | 15 | :source_000 rdf:type rr:LogicalTable ; 16 | rr:tableName "Student" . 17 | 18 | :s_000 rdf:type rr:SubjectMap ; 19 | rr:template "http://example.com/{Name}" . 20 | 21 | :pom_000 rdf:type rr:PredicateObjectMap ; 22 | rr:predicateMap :pm_000 ; 23 | rr:objectMap :om_000 . 24 | 25 | :pm_000 rdf:type rr:PredicateMap ; 26 | rr:constant . 27 | 28 | :om_000 rdf:type rr:ObjectMap ; 29 | rr:column "Name" ; 30 | rr:termType rr:Literal . 31 | 32 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0001a/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | student: 3 | sources: 4 | - table: Student 5 | s: http://example.com/$(Name) 6 | po: 7 | - [foaf:name, $(Name)] 8 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0002a/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix ex: . 9 | 10 | :map_student_000 rr:logicalTable :source_000 ; 11 | rdf:type rr:TriplesMap ; 12 | rdfs:label "student" ; 13 | rr:subjectMap :s_000 ; 14 | rr:predicateObjectMap :pom_000, :pom_001, :pom_002 . 15 | 16 | :source_000 rdf:type rr:LogicalTable ; 17 | rr:tableName "Student" . 18 | 19 | :s_000 rdf:type rr:SubjectMap ; 20 | rr:template "http://example.com/{ID}/{Name}" . 21 | 22 | :pom_000 rdf:type rr:PredicateObjectMap ; 23 | rr:predicateMap :pm_000 ; 24 | rr:objectMap :om_000 . 25 | 26 | :pm_000 rdf:type rr:PredicateMap ; 27 | rr:constant rdf:type . 28 | 29 | :om_000 rdf:type rr:ObjectMap ; 30 | rr:constant "http://xmlns.com/foaf/0.1/Person" ; 31 | rr:termType rr:IRI . 32 | 33 | :pom_001 rdf:type rr:PredicateObjectMap ; 34 | rr:predicateMap :pm_001 ; 35 | rr:objectMap :om_001 . 36 | 37 | :pm_001 rdf:type rr:PredicateMap ; 38 | rr:constant ex:id . 39 | 40 | :om_001 rdf:type rr:ObjectMap ; 41 | rr:column "ID" ; 42 | rr:termType rr:Literal . 43 | 44 | :pom_002 rdf:type rr:PredicateObjectMap ; 45 | rr:predicateMap :pm_002 ; 46 | rr:objectMap :om_002 . 47 | 48 | :pm_002 rdf:type rr:PredicateMap ; 49 | rr:constant . 50 | 51 | :om_002 rdf:type rr:ObjectMap ; 52 | rr:column "Name" ; 53 | rr:termType rr:Literal . 54 | 55 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0002a/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | 4 | mappings: 5 | student: 6 | sources: 7 | - table: Student 8 | s: http://example.com/$(ID)/$(Name) 9 | po: 10 | - [a, foaf:Person] 11 | - [ex:id, $(ID)] 12 | - [foaf:name, $(Name)] 13 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0002d/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | 9 | :map_student_000 rr:logicalTable :source_000 ; 10 | rdf:type rr:TriplesMap ; 11 | rdfs:label "student" ; 12 | rr:subjectMap :s_000 ; 13 | rr:predicateObjectMap :pom_000 . 14 | 15 | :source_000 rdf:type rr:LogicalTable ; 16 | rr:sqlQuery "Select ('Student' || \"ID\" ) AS StudentId , \"ID\" , \"Name\" from \"Student\"" . 17 | 18 | :s_000 rdf:type rr:SubjectMap ; 19 | rr:termType rr:BlankNode . 20 | 21 | :pom_000 rdf:type rr:PredicateObjectMap ; 22 | rr:predicateMap :pm_000 ; 23 | rr:objectMap :om_000 . 24 | 25 | :pm_000 rdf:type rr:PredicateMap ; 26 | rr:constant . 27 | 28 | :om_000 rdf:type rr:ObjectMap ; 29 | rr:column "Name" ; 30 | rr:termType rr:Literal . 31 | 32 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0002d/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | student: 3 | sources: 4 | - query: > 5 | Select ('Student' || "ID" ) AS StudentId 6 | , "ID" 7 | , "Name" 8 | from "Student" 9 | po: 10 | - [foaf:name, $(Name)] 11 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0002i/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | 9 | :map_student_000 rr:logicalTable :source_000 ; 10 | rdf:type rr:TriplesMap ; 11 | rdfs:label "student" ; 12 | rr:subjectMap :s_000 ; 13 | rr:predicateObjectMap :pom_000 . 14 | 15 | :source_000 rdf:type rr:LogicalTable ; 16 | rr:sqlQuery "SELECT \"ID\", \"Name\" FROM \"Student\"" ; 17 | rr:sqlVersion rr:SQL2008 . 18 | 19 | :s_000 rdf:type rr:SubjectMap ; 20 | rr:template "http://example.com/{ID}/{Name}" . 21 | 22 | :pom_000 rdf:type rr:PredicateObjectMap ; 23 | rr:predicateMap :pm_000 ; 24 | rr:objectMap :om_000 . 25 | 26 | :pm_000 rdf:type rr:PredicateMap ; 27 | rr:constant . 28 | 29 | :om_000 rdf:type rr:ObjectMap ; 30 | rr:column "Name" ; 31 | rr:termType rr:Literal . 32 | 33 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0002i/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | student: 3 | sources: 4 | - query: | 5 | SELECT "ID", 6 | "Name" 7 | FROM "Student" 8 | queryFormulation: sql2008 9 | s: http://example.com/$(ID)/$(Name) 10 | po: 11 | - [foaf:name, $(Name)] 12 | -------------------------------------------------------------------------------- /test/r2rml-test-cases/R2RMLTC0009a/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | student: 3 | sources: 4 | - table: Student 5 | s: http://example.com/resource/student_$(ID) 6 | po: 7 | - [foaf:name, $(Name)] 8 | - p: http://example.com/ontology/practises 9 | o: 10 | mapping: sport 11 | condition: 12 | function: equal 13 | parameters: 14 | - [str1, $(Sport)] 15 | - [str2, $(Name)] 16 | sport: 17 | sources: 18 | - table: Sport 19 | s: http://example.com/resource/sport_$(ID) 20 | po: 21 | - [rdfs:label, $(Name)] 22 | -------------------------------------------------------------------------------- /test/recursive-functions/data.csv: -------------------------------------------------------------------------------- 1 | id,name 2 | 0,Ben & Pieter 3 | -------------------------------------------------------------------------------- /test/recursive-functions/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | grel: http://users.ugent.be/~bjdmeest/function/grel.ttl# 4 | 5 | mappings: 6 | person: 7 | sources: 8 | - [data.csv~csv] 9 | s: http://example.com/$(id) 10 | po: 11 | - p: schema:name 12 | o: 13 | - function: grel:escape 14 | parameters: 15 | - parameter: grel:valueParameter 16 | value: 17 | function: grel:toUpperCase 18 | parameters: 19 | - [grel:valueParameter, $(name)] 20 | - [grel:modeParameter, html] 21 | -------------------------------------------------------------------------------- /test/rr_class/1-single/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix mail: . 9 | @prefix ex: . 10 | 11 | :source_000 rdf:type rr:LogicalTable ; 12 | rdfs:label "source1" . 13 | 14 | :map_example_000 rr:logicalTable :source_000 ; 15 | rdf:type rr:TriplesMap ; 16 | rdfs:label "example" ; 17 | rr:subjectMap :s_000 . 18 | 19 | :s_000 rdf:type rr:SubjectMap ; 20 | rr:template "http://www.example.com/note/{@id}" ; 21 | rr:class mail:Note . 22 | 23 | -------------------------------------------------------------------------------- /test/rr_class/1-single/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix mail: . 11 | @prefix ex: . 12 | 13 | :source_000 rdf:type rml:LogicalSource ; 14 | rdfs:label "source1" ; 15 | rml:source "src/test/resources/example1/example1.xml" ; 16 | rml:iterator "/notes/note" ; 17 | rml:referenceFormulation ql:XPath . 18 | 19 | :map_example_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "example" ; 22 | rr:subjectMap :s_000 . 23 | 24 | :s_000 rdf:type rr:SubjectMap ; 25 | rr:template "http://www.example.com/note/{@id}" ; 26 | rr:class mail:Note . 27 | 28 | -------------------------------------------------------------------------------- /test/rr_class/1-single/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | example: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [a, mail:Note~iri] 17 | -------------------------------------------------------------------------------- /test/rr_class/2-multiple/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix mail: . 9 | @prefix ex: . 10 | 11 | :source_000 rdf:type rr:LogicalTable ; 12 | rdfs:label "source1" . 13 | 14 | :map_example_000 rr:logicalTable :source_000 ; 15 | rdf:type rr:TriplesMap ; 16 | rdfs:label "example" ; 17 | rr:subjectMap :s_000 . 18 | 19 | :s_000 rdf:type rr:SubjectMap ; 20 | rr:template "http://www.example.com/note/{@id}" ; 21 | rr:class mail:Note, ex:Note . 22 | 23 | -------------------------------------------------------------------------------- /test/rr_class/2-multiple/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix mail: . 11 | @prefix ex: . 12 | 13 | :source_000 rdf:type rml:LogicalSource ; 14 | rdfs:label "source1" ; 15 | rml:source "src/test/resources/example1/example1.xml" ; 16 | rml:iterator "/notes/note" ; 17 | rml:referenceFormulation ql:XPath . 18 | 19 | :map_example_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "example" ; 22 | rr:subjectMap :s_000 . 23 | 24 | :s_000 rdf:type rr:SubjectMap ; 25 | rr:template "http://www.example.com/note/{@id}" ; 26 | rr:class mail:Note, ex:Note . 27 | 28 | -------------------------------------------------------------------------------- /test/rr_class/2-multiple/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | example: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [a, [mail:Note, ex:Note]] 17 | -------------------------------------------------------------------------------- /test/rr_class/3-no-iri/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix mail: . 9 | @prefix ex: . 10 | 11 | :source_000 rdf:type rr:LogicalTable ; 12 | rdfs:label "source1" . 13 | 14 | :map_example_000 rr:logicalTable :source_000 ; 15 | rdf:type rr:TriplesMap ; 16 | rdfs:label "example" ; 17 | rr:subjectMap :s_000 . 18 | 19 | :s_000 rdf:type rr:SubjectMap ; 20 | rr:template "http://www.example.com/note/{@id}" ; 21 | rr:class mail:Note . 22 | 23 | -------------------------------------------------------------------------------- /test/rr_class/3-no-iri/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix mail: . 11 | @prefix ex: . 12 | 13 | :source_000 rdf:type rml:LogicalSource ; 14 | rdfs:label "source1" ; 15 | rml:source "src/test/resources/example1/example1.xml" ; 16 | rml:iterator "/notes/note" ; 17 | rml:referenceFormulation ql:XPath . 18 | 19 | :map_example_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "example" ; 22 | rr:subjectMap :s_000 . 23 | 24 | :s_000 rdf:type rr:SubjectMap ; 25 | rr:template "http://www.example.com/note/{@id}" ; 26 | rr:class mail:Note . 27 | 28 | -------------------------------------------------------------------------------- /test/rr_class/3-no-iri/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | example: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [a, mail:Note] 17 | -------------------------------------------------------------------------------- /test/rr_class/4-rdf-type/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix mail: . 9 | @prefix ex: . 10 | 11 | :source_000 rdf:type rr:LogicalTable ; 12 | rdfs:label "source1" . 13 | 14 | :map_example_000 rr:logicalTable :source_000 ; 15 | rdf:type rr:TriplesMap ; 16 | rdfs:label "example" ; 17 | rr:subjectMap :s_000 . 18 | 19 | :s_000 rdf:type rr:SubjectMap ; 20 | rr:template "http://www.example.com/note/{@id}" ; 21 | rr:class mail:Note . 22 | 23 | -------------------------------------------------------------------------------- /test/rr_class/4-rdf-type/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix mail: . 11 | @prefix ex: . 12 | 13 | :source_000 rdf:type rml:LogicalSource ; 14 | rdfs:label "source1" ; 15 | rml:source "src/test/resources/example1/example1.xml" ; 16 | rml:iterator "/notes/note" ; 17 | rml:referenceFormulation ql:XPath . 18 | 19 | :map_example_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "example" ; 22 | rr:subjectMap :s_000 . 23 | 24 | :s_000 rdf:type rr:SubjectMap ; 25 | rr:template "http://www.example.com/note/{@id}" ; 26 | rr:class mail:Note . 27 | 28 | -------------------------------------------------------------------------------- /test/rr_class/4-rdf-type/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | example: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [rdf:type, mail:Note] 17 | -------------------------------------------------------------------------------- /test/rr_class/5-custom-rdf-prefix/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix mail: . 9 | @prefix ex: . 10 | @prefix myrdf: . 11 | 12 | :source_000 myrdf:type rr:LogicalTable ; 13 | rdfs:label "source1" . 14 | 15 | :map_example_000 rr:logicalTable :source_000 ; 16 | myrdf:type rr:TriplesMap ; 17 | rdfs:label "example" ; 18 | rr:subjectMap :s_000 . 19 | 20 | :s_000 myrdf:type rr:SubjectMap ; 21 | rr:template "http://www.example.com/note/{@id}" ; 22 | rr:class mail:Note . 23 | 24 | -------------------------------------------------------------------------------- /test/rr_class/5-custom-rdf-prefix/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix mail: . 11 | @prefix ex: . 12 | @prefix myrdf: . 13 | 14 | :source_000 myrdf:type rml:LogicalSource ; 15 | rdfs:label "source1" ; 16 | rml:source "src/test/resources/example1/example1.xml" ; 17 | rml:iterator "/notes/note" ; 18 | rml:referenceFormulation ql:XPath . 19 | 20 | :map_example_000 rml:logicalSource :source_000 ; 21 | myrdf:type rr:TriplesMap ; 22 | rdfs:label "example" ; 23 | rr:subjectMap :s_000 . 24 | 25 | :s_000 myrdf:type rr:SubjectMap ; 26 | rr:template "http://www.example.com/note/{@id}" ; 27 | rr:class mail:Note . 28 | 29 | -------------------------------------------------------------------------------- /test/rr_class/5-custom-rdf-prefix/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | myrdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#" 5 | 6 | sources: 7 | source1: 8 | access: src/test/resources/example1/example1.xml 9 | referenceFormulation: xpath #~xpath or xquery 10 | iterator: /notes/note 11 | 12 | mappings: 13 | example: 14 | sources: source1 15 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 16 | predicateobjects: 17 | - [myrdf:type, mail:Note] 18 | -------------------------------------------------------------------------------- /test/rr_class/6-multiple-rows/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix mail: . 9 | @prefix ex: . 10 | 11 | :source_000 rdf:type rr:LogicalTable ; 12 | rdfs:label "source1" . 13 | 14 | :map_example_000 rr:logicalTable :source_000 ; 15 | rdf:type rr:TriplesMap ; 16 | rdfs:label "example" ; 17 | rr:subjectMap :s_000 . 18 | 19 | :s_000 rdf:type rr:SubjectMap ; 20 | rr:template "http://www.example.com/note/{@id}" ; 21 | rr:class mail:Note, ex:Note . 22 | 23 | -------------------------------------------------------------------------------- /test/rr_class/6-multiple-rows/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix mail: . 11 | @prefix ex: . 12 | 13 | :source_000 rdf:type rml:LogicalSource ; 14 | rdfs:label "source1" ; 15 | rml:source "src/test/resources/example1/example1.xml" ; 16 | rml:iterator "/notes/note" ; 17 | rml:referenceFormulation ql:XPath . 18 | 19 | :map_example_000 rml:logicalSource :source_000 ; 20 | rdf:type rr:TriplesMap ; 21 | rdfs:label "example" ; 22 | rr:subjectMap :s_000 . 23 | 24 | :s_000 rdf:type rr:SubjectMap ; 25 | rr:template "http://www.example.com/note/{@id}" ; 26 | rr:class mail:Note, ex:Note . 27 | 28 | -------------------------------------------------------------------------------- /test/rr_class/6-multiple-rows/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | mail: "http://example.com/mail#" 3 | ex: "http://www.example.com/" 4 | 5 | sources: 6 | source1: 7 | access: src/test/resources/example1/example1.xml 8 | referenceFormulation: xpath #~xpath or xquery 9 | iterator: /notes/note 10 | 11 | mappings: 12 | example: 13 | sources: source1 14 | subjects: "http://www.example.com/note/$(@id)" #~iri (default, only option actually); if no subject is given, we are dealing with a blank node 15 | predicateobjects: 16 | - [a, mail:Note] 17 | - [a, ex:Note] 18 | -------------------------------------------------------------------------------- /test/rr_class/7-function/mapping.r2rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix : . 8 | @prefix ex: . 9 | 10 | :map_person_000 rr:logicalTable :source_000 ; 11 | rdf:type rr:TriplesMap ; 12 | rdfs:label "person" ; 13 | rr:subjectMap :s_000 ; 14 | rr:predicateObjectMap :pom_000 . 15 | 16 | :source_000 rdf:type rr:LogicalTable . 17 | 18 | :s_000 rdf:type rr:SubjectMap ; 19 | rr:column "o" . 20 | 21 | :pom_000 rdf:type rr:PredicateObjectMap ; 22 | rr:predicateMap :pm_000 ; 23 | rr:objectMap :om_000 . 24 | 25 | :pm_000 rdf:type rr:PredicateMap ; 26 | rr:constant rdf:type . 27 | 28 | :om_000 rdf:type fnml:FunctionTermMap ; 29 | rr:termType rr:IRI ; 30 | fnml:functionValue :fn_000 . 31 | 32 | :fn_000 rr:logicalTable :source_000 ; 33 | rr:predicateObjectMap :pomexec_000, :pom_001, :pom_002 . 34 | 35 | :pomexec_000 rr:predicateMap :pmexec_000 ; 36 | rr:objectMap :omexec_000 . 37 | 38 | :pmexec_000 rr:constant fno:executes . 39 | 40 | :omexec_000 rr:constant "http://example.com/doSomething" ; 41 | rr:termType rr:IRI . 42 | 43 | :pom_001 rdf:type rr:PredicateObjectMap ; 44 | rr:predicateMap :pm_001 ; 45 | rr:objectMap :om_001 . 46 | 47 | :pm_001 rdf:type rr:PredicateMap ; 48 | rr:constant ex:preferred . 49 | 50 | :om_001 rdf:type rr:ObjectMap ; 51 | rr:column "p" ; 52 | rr:termType rr:Literal . 53 | 54 | :pom_002 rdf:type rr:PredicateObjectMap ; 55 | rr:predicateMap :pm_002 ; 56 | rr:objectMap :om_002 . 57 | 58 | :pm_002 rdf:type rr:PredicateMap ; 59 | rr:constant ex:alternative . 60 | 61 | :om_002 rdf:type rr:ObjectMap ; 62 | rr:template "http://example.com/{a}" ; 63 | rr:termType rr:Literal . 64 | 65 | -------------------------------------------------------------------------------- /test/rr_class/7-function/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | @prefix ex: . 11 | 12 | :map_person_000 rml:logicalSource :source_000 ; 13 | rdf:type rr:TriplesMap ; 14 | rdfs:label "person" ; 15 | rr:subjectMap :s_000 ; 16 | rr:predicateObjectMap :pom_000 . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rml:source "data/test.csv" ; 20 | rml:referenceFormulation ql:CSV . 21 | 22 | :s_000 rdf:type rr:SubjectMap ; 23 | rml:reference "o" . 24 | 25 | :pom_000 rdf:type rr:PredicateObjectMap ; 26 | rr:predicateMap :pm_000 ; 27 | rr:objectMap :om_000 . 28 | 29 | :pm_000 rdf:type rr:PredicateMap ; 30 | rr:constant rdf:type . 31 | 32 | :om_000 rdf:type fnml:FunctionTermMap ; 33 | rr:termType rr:IRI ; 34 | fnml:functionValue :fn_000 . 35 | 36 | :fn_000 rml:logicalSource :source_000 ; 37 | rr:predicateObjectMap :pomexec_000, :pom_001, :pom_002 . 38 | 39 | :pomexec_000 rr:predicateMap :pmexec_000 ; 40 | rr:objectMap :omexec_000 . 41 | 42 | :pmexec_000 rr:constant fno:executes . 43 | 44 | :omexec_000 rr:constant "http://example.com/doSomething" ; 45 | rr:termType rr:IRI . 46 | 47 | :pom_001 rdf:type rr:PredicateObjectMap ; 48 | rr:predicateMap :pm_001 ; 49 | rr:objectMap :om_001 . 50 | 51 | :pm_001 rdf:type rr:PredicateMap ; 52 | rr:constant ex:preferred . 53 | 54 | :om_001 rdf:type rr:ObjectMap ; 55 | rml:reference "p" ; 56 | rr:termType rr:Literal . 57 | 58 | :pom_002 rdf:type rr:PredicateObjectMap ; 59 | rr:predicateMap :pm_002 ; 60 | rr:objectMap :om_002 . 61 | 62 | :pm_002 rdf:type rr:PredicateMap ; 63 | rr:constant ex:alternative . 64 | 65 | :om_002 rdf:type rr:ObjectMap ; 66 | rr:template "http://example.com/{a}" ; 67 | rr:termType rr:Literal . 68 | 69 | -------------------------------------------------------------------------------- /test/rr_class/7-function/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - [data/test.csv~csv] 8 | s: $(o) 9 | po: 10 | - p: a 11 | o: 12 | function: ex:doSomething 13 | parameters: 14 | - [ex:preferred, $(p)] 15 | - [ex:alternative, ex:$(a)] 16 | -------------------------------------------------------------------------------- /test/rr_class/8-reference/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | 4 | mappings: 5 | person: 6 | source: 7 | - [test.csv~csv] 8 | s: http://ex.org/$(id) 9 | po: 10 | - [a, ex:Person] 11 | book: 12 | source: 13 | - [test2.csv~csv] 14 | s: http://ex.org/book/$(id) 15 | po: 16 | - p: a 17 | o: 18 | mapping: person 19 | condition: 20 | function: equal 21 | parameters: 22 | - [str1, $(author), s] 23 | - parameter: str2 24 | value: 25 | function: ex:toLowerCase 26 | parameters: 27 | - [ex:input, $(name), o] 28 | -------------------------------------------------------------------------------- /test/spec/graphs-all-triples/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | smth: 'http://example.com/smth' 3 | ont: 'http://example.com/ont' 4 | 5 | mappings: 6 | ParentSmth: 7 | sources: 8 | - [text.csv~csv] 9 | graphs: smth:$(id) 10 | s: smth:$(id)#this 11 | po: 12 | - p: ont:isSmthOf 13 | o: 14 | - mapping: ChildSmth 15 | ChildSmth: 16 | sources: 17 | - [text.csv~csv] 18 | s: smth:$(id)child#this 19 | po: 20 | - [a, smth:child] -------------------------------------------------------------------------------- /test/spec/mapping-with-database-as-source/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix ql: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix rml: . 5 | @prefix rr: . 6 | @prefix d2rq: . 7 | 8 | @prefix : . 9 | 10 | :map_person_000 rml:logicalSource :source_000 ; 11 | rdf:type rr:TriplesMap ; 12 | rdfs:label "person" ; 13 | rr:subjectMap :s_000 . 14 | 15 | :source_000 rdf:type rml:LogicalSource ; 16 | rml:source :database_000 ; 17 | rml:query "SELECT DEPTNO, DNAME, LOC, (SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO=DEPT.DEPTNO) AS STAFF FROM DEPT;" ; 18 | rr:sqlVersion rr:SQL2008 ; 19 | rml:referenceFormulation ql:CSV . 20 | 21 | :database_000 rdf:type d2rq:Database ; 22 | d2rq:jdbcDSN "http://localhost/example" ; 23 | d2rq:jdbcDriver "com.mysql.cj.jdbc.Driver" ; 24 | d2rq:username "root" ; 25 | d2rq:password "root" . 26 | 27 | :s_000 rdf:type rr:SubjectMap ; 28 | rr:termType rr:BlankNode . 29 | -------------------------------------------------------------------------------- /test/spec/mapping-with-database-as-source/mapping.yarrr.yml: -------------------------------------------------------------------------------- 1 | mapping: 2 | person: 3 | sources: 4 | - access: http://localhost/example 5 | type: mysql 6 | credentials: 7 | username: root 8 | password: root 9 | queryFormulation: sql2008 10 | query: | 11 | SELECT DEPTNO, DNAME, LOC, 12 | (SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO=DEPT.DEPTNO) AS STAFF 13 | FROM DEPT; 14 | referenceFormulation: csv -------------------------------------------------------------------------------- /test/subjectmap-with-function/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.com/ 3 | 4 | mappings: 5 | person: 6 | sources: 7 | - [data/test.csv~csv] 8 | s: 9 | - function: ex:doSomething 10 | parameters: 11 | - [ex:preferred, $(p)] 12 | - [ex:alternative, ex:$(a)] 13 | po: 14 | - [a, ex:Person] 15 | -------------------------------------------------------------------------------- /test/subjectmap-with-reference/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix rml: . 7 | @prefix ql: . 8 | @prefix : . 9 | 10 | :map_test_0 rml:logicalSource :source_0 ; 11 | rdf:type rr:TriplesMap ; 12 | rdfs:label "test" ; 13 | rr:subjectMap :s_0 ; 14 | rr:predicateObjectMap :pom_0 . 15 | 16 | :source_0 rdf:type rml:LogicalSource ; 17 | rml:source "text.csv" ; 18 | rml:referenceFormulation ql:CSV . 19 | 20 | :s_0 rdf:type rr:SubjectMap ; 21 | rml:reference "id" . 22 | 23 | :pom_0 rdf:type rr:PredicateObjectMap ; 24 | rr:predicateMap :pm_0 ; 25 | rr:objectMap :om_0 . 26 | 27 | :pm_0 rdf:type rr:PredicateMap ; 28 | rr:constant rdf:type . 29 | 30 | :om_0 rdf:type rr:ObjectMap ; 31 | rr:constant "http://schema.org/Thing" ; 32 | rr:termType rr:IRI . 33 | 34 | -------------------------------------------------------------------------------- /test/subjectmap-with-reference/mapping.yml: -------------------------------------------------------------------------------- 1 | mappings: 2 | test: 3 | sources: 4 | - [text.csv~csv] 5 | s: $(id) 6 | po: 7 | - [a, schema:Thing] -------------------------------------------------------------------------------- /test/target-http-request/direct-with-auth-in-mapping/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | 7 | authentications: 8 | auth: 9 | type: cssclientcredentials 10 | email: electronics_user1@example.com 11 | password: electronics_user1 12 | oidcIssuer: https://css11/ 13 | webId: https://electronics_user1/profile/card#me 14 | 15 | mappings: 16 | person: 17 | sources: people-source 18 | subjects: 19 | - value: "http://example.org/$(id)" 20 | targets: 21 | - type: directhttprequest 22 | access: https://example.org/ 23 | methodName: PUT 24 | contentType: application/json+ld 25 | serialization: jsonld 26 | authentication: auth 27 | predicateobjects: 28 | - predicates: foaf:name 29 | objects: 30 | value: "$(name)" 31 | -------------------------------------------------------------------------------- /test/target-http-request/direct-with-auth/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | direct-http-target: 8 | type: directhttprequest 9 | access: https://example.org/ 10 | methodName: PUT 11 | contentType: application/json+ld 12 | serialization: jsonld 13 | authentication: auth 14 | authentications: 15 | auth: 16 | type: cssclientcredentials 17 | email: electronics_user1@example.com 18 | password: electronics_user1 19 | oidcIssuer: https://css11/ 20 | webId: https://electronics_user1/profile/card#me 21 | 22 | mappings: 23 | person: 24 | sources: people-source 25 | subjects: 26 | - value: "http://example.org/$(id)" 27 | targets: direct-http-target 28 | predicateobjects: 29 | - predicates: foaf:name 30 | objects: 31 | value: "$(name)" 32 | -------------------------------------------------------------------------------- /test/target-http-request/direct-without-auth/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix htv: . 16 | @prefix rmle: . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rdfs:label "people-source" ; 20 | rml:source "/data/people.json" ; 21 | rml:iterator "$.[*]" ; 22 | rml:referenceFormulation ql:JSONPath . 23 | 24 | :target_000 rdf:type rmlt:LogicalTarget ; 25 | rdfs:label "direct-http-target" ; 26 | rmlt:serialization formats:JSON-LD ; 27 | rmlt:target :directhttprequest_000 . 28 | 29 | :directhttprequest_000 rdf:type rmle:DirectHttpRequest ; 30 | htv:absoluteURI "https://example.org/" ; 31 | htv:methodName "PUT" ; 32 | rmle:contentTypeHeader "application/json+ld" . 33 | 34 | :map_person_000 rml:logicalSource :source_000 ; 35 | rdf:type rr:TriplesMap ; 36 | rdfs:label "person" ; 37 | rr:subjectMap :s_000 ; 38 | rr:predicateObjectMap :pom_000 . 39 | 40 | :s_000 rdf:type rr:SubjectMap ; 41 | rr:template "http://example.org/{id}" ; 42 | rml:logicalTarget :target_000 . 43 | 44 | :pom_000 rdf:type rr:PredicateObjectMap ; 45 | rr:predicateMap :pm_000 ; 46 | rr:objectMap :om_000 . 47 | 48 | :pm_000 rdf:type rr:PredicateMap ; 49 | rr:constant foaf:name . 50 | 51 | :om_000 rdf:type rr:ObjectMap ; 52 | rml:reference "name" ; 53 | rr:termType rr:Literal . 54 | -------------------------------------------------------------------------------- /test/target-http-request/direct-without-auth/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | direct-http-target: 8 | type: directhttprequest 9 | access: https://example.org/ 10 | methodName: PUT 11 | contentType: application/json+ld 12 | serialization: jsonld 13 | mappings: 14 | person: 15 | sources: people-source 16 | subjects: 17 | - value: "http://example.org/$(id)" 18 | targets: direct-http-target 19 | predicateobjects: 20 | - predicates: foaf:name 21 | objects: 22 | value: "$(name)" 23 | -------------------------------------------------------------------------------- /test/target-http-request/linked-with-auth/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | linked-http-target: 8 | type: linkedhttprequest 9 | access: https://example.org/ 10 | rel: acl 11 | serialization: turtle 12 | authentication: auth 13 | authentications: 14 | auth: 15 | type: cssclientcredentials 16 | email: electronics_user1@example.com 17 | password: electronics_user1 18 | oidcIssuer: https://css11/ 19 | webId: https://electronics_user1/profile/card#me 20 | mappings: 21 | person: 22 | sources: people-source 23 | subjects: 24 | - value: "http://example.org/$(id)" 25 | targets: linked-http-target 26 | predicateobjects: 27 | - predicates: foaf:name 28 | objects: 29 | value: "$(name)" 30 | -------------------------------------------------------------------------------- /test/target-http-request/linked-without-auth/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix htv: . 16 | @prefix rmle: . 17 | 18 | :source_000 rdf:type rml:LogicalSource ; 19 | rdfs:label "people-source" ; 20 | rml:source "/data/people.json" ; 21 | rml:iterator "$.[*]" ; 22 | rml:referenceFormulation ql:JSONPath . 23 | 24 | :target_000 rdf:type rmlt:LogicalTarget ; 25 | rdfs:label "linked-http-target" ; 26 | rmlt:serialization formats:Turtle ; 27 | rmlt:target :linkedhttprequest_000 . 28 | 29 | :linkedhttprequest_000 rdf:type rmle:LinkedHttpRequest ; 30 | rmle:linkingAbsoluteURI "https://example.org/" ; 31 | rmle:linkRelation "acl" . 32 | 33 | :map_person_000 rml:logicalSource :source_000 ; 34 | rdf:type rr:TriplesMap ; 35 | rdfs:label "person" ; 36 | rr:subjectMap :s_000 ; 37 | rr:predicateObjectMap :pom_000 . 38 | 39 | :s_000 rdf:type rr:SubjectMap ; 40 | rr:template "http://example.org/{id}" ; 41 | rml:logicalTarget :target_000 . 42 | 43 | :pom_000 rdf:type rr:PredicateObjectMap ; 44 | rr:predicateMap :pm_000 ; 45 | rr:objectMap :om_000 . 46 | 47 | :pm_000 rdf:type rr:PredicateMap ; 48 | rr:constant foaf:name . 49 | 50 | :om_000 rdf:type rr:ObjectMap ; 51 | rml:reference "name" ; 52 | rr:termType rr:Literal . 53 | 54 | -------------------------------------------------------------------------------- /test/target-http-request/linked-without-auth/mapping.yarrrml.yaml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | linked-http-target: 8 | type: linkedhttprequest 9 | access: https://example.org/ 10 | rel: acl 11 | serialization: turtle 12 | mappings: 13 | person: 14 | sources: people-source 15 | subjects: 16 | - value: "http://example.org/$(id)" 17 | targets: linked-http-target 18 | predicateobjects: 19 | - predicates: foaf:name 20 | objects: 21 | value: "$(name)" 22 | -------------------------------------------------------------------------------- /test/target-reference/graph/mapping-inline.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ns/ 3 | sources: 4 | people-source: 5 | access: "/data/people.json" 6 | referenceFormulation: jsonpath 7 | iterator: "$.[*]" 8 | mappings: 9 | person: 10 | sources: people-source 11 | graphs: 12 | - value: ex:Graph 13 | targets: 14 | - ["/data/file.rdf~dcat", "rdfxml"] 15 | subjects: "http://example.org/$(id)" 16 | predicateobjects: 17 | - predicates: foaf:name 18 | objects: "$(name)" 19 | - predicates: foaf:age 20 | objects: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-reference/graph/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: http://example.org/ns/ 3 | sources: 4 | people-source: 5 | access: "/data/people.json" 6 | referenceFormulation: jsonpath 7 | iterator: "$.[*]" 8 | targets: 9 | graph-target: ["/data/file.rdf~dcat", "rdfxml"] 10 | mappings: 11 | person: 12 | sources: people-source 13 | graphs: 14 | - value: ex:Graph 15 | targets: graph-target 16 | subjects: "http://example.org/$(id)" 17 | predicateobjects: 18 | - predicates: foaf:name 19 | objects: "$(name)" 20 | - predicates: foaf:age 21 | objects: "$(age)" 22 | -------------------------------------------------------------------------------- /test/target-reference/language/mapping-inline.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | mappings: 7 | person: 8 | sources: people-source 9 | subjects: "http://example.org/$(id)" 10 | predicateobjects: 11 | - predicates: foaf:name 12 | objects: 13 | - value: "$(name)" 14 | language: 15 | value: en 16 | targets: 17 | - ["/data/file.jsonld.tar.xz~void", "jsonld", "tarxz"] 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-reference/language/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | predicate-target: ["/data/file.ttl.zip~dcat", "turtle", "zip"] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: "http://example.org/$(id)" 12 | predicateobjects: 13 | - predicates: foaf:name 14 | objects: 15 | - value: "$(name)" 16 | language: 17 | value: en 18 | targets: predicate-target 19 | - predicates: foaf:age 20 | objects: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-reference/object/mapping-inline.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | mappings: 7 | person: 8 | sources: people-source 9 | subjects: "http://example.org/$(id)" 10 | predicateobjects: 11 | - predicates: foaf:name 12 | objects: 13 | - value: "$(name)" 14 | targets: 15 | - ["/data/file.jsonld.tar.xz~void", "jsonld", "tarxz"] 16 | - predicates: foaf:age 17 | objects: 18 | value: "$(age)" 19 | -------------------------------------------------------------------------------- /test/target-reference/object/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | predicate-target: ["/data/file.ttl.zip~dcat", "turtle", "zip"] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: "http://example.org/$(id)" 12 | predicateobjects: 13 | - predicates: foaf:name 14 | objects: 15 | - value: "$(name)" 16 | targets: predicate-target 17 | - predicates: foaf:age 18 | objects: "$(age)" 19 | -------------------------------------------------------------------------------- /test/target-reference/predicate/mapping-inline.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | mappings: 7 | person: 8 | sources: people-source 9 | subjects: "http://example.org/$(id)" 10 | predicateobjects: 11 | - predicates: 12 | - value: foaf:name 13 | targets: 14 | - ["/data/file.nt.gz~void", "ntriples", "gzip"] 15 | objects: 16 | value: "$(name)" 17 | - predicates: foaf:age 18 | objects: 19 | value: "$(age)" 20 | -------------------------------------------------------------------------------- /test/target-reference/predicate/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | predicate-target: ["/data/file.ttl.zip~dcat", "turtle", "zip"] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: "http://example.org/$(id)" 12 | predicateobjects: 13 | - predicates: 14 | - value: foaf:name 15 | targets: predicate-target 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-reference/subject/mapping-inline.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | mappings: 7 | person: 8 | sources: people-source 9 | subjects: 10 | - value: "http://example.org/$(id)" 11 | targets: 12 | - ["/data/file.nt.gz~void", "ntriples", "gzip"] 13 | predicateobjects: 14 | - predicates: foaf:name 15 | objects: 16 | value: "$(name)" 17 | - predicates: foaf:age 18 | objects: 19 | value: "$(age)" 20 | -------------------------------------------------------------------------------- /test/target-reference/subject/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix comp: . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rdfs:label "people-source" ; 19 | rml:source "/data/people.json" ; 20 | rml:iterator "$.[*]" ; 21 | rml:referenceFormulation ql:JSONPath . 22 | 23 | :target_000 rdf:type rmlt:LogicalTarget ; 24 | rdfs:label "subject-target" ; 25 | rmlt:serialization formats:N-Triples ; 26 | rmlt:compression comp:gzip ; 27 | rmlt:target :void_000 . 28 | 29 | :void_000 rdf:type void:Dataset ; 30 | void:dataDump . 31 | 32 | :map_person_000 rml:logicalSource :source_000 ; 33 | rdf:type rr:TriplesMap ; 34 | rdfs:label "person" ; 35 | rr:subjectMap :s_000 ; 36 | rr:predicateObjectMap :pom_000, :pom_001 . 37 | 38 | :s_000 rdf:type rr:SubjectMap ; 39 | rr:template "http://example.org/{id}" ; 40 | rml:logicalTarget :target_000 . 41 | 42 | :pom_000 rdf:type rr:PredicateObjectMap ; 43 | rr:predicateMap :pm_000 ; 44 | rr:objectMap :om_000 . 45 | 46 | :pm_000 rdf:type rr:PredicateMap ; 47 | rr:constant foaf:name . 48 | 49 | :om_000 rdf:type rr:ObjectMap ; 50 | rml:reference "name" ; 51 | rr:termType rr:Literal . 52 | 53 | :pom_001 rdf:type rr:PredicateObjectMap ; 54 | rr:predicateMap :pm_001 ; 55 | rr:objectMap :om_001 . 56 | 57 | :pm_001 rdf:type rr:PredicateMap ; 58 | rr:constant foaf:age . 59 | 60 | :om_001 rdf:type rr:ObjectMap ; 61 | rml:reference "age" ; 62 | rr:termType rr:Literal . 63 | 64 | -------------------------------------------------------------------------------- /test/target-reference/subject/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: ["/data/file.nt.gz~void", "ntriples", "gzip"] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: 12 | - value: "http://example.org/$(id)" 13 | targets: subject-target 14 | predicateobjects: 15 | - predicates: foaf:name 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-single/dcat/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: 8 | access: "/data/file.nt" 9 | type: dcat 10 | serialization: ntriples 11 | compression: gzip 12 | mappings: 13 | person: 14 | sources: people-source 15 | subjects: 16 | value: "http://example.org/$(id)" 17 | targets: subject-target 18 | predicateobjects: 19 | - predicates: foaf:name 20 | objects: 21 | value: "$(name)" 22 | - predicates: foaf:age 23 | objects: 24 | value: "$(age)" 25 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping-shortcut1.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | 16 | :source_000 rdf:type rml:LogicalSource ; 17 | rdfs:label "people-source" ; 18 | rml:source "/data/people.json" ; 19 | rml:iterator "$.[*]" ; 20 | rml:referenceFormulation ql:JSONPath . 21 | 22 | :target_000 rdf:type rmlt:LogicalTarget ; 23 | rdfs:label "subject-target" ; 24 | rmlt:serialization formats:N-Quads ; 25 | rmlt:target :void_000 . 26 | 27 | :void_000 rdf:type void:Dataset ; 28 | void:dataDump . 29 | 30 | :map_person_000 rml:logicalSource :source_000 ; 31 | rdf:type rr:TriplesMap ; 32 | rdfs:label "person" ; 33 | rr:subjectMap :s_000 ; 34 | rr:predicateObjectMap :pom_000, :pom_001 . 35 | 36 | :s_000 rdf:type rr:SubjectMap ; 37 | rr:template "http://example.org/{id}" ; 38 | rml:logicalTarget :target_000 . 39 | 40 | :pom_000 rdf:type rr:PredicateObjectMap ; 41 | rr:predicateMap :pm_000 ; 42 | rr:objectMap :om_000 . 43 | 44 | :pm_000 rdf:type rr:PredicateMap ; 45 | rr:constant foaf:name . 46 | 47 | :om_000 rdf:type rr:ObjectMap ; 48 | rml:reference "name" ; 49 | rr:termType rr:Literal . 50 | 51 | :pom_001 rdf:type rr:PredicateObjectMap ; 52 | rr:predicateMap :pm_001 ; 53 | rr:objectMap :om_001 . 54 | 55 | :pm_001 rdf:type rr:PredicateMap ; 56 | rr:constant foaf:age . 57 | 58 | :om_001 rdf:type rr:ObjectMap ; 59 | rml:reference "age" ; 60 | rr:termType rr:Literal . 61 | 62 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping-shortcut1.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: "/data/file.nq" 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: 12 | value: "http://example.org/$(id)" 13 | targets: subject-target 14 | predicateobjects: 15 | - predicates: foaf:name 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping-shortcut2.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix dcat: . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rdfs:label "people-source" ; 19 | rml:source "/data/people.json" ; 20 | rml:iterator "$.[*]" ; 21 | rml:referenceFormulation ql:JSONPath . 22 | 23 | :target_000 rdf:type rmlt:LogicalTarget ; 24 | rdfs:label "subject-target" ; 25 | rmlt:serialization formats:JSON-LD ; 26 | rmlt:target :dcat_000 . 27 | 28 | :dcat_000 rdf:type dcat:Dataset ; 29 | dcat:dataDump . 30 | 31 | :map_person_000 rml:logicalSource :source_000 ; 32 | rdf:type rr:TriplesMap ; 33 | rdfs:label "person" ; 34 | rr:subjectMap :s_000 ; 35 | rr:predicateObjectMap :pom_000, :pom_001 . 36 | 37 | :s_000 rdf:type rr:SubjectMap ; 38 | rr:template "http://example.org/{id}" ; 39 | rml:logicalTarget :target_000 . 40 | 41 | :pom_000 rdf:type rr:PredicateObjectMap ; 42 | rr:predicateMap :pm_000 ; 43 | rr:objectMap :om_000 . 44 | 45 | :pm_000 rdf:type rr:PredicateMap ; 46 | rr:constant foaf:name . 47 | 48 | :om_000 rdf:type rr:ObjectMap ; 49 | rml:reference "name" ; 50 | rr:termType rr:Literal . 51 | 52 | :pom_001 rdf:type rr:PredicateObjectMap ; 53 | rr:predicateMap :pm_001 ; 54 | rr:objectMap :om_001 . 55 | 56 | :pm_001 rdf:type rr:PredicateMap ; 57 | rr:constant foaf:age . 58 | 59 | :om_001 rdf:type rr:ObjectMap ; 60 | rml:reference "age" ; 61 | rr:termType rr:Literal . 62 | 63 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping-shortcut2.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: ["/data/file.jsonld~dcat", "jsonld" ] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: 12 | value: "http://example.org/$(id)" 13 | targets: subject-target 14 | predicateobjects: 15 | - predicates: foaf:name 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping-shortcut3.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix dcat: . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rdfs:label "people-source" ; 19 | rml:source "/data/people.json" ; 20 | rml:iterator "$.[*]" ; 21 | rml:referenceFormulation ql:JSONPath . 22 | 23 | :target_000 rdf:type rmlt:LogicalTarget ; 24 | rdfs:label "subject-target" ; 25 | rmlt:serialization formats:N-Quads ; 26 | rmlt:target :dcat_000 . 27 | 28 | :dcat_000 rdf:type dcat:Dataset ; 29 | dcat:dataDump . 30 | 31 | :map_person_000 rml:logicalSource :source_000 ; 32 | rdf:type rr:TriplesMap ; 33 | rdfs:label "person" ; 34 | rr:subjectMap :s_000 ; 35 | rr:predicateObjectMap :pom_000, :pom_001 . 36 | 37 | :s_000 rdf:type rr:SubjectMap ; 38 | rr:template "http://example.org/{id}" ; 39 | rml:logicalTarget :target_000 . 40 | 41 | :pom_000 rdf:type rr:PredicateObjectMap ; 42 | rr:predicateMap :pm_000 ; 43 | rr:objectMap :om_000 . 44 | 45 | :pm_000 rdf:type rr:PredicateMap ; 46 | rr:constant foaf:name . 47 | 48 | :om_000 rdf:type rr:ObjectMap ; 49 | rml:reference "name" ; 50 | rr:termType rr:Literal . 51 | 52 | :pom_001 rdf:type rr:PredicateObjectMap ; 53 | rr:predicateMap :pm_001 ; 54 | rr:objectMap :om_001 . 55 | 56 | :pm_001 rdf:type rr:PredicateMap ; 57 | rr:constant foaf:age . 58 | 59 | :om_001 rdf:type rr:ObjectMap ; 60 | rml:reference "age" ; 61 | rr:termType rr:Literal . 62 | 63 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping-shortcut3.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: ["/data/file.nq~dcat"] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: 12 | value: "http://example.org/$(id)" 13 | targets: subject-target 14 | predicateobjects: 15 | - predicates: foaf:name 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix comp: . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rdfs:label "people-source" ; 19 | rml:source "/data/people.json" ; 20 | rml:iterator "$.[*]" ; 21 | rml:referenceFormulation ql:JSONPath . 22 | 23 | :target_000 rdf:type rmlt:LogicalTarget ; 24 | rdfs:label "subject-target" ; 25 | rmlt:serialization formats:N-Triples ; 26 | rmlt:compression comp:gzip ; 27 | rmlt:target :void_000 . 28 | 29 | :void_000 rdf:type void:Dataset ; 30 | void:dataDump . 31 | 32 | :map_person_000 rml:logicalSource :source_000 ; 33 | rdf:type rr:TriplesMap ; 34 | rdfs:label "person" ; 35 | rr:subjectMap :s_000 ; 36 | rr:predicateObjectMap :pom_000, :pom_001 . 37 | 38 | :s_000 rdf:type rr:SubjectMap ; 39 | rr:template "http://example.org/{id}" ; 40 | rml:logicalTarget :target_000 . 41 | 42 | :pom_000 rdf:type rr:PredicateObjectMap ; 43 | rr:predicateMap :pm_000 ; 44 | rr:objectMap :om_000 . 45 | 46 | :pm_000 rdf:type rr:PredicateMap ; 47 | rr:constant foaf:name . 48 | 49 | :om_000 rdf:type rr:ObjectMap ; 50 | rml:reference "name" ; 51 | rr:termType rr:Literal . 52 | 53 | :pom_001 rdf:type rr:PredicateObjectMap ; 54 | rr:predicateMap :pm_001 ; 55 | rr:objectMap :om_001 . 56 | 57 | :pm_001 rdf:type rr:PredicateMap ; 58 | rr:constant foaf:age . 59 | 60 | :om_001 rdf:type rr:ObjectMap ; 61 | rml:reference "age" ; 62 | rr:termType rr:Literal . 63 | 64 | -------------------------------------------------------------------------------- /test/target-single/local-file/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: ["/data/file.nt.gz~void", "ntriples", "gzip"] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: 12 | - value: "http://example.org/$(id)" 13 | targets: subject-target 14 | predicateobjects: 15 | - predicates: foaf:name 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-single/sparql-update/mapping-shortcut.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: ["http://example.com/sparql~sd"] 8 | mappings: 9 | person: 10 | sources: people-source 11 | subjects: 12 | value: "http://example.org/$(id)" 13 | targets: subject-target 14 | predicateobjects: 15 | - predicates: foaf:name 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | -------------------------------------------------------------------------------- /test/target-single/sparql-update/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix sd: . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rdfs:label "people-source" ; 19 | rml:source "/data/people.json" ; 20 | rml:iterator "$.[*]" ; 21 | rml:referenceFormulation ql:JSONPath . 22 | 23 | :target_000 rdf:type rmlt:LogicalTarget ; 24 | rdfs:label "subject-target" ; 25 | rmlt:serialization formats:N-Quads ; 26 | rmlt:target :sd_000 . 27 | 28 | :sd_000 rdf:type sd:Service ; 29 | sd:supportedLanguage sd:SPARQL11Update ; 30 | sd:endpoint . 31 | 32 | :map_person_000 rml:logicalSource :source_000 ; 33 | rdf:type rr:TriplesMap ; 34 | rdfs:label "person" ; 35 | rr:subjectMap :s_000 ; 36 | rr:predicateObjectMap :pom_000, :pom_001 . 37 | 38 | :s_000 rdf:type rr:SubjectMap ; 39 | rr:template "http://example.org/{id}" ; 40 | rml:logicalTarget :target_000 . 41 | 42 | :pom_000 rdf:type rr:PredicateObjectMap ; 43 | rr:predicateMap :pm_000 ; 44 | rr:objectMap :om_000 . 45 | 46 | :pm_000 rdf:type rr:PredicateMap ; 47 | rr:constant foaf:name . 48 | 49 | :om_000 rdf:type rr:ObjectMap ; 50 | rml:reference "name" ; 51 | rr:termType rr:Literal . 52 | 53 | :pom_001 rdf:type rr:PredicateObjectMap ; 54 | rr:predicateMap :pm_001 ; 55 | rr:objectMap :om_001 . 56 | 57 | :pm_001 rdf:type rr:PredicateMap ; 58 | rr:constant foaf:age . 59 | 60 | :om_001 rdf:type rr:ObjectMap ; 61 | rml:reference "age" ; 62 | rr:termType rr:Literal . 63 | 64 | -------------------------------------------------------------------------------- /test/target-single/sparql-update/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: 8 | access: "http://example.com/sparql" 9 | type: sd 10 | mappings: 11 | person: 12 | sources: people-source 13 | subjects: 14 | value: "http://example.org/$(id)" 15 | targets: subject-target 16 | predicateobjects: 17 | - predicates: foaf:name 18 | objects: 19 | value: "$(name)" 20 | - predicates: foaf:age 21 | objects: 22 | value: "$(age)" 23 | -------------------------------------------------------------------------------- /test/target-single/void/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | @prefix rmlt: . 14 | @prefix formats: . 15 | @prefix comp: . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rdfs:label "people-source" ; 19 | rml:source "/data/people.json" ; 20 | rml:iterator "$.[*]" ; 21 | rml:referenceFormulation ql:JSONPath . 22 | 23 | :target_000 rdf:type rmlt:LogicalTarget ; 24 | rdfs:label "subject-target" ; 25 | rmlt:serialization formats:N-Triples ; 26 | rmlt:compression comp:gzip ; 27 | rmlt:target :void_000 . 28 | 29 | :void_000 rdf:type void:Dataset ; 30 | void:dataDump . 31 | 32 | :map_person_000 rml:logicalSource :source_000 ; 33 | rdf:type rr:TriplesMap ; 34 | rdfs:label "person" ; 35 | rr:subjectMap :s_000 ; 36 | rr:predicateObjectMap :pom_000, :pom_001 . 37 | 38 | :s_000 rdf:type rr:SubjectMap ; 39 | rr:template "http://example.org/{id}" ; 40 | rml:logicalTarget :target_000 . 41 | 42 | :pom_000 rdf:type rr:PredicateObjectMap ; 43 | rr:predicateMap :pm_000 ; 44 | rr:objectMap :om_000 . 45 | 46 | :pm_000 rdf:type rr:PredicateMap ; 47 | rr:constant foaf:name . 48 | 49 | :om_000 rdf:type rr:ObjectMap ; 50 | rml:reference "name" ; 51 | rr:termType rr:Literal . 52 | 53 | :pom_001 rdf:type rr:PredicateObjectMap ; 54 | rr:predicateMap :pm_001 ; 55 | rr:objectMap :om_001 . 56 | 57 | :pm_001 rdf:type rr:PredicateMap ; 58 | rr:constant foaf:age . 59 | 60 | :om_001 rdf:type rr:ObjectMap ; 61 | rml:reference "age" ; 62 | rr:termType rr:Literal . 63 | 64 | -------------------------------------------------------------------------------- /test/target-single/void/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "/data/people.json" 4 | referenceFormulation: jsonpath 5 | iterator: "$.[*]" 6 | targets: 7 | subject-target: 8 | access: "/data/file.nt" 9 | type: void 10 | serialization: ntriples 11 | compression: gzip 12 | mappings: 13 | person: 14 | sources: people-source 15 | subjects: 16 | value: "http://example.org/$(id)" 17 | targets: subject-target 18 | predicateobjects: 19 | - predicates: foaf:name 20 | objects: 21 | value: "$(name)" 22 | - predicates: foaf:age 23 | objects: 24 | value: "$(age)" 25 | -------------------------------------------------------------------------------- /test/target-supergirl/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | supergirl-source: 3 | access: "/data/Supergirl.xml" 4 | referenceFormulation: xpath 5 | iterator: "/Supergirl" 6 | targets: 7 | target1: ["/data/dump1.nt~dcat", "ntriples"] 8 | target2: ["/data/dump2.ttl~void", "turtle"] 9 | mappings: 10 | person: 11 | sources: supergirl-source 12 | subjects: 13 | - value: "http://example.org/$(./Character/@id)" 14 | targets: target1 15 | predicateobjects: 16 | - predicates: 17 | - value: foaf:name 18 | targets: target2 19 | objects: "$(./Character/name)" 20 | - predicates: foaf:nickname 21 | objects: "$(./Character/nickname)" 22 | -------------------------------------------------------------------------------- /test/template-2-references/mapping.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix rml: . 8 | @prefix ql: . 9 | @prefix : . 10 | 11 | :map_person_000 rml:logicalSource :source_000 ; 12 | rdf:type rr:TriplesMap ; 13 | rdfs:label "person" ; 14 | rr:subjectMap :s_000 ; 15 | rr:predicateObjectMap :pom_000 . 16 | 17 | :source_000 rdf:type rml:LogicalSource ; 18 | rml:source "test.csv" ; 19 | rml:referenceFormulation ql:CSV . 20 | 21 | :s_000 rdf:type rr:SubjectMap ; 22 | rr:template "http://example.com/{id}_{name}" . 23 | 24 | :pom_000 rdf:type rr:PredicateObjectMap ; 25 | rr:predicateMap :pm_000 ; 26 | rr:objectMap :om_000 . 27 | 28 | :pm_000 rdf:type rr:PredicateMap ; 29 | rr:constant rdf:type . 30 | 31 | :om_000 rdf:type rr:ObjectMap ; 32 | rr:constant "http://schema.org/Person" ; 33 | rr:termType rr:IRI . 34 | 35 | -------------------------------------------------------------------------------- /test/template-2-references/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | mappings: 2 | person: 3 | sources: 4 | - [test.csv~csv] 5 | s: http://example.com/$(id)_$(name) 6 | po: 7 | - [a, schema:Person] 8 | -------------------------------------------------------------------------------- /test/template-escape/mapping.yml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | ex: "http://example.com/" 3 | as: "https://www.w3.org/ns/activitystreams#" 4 | xapi: "http://adlnet.gov/expapi/verbs/" 5 | fnstr: "http://example.com/idlab/functions/string/" 6 | 7 | mappings: 8 | statement: 9 | sources: 10 | - ['./data.json~jsonpath', '$[*]'] 11 | s: http://example.com/$(_id.$oid) 12 | po: 13 | - predicate: ex:success 14 | object: 15 | - function: fnstr:map 16 | parameters: 17 | - [fnstr:valueParameter, "$(statement.object.definition.type)"] 18 | - [fnstr:mappingParameter, '{"http://sensotec.be/Alinea/corrections": "0","http://sensotec.be/Alinea/suggestions": "0.5","http://sensotec.be/Alinea/typing/word": "1"}'] 19 | -------------------------------------------------------------------------------- /test/trivial/null.rml.ttl: -------------------------------------------------------------------------------- 1 | @prefix rr: . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix fnml: . 5 | @prefix fno: . 6 | @prefix d2rq: . 7 | @prefix void: . 8 | @prefix dc: . 9 | @prefix foaf: . 10 | @prefix rml: . 11 | @prefix ql: . 12 | @prefix : . 13 | -------------------------------------------------------------------------------- /test/trivial/null.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RMLio/yarrrml-parser/2d167442baaa1fde492f6da34af53d7f4f88b909/test/trivial/null.yml -------------------------------------------------------------------------------- /test/wot-apisecurityscheme/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "http://example.org/file.xml" 4 | contentType: "application/xml" 5 | operationType: read 6 | type: wot 7 | referenceFormulation: xpath 8 | iterator: "/" 9 | security: 10 | - type: apikey 11 | in: "header" 12 | name: "apikey" 13 | value: "123456789" 14 | mappings: 15 | person: 16 | sources: people-source 17 | subjects: 18 | value: "http://example.org/$(id)" 19 | predicateobjects: 20 | - predicates: foaf:name 21 | objects: 22 | value: "$(name)" 23 | - predicates: foaf:age 24 | objects: 25 | value: "$(age)" 26 | -------------------------------------------------------------------------------- /test/wot-irail/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | prefixes: 2 | geo: http://www.w3.org/2003/01/geo/wgs84_pos# 3 | gtfs: http://vocab.gtfs.org/terms# 4 | sources: 5 | irail-source: 6 | access: "http://api.irail.be/stations?format=json" 7 | contentType: "application/json" 8 | operationType: read 9 | type: wot 10 | referenceFormulation: jsonpath 11 | iterator: "$.station.[*]" 12 | security: none 13 | mappings: 14 | station: 15 | sources: irail-source 16 | subjects: "http://example.org/station/$(id)" 17 | predicateobjects: 18 | - predicates: a 19 | objects: gtfs:Station; 20 | - predicates: schema:name 21 | objects: "$(name)" 22 | - predicates: geo:longitude 23 | objects: "$(locationX)" 24 | - predicates: geo:latitude 25 | objects: "$(locationY)" 26 | -------------------------------------------------------------------------------- /test/wot-nosecurityscheme/mapping-shortcut.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "http://example.org/file.xml" 4 | contentType: "application/xml" 5 | operationType: read 6 | type: wot 7 | referenceFormulation: xpath 8 | iterator: "/" 9 | security: none 10 | mappings: 11 | person: 12 | sources: people-source 13 | subjects: 14 | value: "http://example.org/$(id)" 15 | predicateobjects: 16 | - predicates: foaf:name 17 | objects: 18 | value: "$(name)" 19 | - predicates: foaf:age 20 | objects: 21 | value: "$(age)" 22 | -------------------------------------------------------------------------------- /test/wot-nosecurityscheme/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "http://example.org/file.xml" 4 | contentType: "application/xml" 5 | operationType: read 6 | type: wot 7 | referenceFormulation: xpath 8 | iterator: "/" 9 | security: 10 | - type: none 11 | mappings: 12 | person: 13 | sources: people-source 14 | subjects: 15 | value: "http://example.org/$(id)" 16 | predicateobjects: 17 | - predicates: foaf:name 18 | objects: 19 | value: "$(name)" 20 | - predicates: foaf:age 21 | objects: 22 | value: "$(age)" 23 | -------------------------------------------------------------------------------- /test/wot-without-security/mapping.yarrrml: -------------------------------------------------------------------------------- 1 | sources: 2 | people-source: 3 | access: "http://example.org/file.xml" 4 | contentType: "application/xml" 5 | operationType: read 6 | type: wot 7 | referenceFormulation: xpath 8 | iterator: "/" 9 | mappings: 10 | person: 11 | sources: people-source 12 | subjects: 13 | value: "http://example.org/$(id)" 14 | predicateobjects: 15 | - predicates: foaf:name 16 | objects: 17 | value: "$(name)" 18 | - predicates: foaf:age 19 | objects: 20 | value: "$(age)" 21 | --------------------------------------------------------------------------------