diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+node_modules
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ba80789..200e40b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased
+## [1.2.0] - 2020-08-17
+
+### Added
+- rr:class flag (see [issue 73](https://github.com/RMLio/yarrrml-parser/issues/73))
+- Allow multiple input files for the CLI (see [issue 34](https://github.com/RMLio/yarrrml-parser/issues/34))
+- reference formulation for CSS (see [issue 37](https://github.com/RMLio/yarrrml-parser/issues/37))
+- Allow multiple input files for the CLI (see [issue 34](https://github.com/RMLio/yarrrml-parser/issues/34))
+- Overwrite references (see [issue 35](https://github.com/RMLio/yarrrml-parser/issues/35))
+- Support authors (see [issue 87](https://github.com/RMLio/yarrrml-parser/issues/87))
+
+### Fixed
+- Condition on mapping when subject has function fails (see [issue 75](https://github.com/RMLio/yarrrml-parser/issues/75))
+- Create blank node as object (see [issue 59](https://github.com/RMLio/yarrrml-parser/issues/59))
+- Condition on mapping with blank node as subject gives error (see [issue 31](https://github.com/RMLio/yarrrml-parser/issues/31))
+
+### Changed
+- Pad suffixes to keep ordering (see [issue 78](https://github.com/RMLio/yarrrml-parser/issues/78))
+
## [1.1.1] - 2020-05-11
### Fixed
@@ -160,6 +178,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- fix failing test
- support for recursive functions
+[1.2.0]: https://github.com/RMLio/yarrrml-parser/compare/v1.1.1...v1.2.0
[1.1.1]: https://github.com/RMLio/yarrrml-parser/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/RMLio/yarrrml-parser/compare/v1.0.2...v1.1.0
[1.0.2]: https://github.com/RMLio/yarrrml-parser/compare/v1.0.1...v1.0.2
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1bb0476
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,10 @@
+FROM node:12-alpine
+
+WORKDIR /app
+
+ADD . .
+
+RUN npm install -g .
+
+ENTRYPOINT ["yarrrml-parser"]
+CMD ["-h"]
diff --git a/README.md b/README.md
index dcd9b8c..5c2eea8 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,23 @@ If you want to generate RML rules from a YARRRML document,
you do the following: `yarrrml-parser -i rules.yml`.
The rules will be written to standard output.
If you want to write them to a file, you can add the `-o` option.
-By default RML rules are generated,
-if you want to generate R2RML rules add `-f R2RML`.
+By default, the parser generates RML rules.
+If you want to generate R2RML rules add `-f R2RML`.
+If you want to use `rr:class` instead of Predicate Object Maps, use the `-c` flag.
+You can use multiple input files too: `yarrrml-parser -i rules-1.yml -i rules-2.yml`.
+They are converted to a single RML document.
+Note that the keys in `prefixes`, `sources`, and `mappings` have to be unique across all files.
+`base` can only be set once.
+You find an [`test/multiple-input-files`](test/multiple-input-files).
+You can overwrite external references via the `-e`.
+An external reference starts with `_`.
+For example, `-e name=John` will replace all occurrences of `$(_name)` with `John`.
+Repeat `-e` for multiple references.
+When you do not provide a value for an external reference,
+the reference will not be replaced.
+You find an example in [`test/template-escape`](test/template-escape).
+If you want to use for example `$(_name)` as both an external reference and a normal reference,
+then you add a `\` for the latter resulting in `$(\_name)` for the latter.
#### yarrrml-generator
@@ -32,7 +47,7 @@ If you want to write them to a file, you can add the `-o` option.
`npm i --save @rmlio/yarrrml-parser`
-```
+```javascript
let yarrrml = require('@rmlio/yarrrml-parser/lib/rml-generator');
const yaml = "[yarrrml string]";
@@ -49,5 +64,20 @@ const triples = y2r.convert(yaml);
- Make the [CLI](#cli) (based on the code in the cloned repo)
available system-wide via `npm link` (optional).
+## Docker
+
+Run (from [DockerHub](https://hub.docker.com/repository/docker/rmlio/yarrrml-parser)):
+
+```bash
+docker run --rm -it -v $(pwd)/resources:/data rmlio/yarrrml-parser:latest -i /data/test.yarrr.yml
+```
+
+Build from source:
+
+```bash
+docker build -t umids/yarrrml-parser .
+```
+
## License
+
This code is copyrighted by [Ghent University – imec](http://idlab.ugent.be/) and released under the [MIT license](http://opensource.org/licenses/MIT).
diff --git a/action.yml b/action.yml
new file mode 100644
index 0000000..ab0544a
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,32 @@
+# GitHub Actions to run the RML Mapper
+name: 'YARRRML Parser'
+description: 'Convert YARRRML rules to RML rules using the YARRRML Parser.'
+branding:
+ icon: 'edit-3'
+ color: 'blue'
+inputs:
+ input:
+ description: 'Input YARRRML file to convert to RML'
+ required: true
+ default: 'input.yarrr.yml'
+ output:
+ description: 'Path to output file'
+ required: true
+ default: 'output.rml.ttl'
+ format:
+ description: 'RML or R2RML (default: RML)'
+ required: false
+ default: 'RML'
+outputs:
+ rml_output:
+ description: 'RML rules generated from the YARRRML rules.'
+runs:
+ using: 'docker'
+ image: 'Dockerfile'
+ args:
+ - "--input"
+ - ${{ inputs.input }}
+ - "--output"
+ - ${{ inputs.output }}
+ - "--format"
+ - ${{ inputs.format }}
diff --git a/bin/parser.js b/bin/parser.js
index 960ec2d..5e7da7f 100755
--- a/bin/parser.js
+++ b/bin/parser.js
@@ -14,28 +14,60 @@ const pkginfo = require('pkginfo');
const N3 = require('n3');
const namespaces = require('prefix-ns').asMap();
const watch = require('../lib/watcher.js');
+const glob = require('glob');
namespaces.ql = 'http://semweb.mmlab.be/ns/ql#';
pkginfo(module, 'version');
+/**
+ * This method collect all values when an option is used multiple times.
+ * @param val A single value.
+ * @param memo The current array of values.
+ * @returns {*} The updated array with the new value.
+ */
+function collect(val, memo) {
+ memo.push(val);
+ return memo;
+}
+
program.version(module.exports.version);
-program.option('-i, --input ', 'input file');
-program.option('-o, --output ', 'output file (default: stdout)');
-program.option('-f, --format ', 'RML or R2RML (default: RML)');
+program.option('-i, --input ', 'input file (can be used multiple times)', collect, []); // We support multiple uses of this option.
+program.option('-c, --class', 'use rr:class when appropriate');
+program.option('-o, --output ', 'output file (default: stdout)');
+program.option('-f, --format ', 'RML or R2RML (default: RML)');
program.option('-w, --watch', 'watch for file changes');
+program.option('-e, --external ', 'external references (key=value, can be used multiple times', collect, []); // We support multiple uses of this option.
+program.option('-m, --skip-metadata', 'include metadata in generated rules');
program.parse(process.argv);
if (!program.input) {
- console.error('Please provide an input file.');
+ console.error('Please provide an input file using -i| --input.');
} else {
- if (!path.isAbsolute(program.input)) {
- program.input = path.join(process.cwd(), program.input);
+ let inputPaths = [];
+
+ for (let input of program.input) {
+ // Check if the input is a regex, e.g., *.yarrrml
+ if (glob.hasMagic(input)) {
+ const foundFiles = glob.sync(input).map(file => path.join(process.cwd(), file));
+ inputPaths = inputPaths.concat(foundFiles);
+ } else {
+ if (!path.isAbsolute(input)) {
+ input = path.join(process.cwd(), input);
+ }
+
+ inputPaths.push(input);
+ }
}
if (!program.watch) {
try {
- const inputData = fs.readFileSync(program.input, 'utf8');
+ const inputData = [];
+
+ for (const p of inputPaths) {
+ const yarrrml = fs.readFileSync(p, 'utf8');
+ inputData.push({yarrrml, file: p});
+ }
if (program.format) {
program.format = program.format.toUpperCase();
@@ -49,11 +81,23 @@ if (!program.input) {
rdfs: namespaces.rdfs,
fnml: "http://semweb.mmlab.be/ns/fnml#",
fno: "https://w3id.org/function/ontology#",
- d2rq: "http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#"
+ d2rq: "http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#",
+ void: "http://rdfs.org/ns/void#",
+ dc: "http://purl.org/dc/terms/",
+ foaf: "http://xmlns.com/foaf/0.1/"
};
+ const externalReferences = {};
+
+ for (const e of program.external) {
+ const keyValue = e.split('=');
+ externalReferences[keyValue[0]] = keyValue[1];
+ }
+
+ const includeMetadata =!(!!program.skipMetadata);
+
if (!program.format || program.format === 'RML') {
- const y2r = new Y2R();
+ const y2r = new Y2R({class: !!program.class, externalReferences, includeMetadata});
triples = y2r.convert(inputData);
prefixes.rml = namespaces.rml;
@@ -61,7 +105,7 @@ if (!program.input) {
prefixes[''] = y2r.getBaseIRI();
prefixes = Object.assign({}, prefixes, y2r.getPrefixes());
} else {
- const y2r = new Y2R2();
+ const y2r = new Y2R2({class: !!program.class, externalReferences, includeMetadata});
triples = y2r.convert(inputData);
prefixes[''] = y2r.getBaseIRI();
prefixes = Object.assign({}, prefixes, y2r.getPrefixes());
diff --git a/lib/abstract-generator.js b/lib/abstract-generator.js
index d49d2ca..0716e5d 100644
--- a/lib/abstract-generator.js
+++ b/lib/abstract-generator.js
@@ -3,54 +3,80 @@
* Ghent University - imec - IDLab
*/
-const YAML = require('yamljs');
-const expand = require('./expander.js');
-const namespaces = require('prefix-ns').asMap();
-const rdfaVocs = require('./rdfa-context.json')['@context'];
-const { DataFactory } = require('n3');
+const YAML = require('yamljs');
+const expand = require('./expander.js');
+const namespaces = require('prefix-ns').asMap();
+const rdfaVocs = require('./rdfa-context.json')['@context'];
+const {DataFactory} = require('n3');
const {namedNode, literal, quad} = DataFactory;
-namespaces.ql = 'http://semweb.mmlab.be/ns/ql#';
+namespaces.ql = 'http://semweb.mmlab.be/ns/ql#';
namespaces.fnml = 'http://semweb.mmlab.be/ns/fnml#';
-namespaces.fno = 'https://w3id.org/function/ontology#';
+namespaces.fno = 'https://w3id.org/function/ontology#';
class AbstractGenerator {
- constructor() {
+ constructor(options = null) {
this.mappingsAndIRIs = {};
this.referencingObjectMapDetails = {};
this.prefixes = {};
this.baseIRI = 'http://mapping.example.com/';
this.quads = [];
+ this.options = {...{class: false, externalReferences: {}, includeMetadata: true}, ...options}
+ this.externalReferences = this.options.externalReferences;
+ this.authors = [];
}
+ /**
+ * This method converts YARRRML to another set of rules.
+ * @param yarrrml {string|array} This is either an array of objects {yarrrml, file} that need to be converted or
+ * a single YARRRML string.
+ */
convert(yarrrml) {
+ // To make it backwards compatible.
+ if (typeof yarrrml === 'string' || yarrrml instanceof String) {
+ yarrrml = [{yarrrml}];
+ }
+
this.counter = {};
- let json;
+ const expandedJSONs = [];
- try {
- json = YAML.parse(yarrrml);
- } catch(e) {
- e.code = 'INVALID_YAML';
- throw e;
- }
+ for (const el of yarrrml) {
+ const {yarrrml, file} = el;
- try {
- //expand JSON
- const expandedJSON = expand(json);
+ let json;
- if (expandedJSON.prefixes) {
- this.prefixes = expandedJSON.prefixes;
+ try {
+ json = YAML.parse(yarrrml);
+ } catch (e) {
+ e.code = 'INVALID_YAML';
+ e.file = file
+ throw e;
}
- //convert to RML
- return this.convertExpandedJSON(expandedJSON);
+ try {
+ const expandedJSON = expand(json);
+ if (expandedJSON.external) {
+ this.externalReferences = {...this.externalReferences, ...expandedJSON.external};
+ }
- //return JSON.stringify(jsonld);
- } catch(e) {
- e.code = 'INVALID_YARRRML';
- throw e;
+ if (expandedJSON.authors) {
+ this.authors = this.authors.concat(expandedJSON.authors);
+ }
+
+ expandedJSONs.push(expandedJSON);
+ } catch (e) {
+ e.code = 'INVALID_YARRRML';
+ throw e;
+ }
}
+
+ const combinedExpandedJSON = this._combineExpandedJSONs(expandedJSONs);
+ this.prefixes = combinedExpandedJSON.prefixes;
+ this.externalReferences = {...this.externalReferences, ...this.options.externalReferences};
+
+ //convert to RML
+ return this.convertExpandedJSON(combinedExpandedJSON);
}
convertExpandedJSON(yarrrml) {
@@ -59,6 +85,55 @@ class AbstractGenerator {
rdfaVocs[prefix] = yarrrml.prefixes[prefix];
});
}
+
+ if (this.options.includeMetadata) {
+ this._generateDatasetDescription(this.authors);
+ }
+ }
+
+ /**
+ * This method combines multiple expanded JSONs in a single one.
+ * @param expandedJSONs An array of expanded JSONs that need to be combined.
+ * @returns {{mappings: {}, prefixes: {}, sources: {}}} The combined expanded JSON.
+ * @private
+ */
+ _combineExpandedJSONs(expandedJSONs) {
+ const result = {mappings: {}, prefixes: {}, sources: {}};
+
+ for (const json of expandedJSONs) {
+ this._addSourceValuesToTarget(json.mappings, result.mappings, 'Mapping');
+ this._addSourceValuesToTarget(json.prefixes, result.prefixes, 'Prefix');
+ this._addSourceValuesToTarget(json.sources, result.sources, 'Source');
+
+ if (json.base) {
+ if (result.base) {
+ console.warn(`Base is multiple times defined. Using only "${result.base}".`);
+ } else {
+ result.base = json.base;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * This method adds all key-values from a source object to a target object.
+ * Warning messages are outputted if a key already exists in the target object.
+ * In this case the value in the target object for that key is preserved.
+ * @param sourceObj {object} The object from which the key-value pairs are read.
+ * @param targetObj {object} The object to which the non-existing key-value pairs are added.
+ * @param messageValue {string} The type of key. This is used in the warning message.
+ * @private
+ */
+ _addSourceValuesToTarget(sourceObj, targetObj, messageValue) {
+ for (const key in sourceObj) {
+ if (targetObj[key]) {
+ console.warn(`${messageValue} with key "${key}" is multiple times defined. Using only fist occurrence.`);
+ } else {
+ targetObj[key] = sourceObj[key];
+ }
+ }
}
generateMapping(tmSubject, mapping, mappingName, sourceSubject) {
@@ -69,41 +144,9 @@ class AbstractGenerator {
literal(mappingName)
));
- if (mapping.subjects) {
- mapping.subjects.forEach(subject => {
- const smSubject = namedNode(this.baseIRI + this.getUniqueID('s'));
+ const subjectMaps = []
- this.quads.push(quad(
- smSubject,
- namedNode(namespaces.rdf + 'type'),
- namedNode(namespaces.rr + 'SubjectMap')
- ));
-
- this.quads.push(quad(
- tmSubject,
- namedNode(namespaces.rr + 'subjectMap'),
- smSubject
- ));
-
- if (typeof subject === "object") {
- this.generateFunctionTermMap(smSubject, subject, sourceSubject, 'IRI');
- } else {
- const {predicate, object} = this.getAppropriatePredicateAndObjectForValue(subject);
- this.quads.push(quad(
- smSubject,
- predicate,
- object
- ));
- }
-
- if (mapping.graphs) {
- mapping.graphs.forEach(graph => {
- this.generateGraphMap(smSubject, graph, sourceSubject);
- });
- }
- });
- } else {
- //we are dealing with a blank node
+ mapping.subjects.forEach(subject => {
const smSubject = namedNode(this.baseIRI + this.getUniqueID('s'));
this.quads.push(quad(
@@ -118,15 +161,56 @@ class AbstractGenerator {
smSubject
));
- this.quads.push(quad(
- smSubject,
- namedNode(namespaces.rr + 'termType'),
- namedNode(namespaces.rr + 'BlankNode')
- ));
- }
+ if (typeof subject === "object") {
+ if (subject.function) {
+ this.generateFunctionTermMap(smSubject, subject, sourceSubject, subject.type === 'iri' ? 'IRI' : 'BlankNode');
+ } else {
+ this.quads.push(quad(
+ smSubject,
+ namedNode(namespaces.rr + 'termType'),
+ namedNode(namespaces.rr + 'BlankNode')
+ ));
+ }
+ } else {
+ const {predicate, object} = this.getAppropriatePredicateAndObjectForValue(subject);
+ this.quads.push(quad(
+ smSubject,
+ predicate,
+ object
+ ));
+ }
+
+ if (mapping.graphs) {
+ mapping.graphs.forEach(graph => {
+ this.generateGraphMap(smSubject, graph, sourceSubject);
+ });
+ }
+ subjectMaps.push(smSubject);
+ });
if (mapping.predicateobjects) {
mapping.predicateobjects.forEach(po => {
+
+ if (this.options.class && // flag
+ po.predicates.length === 1 && // only one predicate
+ po.predicates[0].indexOf('$(') === -1 && // without template, ie, a constant value
+ ['a', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'].indexOf(AbstractGenerator.expandPrefix(po.predicates[0])) !== -1 && // is `a` or `rdf:type`
+ po.objects.filter(o => o.function).length === 0 && // no functions
+ po.objects.filter(o => o.mapping).length === 0 // no mappings
+ ) {
+ subjectMaps.forEach(sMap => {
+ po.objects.forEach(o => {
+ const {object} = this.getAppropriatePredicateAndObjectForValue(o.value, true);
+ this.quads.push(quad(
+ sMap,
+ namedNode(namespaces.rr + 'class'),
+ object
+ ));
+ });
+ });
+ return;
+ }
+
const pomSubject = namedNode(this.baseIRI + this.getUniqueID('pom'));
@@ -162,7 +246,10 @@ class AbstractGenerator {
let appropriatePO;
if (p === 'a') {
- appropriatePO = {object: namedNode(namespaces.rdf + 'type'), predicate: namedNode(namespaces.rr + 'constant')};
+ appropriatePO = {
+ object: namedNode(namespaces.rdf + 'type'),
+ predicate: namedNode(namespaces.rr + 'constant')
+ };
isPredicateRDFTYPE = true;
} else {
appropriatePO = this.getAppropriatePredicateAndObjectForValue(p, true);
@@ -214,24 +301,29 @@ class AbstractGenerator {
namedNode(namespaces.rr + 'ObjectMap')
));
- const {predicate, object} = this.getAppropriatePredicateAndObjectForValue(o.value);
-
- this.quads.push(quad(
- omSubject,
- predicate,
- object
- ));
-
switch (o.type) {
case 'iri':
o.type = namedNode(namespaces.rr + 'IRI');
break;
- case "literal":
+ case 'blank':
+ o.type = namedNode(namespaces.rr + 'BlankNode');
+ break;
+ case 'literal':
default:
o.type = namedNode(namespaces.rr + 'Literal');
break;
}
+ if (o.value) {
+ const {predicate, object} = this.getAppropriatePredicateAndObjectForValue(o.value);
+
+ this.quads.push(quad(
+ omSubject,
+ predicate,
+ object
+ ));
+ }
+
this.quads.push(quad(
omSubject,
namedNode(namespaces.rr + 'termType'),
@@ -463,26 +555,27 @@ class AbstractGenerator {
if (pm.from === 'subject') {
- //get type: iri or literal
- const {predicate, object} = this.getAppropriatePredicateAndObjectForValue(pm.value);
-
- this.quads.push(quad(
- omSubject,
- predicate,
- object
- ));
-
- if (pm.type === 'iri') {
+ if (pm.type === 'blank') {
this.quads.push(quad(
omSubject,
namedNode(namespaces.rr + 'termType'),
- namedNode(namespaces.rr + 'IRI')
+ namedNode(namespaces.rr + 'BlankNode')
));
} else {
+ const {predicate, object} = this.getAppropriatePredicateAndObjectForValue(pm.value);
+
+ this.quads.push(quad(
+ omSubject,
+ predicate,
+ object
+ ));
+
+ const termTypeObject = pm.type === 'iri' ? 'IRI' : 'Literal';
+
this.quads.push(quad(
omSubject,
namedNode(namespaces.rr + 'termType'),
- namedNode(namespaces.rr + 'Literal')
+ namedNode(namespaces.rr + termTypeObject)
));
}
} else if (pm.from === 'function') {
@@ -540,6 +633,69 @@ class AbstractGenerator {
throw new Error('Not implemented yet.');
}
+ /**
+ * This method creates quads for the void dataset representing the rules with
+ * the authors as contributors.
+ * @param authors - An array of authors that will be added as contributors.
+ */
+ _generateDatasetDescription(authors) {
+ this.datasetIRI = namedNode(this.baseIRI + this.getUniqueID('rules'));
+
+ this.quads.push(quad(
+ this.datasetIRI,
+ namedNode(namespaces.rdf + 'type'),
+ namedNode(namespaces.void + 'Dataset')
+ ));
+
+ for (const author of authors) {
+ if (author.webid) {
+ this.quads.push(quad(
+ this.datasetIRI,
+ namedNode(namespaces.dcterms + 'contributor'),
+ namedNode(author.webid)
+ ));
+ } else {
+ const personIRI = namedNode(this.baseIRI + this.getUniqueID('person'));
+
+ this.quads.push(quad(
+ this.datasetIRI,
+ namedNode(namespaces.dcterms + 'contributor'),
+ personIRI
+ ));
+
+ this.quads.push(quad(
+ personIRI,
+ namedNode(namespaces.dcterms + 'contributor'),
+ namedNode(namespaces.foaf + 'Person')
+ ));
+
+ if (author.name) {
+ this.quads.push(quad(
+ personIRI,
+ namedNode(namespaces.rdfs + 'label'),
+ literal(author.name)
+ ));
+ }
+
+ if (author.email) {
+ this.quads.push(quad(
+ personIRI,
+ namedNode(namespaces.foaf + 'mbox'),
+ namedNode(`mailto:${author.email}`)
+ ));
+ }
+
+ if (author.website) {
+ this.quads.push(quad(
+ personIRI,
+ namedNode(namespaces.foaf + 'homepage'),
+ namedNode(author.website)
+ ));
+ }
+ }
+ }
+ }
+
static parseTemplate(t) {
t = '' + t; // Make sure it's a string.
t = t.replace(/\\\\/g, '@@@BACKWARD-SLASH@@@'); // We want to preserve real backward slashes.
@@ -559,7 +715,7 @@ class AbstractGenerator {
static countReference(t) {
t = '' + t;
- const match = t.match(/\{([^\}]*)\}/g);
+ const match = t.match(/\{([^\}]*)\}/g);
if (match === null) {
return 0;
@@ -579,6 +735,32 @@ class AbstractGenerator {
return a[0].substr(1, a[0].length - 2);
}
+ /**
+ * This function replaces all external references in a given string.
+ * @param {string} str - The string in which the external references have to be replaced with their values.
+ */
+ _replaceExternalReferences(str) {
+ str = '' + str;
+ const refs = str.match(/\{([^\}]*)\}/g);
+
+ if (refs) {
+ for (const ref of refs) {
+ if (ref.startsWith('{_')) {
+ const refWithoutBrackets = ref.substr(2, ref.length - 3);
+ const externalRefValue = this.externalReferences[refWithoutBrackets];
+
+ if (externalRefValue) {
+ str = str.replace(ref, externalRefValue);
+ } else {
+ console.info(`No external reference is found for ${ref}. It is not replaced.`);
+ }
+ }
+ }
+ }
+
+ return str;
+ }
+
getUniqueID(prefix = '') {
if (!prefix) {
prefix = 'id';
@@ -587,14 +769,14 @@ class AbstractGenerator {
if (!this.counter[prefix]) {
this.counter[prefix] = 0;
}
- const id = this.counter[prefix];
+ const id = '' + this.counter[prefix];
this.counter[prefix]++;
- return `${prefix}_${id}`;
+ return `${prefix}_${id.padStart(3, '0')}`;
}
static expandPrefix(str) {
- if (!(typeof(str) === 'string' || str instanceof String)) {
+ if (!(typeof (str) === 'string' || str instanceof String)) {
return str;
}
@@ -628,6 +810,15 @@ class AbstractGenerator {
}
this.mappingsAndIRIs[mappingName].push(iri);
+
+ if (this.datasetIRI) {
+ // Add the Triples Map to the void dataset.
+ this.quads.push(quad(
+ this.datasetIRI,
+ namedNode(namespaces.void + 'exampleResource'),
+ iri
+ ));
+ }
}
getPrefixes() {
@@ -642,22 +833,35 @@ class AbstractGenerator {
let predicate = namedNode(namespaces.rr + 'template');
const escapedValue = AbstractGenerator.escapeTemplate(value);
const parsedValue = AbstractGenerator.parseTemplate(escapedValue);
- let object = literal(parsedValue);
+ let object;
if (AbstractGenerator.countReference(parsedValue) === 1 && !AbstractGenerator.hasConstantPart(parsedValue)) {
- object = AbstractGenerator.getFirstReference(parsedValue);
- object = literal(AbstractGenerator.expandPrefix(object));
- predicate = this.getReferenceOnlyPredicate();
- } else if (parsedValue === escapedValue) {
+ object = this._replaceExternalReferences(parsedValue);
+
+ if (object === parsedValue) {
+ object = object.replace(/\\_/g, '_');
+ object = AbstractGenerator.getFirstReference(object);
+ object = AbstractGenerator.expandPrefix(object)
+ object = literal(object);
+ predicate = this.getReferenceOnlyPredicate();
+ } else {
+ object = literal(object);
predicate = namedNode(namespaces.rr + 'constant');
+ }
+ } else if (parsedValue === escapedValue) {
+ predicate = namedNode(namespaces.rr + 'constant');
+ object = this._replaceExternalReferences(AbstractGenerator.expandPrefix(value));
- if (isIRI) {
- object = namedNode(AbstractGenerator.expandPrefix(value));
- } else {
- object = literal(AbstractGenerator.expandPrefix(value));
- }
+ if (isIRI) {
+ object = namedNode(object);
+ } else {
+ object = literal(object);
+ }
} else {
- object = literal(AbstractGenerator.expandPrefix(parsedValue));
+ const expandedValue = AbstractGenerator.expandPrefix(parsedValue);
+ object = this._replaceExternalReferences(expandedValue);
+ object = object.replace(/\\_/g, '_');
+ object = literal(object);
}
return {predicate, object};
diff --git a/lib/expander.js b/lib/expander.js
index 0811595..a6f03be 100644
--- a/lib/expander.js
+++ b/lib/expander.js
@@ -4,6 +4,7 @@
*/
const extend = require('extend');
+const parseAuthor = require('parse-author');
const shortcuts = {
subjects: ['s', 'subject'],
@@ -23,6 +24,7 @@ const shortcuts = {
const idlabfn = 'http://example.com/idlab/function/';
+
function expand(input) {
const output = {};
@@ -30,6 +32,7 @@ function expand(input) {
replaceAll('mappings', output);
expandMappings(output);
+ expandAuthors(output);
expandSourcesInDocument(output);
return output;
@@ -68,12 +71,23 @@ function expandSubjects(mapping, mappingKey) {
for (let i = 0; i < mapping.subjects.length; i++) {
if (typeof mapping.subjects[i] === 'object') {
expandFunction(mapping.subjects[i]);
+
+ if (!mapping.subjects[i].type) {
+ mapping.subjects[i].type = 'iri'
+ }
}
}
} else {
expandFunction(mapping.subjects);
+
+ if (!mapping.subjects.type) {
+ mapping.subjects.type = 'iri'
+ }
+
mapping.subjects = [mapping.subjects];
}
+ } else {
+ mapping.subjects = [{type: 'blank'}];
}
replaceAll('conditions', mapping);
@@ -83,7 +97,7 @@ function expandSubjects(mapping, mappingKey) {
for (let i = 0; i < mapping.subjects.length; i++) {
const subject = mapping.subjects[i];
- mapping.subjects[0] = {
+ mapping.subjects[i] = {
function: idlabfn + 'trueCondition',
parameters: [
{
@@ -92,11 +106,12 @@ function expandSubjects(mapping, mappingKey) {
from: 'function'
}, {
parameter: idlabfn + 'str',
- value: subject,
- from: 'subject'
+ value: subject.type === 'blank' ? null : subject,
+ from: subject.function !== undefined ? 'function' : 'subject',
+ type: subject.type ? subject.type : 'iri'
}
],
- type: 'iri' // TODO include blank nodes
+ type: subject.type ? subject.type : 'iri'
};
delete mapping.conditions;
}
@@ -499,4 +514,39 @@ function replace(oldName, newName, value) {
delete value[oldName];
}
+/**
+ * This method expands authors.
+ * @param input - The JSON object of the YARRRML rules.
+ */
+function expandAuthors(input) {
+ if (input.authors) {
+ let authors = input.authors;
+
+ if (typeof authors === 'string' || authors instanceof String) {
+ authors = [authors];
+ input.authors = authors;
+ }
+
+ for (let i = 0; i < authors.length; i ++) {
+ const author = authors[i];
+
+ if (typeof author === 'string' || author instanceof String) {
+ const parsedAuthor = parseAuthor(author);
+
+ // This is a WebID.
+ if (parsedAuthor.name && parsedAuthor.name.includes('://')) {
+ authors[i] = {webid: author};
+ } else {
+ if (parsedAuthor.url) {
+ parsedAuthor.website = parsedAuthor.url;
+ }
+
+ delete parsedAuthor.url;
+ authors[i] = parsedAuthor;
+ }
+ }
+ }
+ }
+}
+
module.exports = expand;
diff --git a/lib/expander.test.js b/lib/expander.test.js
index 6847831..8780171 100644
--- a/lib/expander.test.js
+++ b/lib/expander.test.js
@@ -128,7 +128,8 @@ describe('expander', () => {
type: 'literal',
from: 'subject'
}
- ]
+ ],
+ type: 'iri'
}
]
}
@@ -156,9 +157,11 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: []
},
project: {
+ subjects: [{type: 'blank'}],
predicateobjects: []
}
}
@@ -182,6 +185,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:firstName"],
@@ -215,6 +219,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:name", "rdfs:label"],
@@ -252,6 +257,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:name", "rdfs:label"],
@@ -285,6 +291,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:firstName"],
@@ -318,6 +325,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:firstName"],
@@ -354,6 +362,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:firstName"],
@@ -387,6 +396,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:firstName"],
@@ -429,6 +439,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["foaf:firstName"],
@@ -465,6 +476,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ["schema:test"],
@@ -509,6 +521,9 @@ describe('expander', () => {
referenceFormulation: 'jsonpath',
iterator: '$.persons[*]'
}
+ ],
+ subjects: [
+ {type: 'blank'}
]
}
}
@@ -569,6 +584,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ['foaf:test'],
@@ -616,6 +632,7 @@ describe('expander', () => {
const expectedOutput = {
mappings: {
person: {
+ subjects: [{type: 'blank'}],
predicateobjects: [
{
predicates: ['foaf:test'],
@@ -670,9 +687,10 @@ describe('expander', () => {
type: 'literal',
from: 'subject'
}
- ]
+ ],
+ type: 'iri'
}
- ]
+ ]
}
}
};
@@ -727,6 +745,7 @@ describe('expander', () => {
{
person:
{
+ subjects: [{type: 'blank'}],
predicateobjects:
[{
predicates: ['foaf:firstName'],
@@ -799,6 +818,7 @@ describe('expander', () => {
{
person:
{
+ subjects: [{type: 'blank'}],
predicateobjects:
[{
predicates: ['foaf:firstName'],
@@ -864,6 +884,7 @@ describe('expander', () => {
{
person:
{
+ subjects: [{type: 'blank'}],
predicateobjects:
[{
predicates: ['foaf:firstName'],
@@ -908,4 +929,461 @@ describe('expander', () => {
const output = expand(input);
assert.deepStrictEqual(output, expectedOutput);
});
+
+ it('condition on mapping with blank node as subject', () => {
+ const input = {
+ "prefixes": {
+ "idlab-fn": "http://example.com/idlab/function/",
+ "grel": "http://users.ugent.be/~bjdmeest/function/grel.ttl#"
+ },
+ "mappings": {
+ "test": {
+ "condition": {
+ "function": "idlab-fn:equal",
+ "parameters": [
+ [
+ "grel:valueParameter",
+ "$(id)"
+ ],
+ [
+ "grel:valueParameter2",
+ 1
+ ]
+ ]
+ },
+ "po": [
+ [
+ "a",
+ "http://example.com/Test"
+ ]
+ ]
+ }
+ }
+ };
+
+ const expectedOutput = {
+ "prefixes": {
+ "idlab-fn": "http://example.com/idlab/function/",
+ "grel": "http://users.ugent.be/~bjdmeest/function/grel.ttl#"
+ },
+ "mappings": {
+ "test": {
+ "subjects": [
+ {
+ "function": "http://example.com/idlab/function/trueCondition",
+ "parameters": [
+ {
+ "parameter": "http://example.com/idlab/function/strBoolean",
+ "value": {
+ "function": "idlab-fn:equal",
+ "parameters": [
+ {
+ "parameter": "grel:valueParameter",
+ "value": "$(id)",
+ "type": "literal",
+ "from": "subject"
+ },
+ {
+ "parameter": "grel:valueParameter2",
+ "value": "1",
+ "type": "literal",
+ "from": "subject"
+ }
+ ]
+ },
+ "from": "function"
+ },
+ {
+ "parameter": "http://example.com/idlab/function/str",
+ "value": null,
+ "type": "blank",
+ "from": "subject"
+ }
+ ],
+ "type": "blank"
+ }
+ ],
+ "predicateobjects": [
+ {
+ "predicates": [
+ "a"
+ ],
+ "objects": [
+ {
+ "value": "http://example.com/Test",
+ "type": "iri"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ };
+
+ const output = expand(input);
+ assert.deepStrictEqual(output, expectedOutput);
+ });
+
+ describe('authors', () => {
+ it('array with objects', () => {
+ const input = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": [
+ {
+ "name": "John Doe",
+ "email": "john@doe.com"
+ },
+ {
+ "name": "Jane Doe",
+ "website": "https://janedoe.com"
+ }
+ ],
+ "mappings": {
+ "person": {
+ "sources": [
+ [
+ "data.json~jsonpath",
+ "$.persons[*]"
+ ]
+ ],
+ "s": "http://example.com/$(firstname)",
+ "po": [
+ [
+ "a",
+ "foaf:Person"
+ ],
+ [
+ "ex:name",
+ "$(firstname)"
+ ]
+ ]
+ }
+ }
+ };
+
+ const expectedOutput = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": [
+ {
+ "name": "John Doe",
+ "email": "john@doe.com"
+ },
+ {
+ "name": "Jane Doe",
+ "website": "https://janedoe.com"
+ }
+ ],
+ "mappings": {
+ "person": {
+ "sources": [
+ {
+ "access": "data.json",
+ "referenceFormulation": "jsonpath",
+ "iterator": "$.persons[*]"
+ }
+ ],
+ "subjects": [
+ "http://example.com/$(firstname)"
+ ],
+ "predicateobjects": [
+ {
+ "predicates": [
+ "a"
+ ],
+ "objects": [
+ {
+ "value": "foaf:Person",
+ "type": "iri"
+ }
+ ]
+ },
+ {
+ "predicates": [
+ "ex:name"
+ ],
+ "objects": [
+ {
+ "value": "$(firstname)",
+ "type": "literal"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ };
+
+ const output = expand(input);
+
+ assert.deepStrictEqual(output, expectedOutput);
+ });
+
+ it('array with strings', () => {
+ const input = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": [
+ "John Doe ",
+ "Jane Doe (https://janedoe.com)"
+ ],
+ "mappings": {
+ "person": {
+ "sources": [
+ [
+ "data.json~jsonpath",
+ "$.persons[*]"
+ ]
+ ],
+ "s": "http://example.com/$(firstname)",
+ "po": [
+ [
+ "a",
+ "foaf:Person"
+ ],
+ [
+ "ex:name",
+ "$(firstname)"
+ ]
+ ]
+ }
+ }
+ };
+
+ const expectedOutput = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": [
+ {
+ "name": "John Doe",
+ "email": "john@doe.com"
+ },
+ {
+ "name": "Jane Doe",
+ "website": "https://janedoe.com"
+ }
+ ],
+ "mappings": {
+ "person": {
+ "sources": [
+ {
+ "access": "data.json",
+ "referenceFormulation": "jsonpath",
+ "iterator": "$.persons[*]"
+ }
+ ],
+ "subjects": [
+ "http://example.com/$(firstname)"
+ ],
+ "predicateobjects": [
+ {
+ "predicates": [
+ "a"
+ ],
+ "objects": [
+ {
+ "value": "foaf:Person",
+ "type": "iri"
+ }
+ ]
+ },
+ {
+ "predicates": [
+ "ex:name"
+ ],
+ "objects": [
+ {
+ "value": "$(firstname)",
+ "type": "literal"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ };
+
+ const output = expand(input);
+
+ assert.deepStrictEqual(output, expectedOutput);
+ });
+
+ it('array with Web IDs', () => {
+ const input = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": [
+ "http://johndoe.com/#me",
+ "http://janedoe.com/#me"
+ ],
+ "mappings": {
+ "person": {
+ "sources": [
+ [
+ "data.json~jsonpath",
+ "$.persons[*]"
+ ]
+ ],
+ "s": "http://example.com/$(firstname)",
+ "po": [
+ [
+ "a",
+ "foaf:Person"
+ ],
+ [
+ "ex:name",
+ "$(firstname)"
+ ]
+ ]
+ }
+ }
+ };
+
+ const expectedOutput = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": [
+ {
+ "webid": "http://johndoe.com/#me"
+ },
+ {
+ "webid": "http://janedoe.com/#me"
+ }
+ ],
+ "mappings": {
+ "person": {
+ "sources": [
+ {
+ "access": "data.json",
+ "referenceFormulation": "jsonpath",
+ "iterator": "$.persons[*]"
+ }
+ ],
+ "subjects": [
+ "http://example.com/$(firstname)"
+ ],
+ "predicateobjects": [
+ {
+ "predicates": [
+ "a"
+ ],
+ "objects": [
+ {
+ "value": "foaf:Person",
+ "type": "iri"
+ }
+ ]
+ },
+ {
+ "predicates": [
+ "ex:name"
+ ],
+ "objects": [
+ {
+ "value": "$(firstname)",
+ "type": "literal"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ };
+
+ const output = expand(input);
+
+ assert.deepStrictEqual(output, expectedOutput);
+ });
+
+ it('single string', () => {
+ const input = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": "John Doe ",
+ "mappings": {
+ "person": {
+ "sources": [
+ [
+ "data.json~jsonpath",
+ "$.persons[*]"
+ ]
+ ],
+ "s": "http://example.com/$(firstname)",
+ "po": [
+ [
+ "a",
+ "foaf:Person"
+ ],
+ [
+ "ex:name",
+ "$(firstname)"
+ ]
+ ]
+ }
+ }
+ };
+
+ const expectedOutput = {
+ "prefixes": {
+ "ex": "http://example.com/"
+ },
+ "authors": [
+ {
+ "name": "John Doe",
+ "email": "john@doe.com"
+ }
+ ],
+ "mappings": {
+ "person": {
+ "sources": [
+ {
+ "access": "data.json",
+ "referenceFormulation": "jsonpath",
+ "iterator": "$.persons[*]"
+ }
+ ],
+ "subjects": [
+ "http://example.com/$(firstname)"
+ ],
+ "predicateobjects": [
+ {
+ "predicates": [
+ "a"
+ ],
+ "objects": [
+ {
+ "value": "foaf:Person",
+ "type": "iri"
+ }
+ ]
+ },
+ {
+ "predicates": [
+ "ex:name"
+ ],
+ "objects": [
+ {
+ "value": "$(firstname)",
+ "type": "literal"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ };
+
+ const output = expand(input);
+
+ assert.deepStrictEqual(output, expectedOutput);
+ });
+ });
});
diff --git a/lib/formulations.json b/lib/formulations.json
index 34b1d55..725b047 100644
--- a/lib/formulations.json
+++ b/lib/formulations.json
@@ -19,6 +19,7 @@
"reference": {
"jsonpath": "http://semweb.mmlab.be/ns/ql#JSONPath",
"xpath": "http://semweb.mmlab.be/ns/ql#XPath",
- "csv": "http://semweb.mmlab.be/ns/ql#CSV"
+ "csv": "http://semweb.mmlab.be/ns/ql#CSV",
+ "css3": "http://semweb.mmlab.be/ns/ql#CSS3"
}
-}
\ No newline at end of file
+}
diff --git a/lib/r2rml-generator.js b/lib/r2rml-generator.js
index 375dcdb..c6e9a0f 100644
--- a/lib/r2rml-generator.js
+++ b/lib/r2rml-generator.js
@@ -13,8 +13,8 @@ namespaces.ql = 'http://semweb.mmlab.be/ns/ql#';
class R2RMLGenerator extends YARRRML2Anything {
- constructor() {
- super();
+ constructor(options = null) {
+ super(options);
}
convertExpandedJSON(yarrrml) {
diff --git a/lib/r2rml-generator.test.js b/lib/r2rml-generator.test.js
index 6bac962..5eac38c 100644
--- a/lib/r2rml-generator.test.js
+++ b/lib/r2rml-generator.test.js
@@ -8,45 +8,80 @@ const path = require("path");
describe('YARRRML to R2RML', function () {
this.timeout(10000);
+ const options = {includeMetadata: false};
it('example1', function (done) {
- work('example1/r2rml/mapping.yml', 'example1/r2rml/mapping.r2rml.ttl', done);
+ work('example1/r2rml/mapping.yml', 'example1/r2rml/mapping.r2rml.ttl', done, options);
});
it('example4', function (done) {
- work('example4/r2rml/mapping.yml', 'example4/r2rml/mapping.r2rml.ttl', done);
+ work('example4/r2rml/mapping.yml', 'example4/r2rml/mapping.r2rml.ttl', done, options);
});
it('example5', function (done) {
- work('example5/r2rml/mapping.yml', 'example5/r2rml/mapping.r2rml.ttl', done);
+ work('example5/r2rml/mapping.yml', 'example5/r2rml/mapping.r2rml.ttl', done, options);
});
it('example8', function (done) {
- work('example8/r2rml/mapping.yml', 'example8/r2rml/mapping.r2rml.ttl', done);
+ work('example8/r2rml/mapping.yml', 'example8/r2rml/mapping.r2rml.ttl', done, options);
});
it('condition on po', function (done) {
- work('condition-on-po/r2rml/mapping.yml', 'condition-on-po/r2rml/mapping.r2rml.ttl', done);
+ work('condition-on-po/r2rml/mapping.yml', 'condition-on-po/r2rml/mapping.r2rml.ttl', done, options);
});
it('condition on mapping with IRI as subject', function (done) {
- work('condition-on-mapping/r2rml/mapping.yml', 'condition-on-mapping/r2rml/mapping.r2rml.ttl', done);
+ work('condition-on-mapping/r2rml/mapping.yml', 'condition-on-mapping/r2rml/mapping.r2rml.ttl', done, options);
+ });
+
+ it('metadata', function (done) {
+ work('metadata/r2rml/mapping.yarrrml', 'metadata/r2rml/mapping.r2rml.ttl', done);
});
describe('R2RML test cases', function () {
- doR2RMLTestCase('R2RMLTC0001a');
- doR2RMLTestCase('R2RMLTC0002a');
- doR2RMLTestCase('R2RMLTC0002d');
- doR2RMLTestCase('R2RMLTC0002i');
- doR2RMLTestCase('R2RMLTC0009a');
+ it('R2RMLTC0001a', function (done) {
+ doR2RMLTestCase('R2RMLTC0001a', done, options);
+ });
+
+ it('R2RMLTC0002a', function (done) {
+ doR2RMLTestCase('R2RMLTC0002a', done, options);
+ });
+
+ it('R2RMLTC0002d', function (done) {
+ doR2RMLTestCase('R2RMLTC0002d', done, options);
+ });
+
+ it('R2RMLTC0002i', function (done) {
+ doR2RMLTestCase('R2RMLTC0002i', done, options);
+ });
+
+ it('R2RMLTC0009a', function (done) {
+ doR2RMLTestCase('R2RMLTC0009a', done, options);
+ });
+ });
+
+ describe('rr:class', function () {
+ const options = {class: true, includeMetadata: false};
+
+ doTestCase('rr_class/1-single', options);
+ doTestCase('rr_class/2-multiple', options);
+ doTestCase('rr_class/3-no-iri', options);
+ doTestCase('rr_class/4-rdf-type', options);
+ doTestCase('rr_class/5-custom-rdf-prefix', options);
+ doTestCase('rr_class/6-multiple-rows', options);
+ doTestCase('rr_class/7-function', options);
});
});
-function work(path1, path2, cb) {
- compareY2R2RFiles(path.resolve(__dirname, '../test/', path1), path.resolve(__dirname, '../test/', path2), cb);
-}
-function doR2RMLTestCase(testCaseID) {
- it(testCaseID, function (done) {
- work(`r2rml-test-cases/${testCaseID}/mapping.yarrrml`, `r2rml-test-cases/${testCaseID}/mapping.r2rml.ttl`, done);
+function doTestCase(testCaseID, options) {
+ it(testCaseID.replace(/[-]/g, ' '), function (done) {
+ work(`${testCaseID}/mapping.yarrr.yml`, `${testCaseID}/mapping.r2rml.ttl`, done, options);
});
}
+
+function work(path1, path2, cb, options = null) {
+ compareY2R2RFiles(path.resolve(__dirname, '../test/', path1), path.resolve(__dirname, '../test/', path2), options, cb);
+}
+function doR2RMLTestCase(testCaseID, done, options) {
+ work(`r2rml-test-cases/${testCaseID}/mapping.yarrrml`, `r2rml-test-cases/${testCaseID}/mapping.r2rml.ttl`, done, options);
+}
diff --git a/lib/rml-generator.js b/lib/rml-generator.js
index 5795ce6..cf894c7 100644
--- a/lib/rml-generator.js
+++ b/lib/rml-generator.js
@@ -15,8 +15,8 @@ namespaces['idlab-fn'] = 'http://example.com/idlab/function/';
class RMLGenerator extends AbstractGenerator {
- constructor() {
- super();
+ constructor(options = null) {
+ super(options);
}
convertExpandedJSON(yarrrml) {
diff --git a/lib/rml-generator.test.js b/lib/rml-generator.test.js
index 759e80e..1f7064f 100644
--- a/lib/rml-generator.test.js
+++ b/lib/rml-generator.test.js
@@ -24,11 +24,11 @@ describe('YARRRML to RML', function () {
});
it('works for an empty file', function (done) {
- work('trivial/null.yml', 'trivial/null.rml.ttl', done);
+ work('trivial/null.yml', 'trivial/null.rml.ttl', done, {includeMetadata: false});
});
it('works for example1', function (done) {
- work('example1/rml/mapping.yml', 'example1/rml/mapping.rml.ttl', done);
+ work('example1/rml/mapping.yml', 'example1/rml/mapping.rml.ttl', done, {includeMetadata: false});
});
it.skip('works for example2', function (done) {
@@ -36,15 +36,15 @@ describe('YARRRML to RML', function () {
});
it('works for example3', function (done) {
- work('example3/mapping.yml', 'example3/mapping.rml.ttl', done);
+ work('example3/mapping.yml', 'example3/mapping.rml.ttl', done, {includeMetadata: false});
});
it('works for example4', function (done) {
- work('example4/rml/mapping.yml', 'example4/rml/mapping.rml.ttl', done);
+ work('example4/rml/mapping.yml', 'example4/rml/mapping.rml.ttl', done, {includeMetadata: false});
});
it.skip('works for example5', function (done) {
- work('example5/rml/mapping.yml', 'example5/rml/mapping.rml.ttl', done);
+ work('example5/rml/mapping.yml', 'example5/rml/mapping.rml.ttl', done, {includeMetadata: false});
});
it.skip('works for example6', function (done) {
@@ -52,140 +52,220 @@ describe('YARRRML to RML', function () {
});
it('works for example8', function (done) {
- work('example8/rml/mapping.yml', 'example8/rml/mapping.rml.ttl', done);
+ work('example8/rml/mapping.yml', 'example8/rml/mapping.rml.ttl', done, {includeMetadata: false});
});
it('works for prefix expansion', function (done) {
- work('prefixExpand/mapping.yml', 'prefixExpand/mapping.rml.ttl', done);
+ work('prefix-expand/mapping.yml', 'prefix-expand/mapping.rml.ttl', done, {includeMetadata: false});
});
it('works for graph', function (done) {
- work('graph/mapping.yml', 'graph/mapping.rml.ttl', done);
+ work('graph/mapping.yml', 'graph/mapping.rml.ttl', done, {includeMetadata: false});
});
it('works for graph with function', function (done) {
- work('graph/mapping_fno.yml', 'graph/mapping_fno.rml.ttl', done);
+ work('graph/mapping_fno.yml', 'graph/mapping_fno.rml.ttl', done, {includeMetadata: false});
});
it('recursive functions', function (done) {
- work('recursive-functions/mapping.yml', 'recursive-functions/mapping.rml.ttl', done);
+ work('recursive-functions/mapping.yml', 'recursive-functions/mapping.rml.ttl', done, {includeMetadata: false});
});
it('works for strings starting with "{"', function (done) {
- work('template-escape/mapping.yml', 'template-escape/mapping.rml.ttl', done);
+ work('template-escape/mapping.yml', 'template-escape/mapping.rml.ttl', done, {includeMetadata: false});
});
describe('between our worlds rules', function () {
it('anime', function (done) {
- work('betweenourworlds/rules-anime.yml', 'betweenourworlds/rules-anime.rml.ttl', done);
+ work('betweenourworlds/anime/mapping.yarrrml', 'betweenourworlds/anime/mapping.rml.ttl', done, {includeMetadata: false});
});
it('character', function (done) {
- work('betweenourworlds/rules-character.yml', 'betweenourworlds/rules-character.rml.ttl', done);
+ work('betweenourworlds/character/mapping.yarrrml', 'betweenourworlds/character/mapping.rml.ttl', done, {includeMetadata: false});
});
});
it('fno-parameter-as-iri', function (done) {
- work('fno-parameter-as-iri/mapping.yml', 'fno-parameter-as-iri/mapping.rml.ttl', done);
+ work('fno-parameter-as-iri/mapping.yml', 'fno-parameter-as-iri/mapping.rml.ttl', done, {includeMetadata: false});
});
it('joincondition with function', function (done) {
- work('joincondition-with-function/mapping.yml', 'joincondition-with-function/mapping.rml.ttl', done);
+ work('joincondition-with-function/mapping.yml', 'joincondition-with-function/mapping.rml.ttl', done, {includeMetadata: false});
});
it('condition on po', function (done) {
- work('condition-on-po/rml/mapping.yml', 'condition-on-po/rml/mapping.rml.ttl', done);
+ work('condition-on-po/rml/mapping.yml', 'condition-on-po/rml/mapping.rml.ttl', done, {includeMetadata: false});
});
it('condition on mapping with IRI as subject', function (done) {
- work('condition-on-mapping/rml/mapping.yml', 'condition-on-mapping/rml/mapping.rml.ttl', done);
+ work('condition-on-mapping/rml/mapping.yml', 'condition-on-mapping/rml/mapping.rml.ttl', done, {includeMetadata: false});
});
it('predicate with prefix and template', function (done) {
- work('predicate-with-prefix-template/mapping.yml', 'predicate-with-prefix-template/mapping.rml.ttl', done);
+ work('predicate-with-prefix-template/mapping.yml', 'predicate-with-prefix-template/mapping.rml.ttl', done, {includeMetadata: false});
});
it('function shortcut without prefix', function (done) {
- work('function-shortcut-without-prefix/mapping.yml', 'function-shortcut-without-prefix/mapping.rml.ttl', done);
+ work('function-shortcut-without-prefix/mapping.yml', 'function-shortcut-without-prefix/mapping.rml.ttl', done, {includeMetadata: false});
});
it('function shortcut with prefix', function (done) {
- work('function-shortcut-with-prefix/mapping.yml', 'function-shortcut-with-prefix/mapping.rml.ttl', done);
+ work('function-shortcut-with-prefix/mapping.yml', 'function-shortcut-with-prefix/mapping.rml.ttl', done, {includeMetadata: false});
});
it('function shortcut with 2 parameters', function (done) {
- work('function-shortcut-with-2-parameters/mapping.yml', 'function-shortcut-with-2-parameters/mapping.rml.ttl', done);
+ work('function-shortcut-with-2-parameters/mapping.yml', 'function-shortcut-with-2-parameters/mapping.rml.ttl', done, {includeMetadata: false});
});
it('subject with function', function (done) {
- work('subjectmap-with-function/mapping.yml', 'subjectmap-with-function/mapping.rml.ttl', done);
+ work('subjectmap-with-function/mapping.yml', 'subjectmap-with-function/mapping.rml.ttl', done, {includeMetadata: false});
});
it('condition and function on same po', function (done) {
- work('condition-function-on-po/mapping.yarrrml', 'condition-function-on-po/mapping.rml.ttl', done);
+ work('condition-function-on-po/mapping.yarrrml', 'condition-function-on-po/mapping.rml.ttl', done, {includeMetadata: false});
});
it('datatype on function result', function (done) {
- work('datatype-on-function/mapping.yarrrml', 'datatype-on-function/mapping.rml.ttl', done);
+ work('datatype-on-function/mapping.yarrrml', 'datatype-on-function/mapping.rml.ttl', done, {includeMetadata: false});
});
it('condition on single object', function (done) {
- work('condition-on-single-object/mapping.yarrrml', 'condition-on-single-object/mapping.rml.ttl', done);
+ work('condition-on-single-object/mapping.yarrrml', 'condition-on-single-object/mapping.rml.ttl', done, {includeMetadata: false});
});
it('escape character', function (done) {
- work('escape-character/mapping.yarrrml', 'escape-character/mapping.rml.ttl', done);
+ work('escape-character/mapping.yarrrml', 'escape-character/mapping.rml.ttl', done, {includeMetadata: false});
});
it('escape colon in object', function (done) {
- work('escape-colon-object/mapping.yarrrml', 'escape-colon-object/mapping.rml.ttl', done);
+ work('escape-colon-object/mapping.yarrrml', 'escape-colon-object/mapping.rml.ttl', done, {includeMetadata: false});
});
it('escape bracket in reference', function (done) {
- work('escape-bracket/mapping.yarrrml', 'escape-bracket/mapping.rml.ttl', done);
+ work('escape-bracket/mapping.yarrrml', 'escape-bracket/mapping.rml.ttl', done, {includeMetadata: false});
});
it('object is number', function (done) {
- work('object-number/mapping.yarrrml', 'object-number/mapping.rml.ttl', done);
+ work('object-number/mapping.yarrrml', 'object-number/mapping.rml.ttl', done, {includeMetadata: false});
});
it('oracle', function (done) {
- work('oracle/mapping.yarrrml', 'oracle/mapping.rml.ttl', done);
+ work('oracle/mapping.yarrrml', 'oracle/mapping.rml.ttl', done, {includeMetadata: false});
});
it('condition on mapping with constant', function (done) {
- work('condition-on-mapping-constant/mapping.yarrrml', 'condition-on-mapping-constant/mapping.rml.ttl', done);
+ work('condition-on-mapping-constant/mapping.yarrrml', 'condition-on-mapping-constant/mapping.rml.ttl', done, {includeMetadata: false});
});
it('template with two references', function (done) {
- work('template-2-references/mapping.yarrrml', 'template-2-references/mapping.rml.ttl', done);
+ work('template-2-references/mapping.yarrrml', 'template-2-references/mapping.rml.ttl', done, {includeMetadata: false});
});
it('join condition with one reference and text', function (done) {
- work('joincondition-template-1-reference-text/mapping.yarrrml', 'joincondition-template-1-reference-text/mapping.rml.ttl', done);
+ work('joincondition-template-1-reference-text/mapping.yarrrml', 'joincondition-template-1-reference-text/mapping.rml.ttl', done, {includeMetadata: false});
});
it('join condition with two references', function (done) {
- work('joincondition-template-2-references/mapping.yarrrml', 'joincondition-template-2-references/mapping.rml.ttl', done);
+ work('joincondition-template-2-references/mapping.yarrrml', 'joincondition-template-2-references/mapping.rml.ttl', done, {includeMetadata: false});
});
it('function without parameters', function (done) {
- work('function-without-parameters/mapping.yarrrml', 'function-without-parameters/mapping.rml.ttl', done);
+ work('function-without-parameters/mapping.yarrrml', 'function-without-parameters/mapping.rml.ttl', done, {includeMetadata: false});
});
it('equal', function (done) {
- work('equal/mapping.yarrrml', 'equal/mapping.rml.ttl', done);
+ work('equal/mapping.yarrrml', 'equal/mapping.rml.ttl', done, {includeMetadata: false});
});
it('nested condition on object with mapping', function (done) {
- work('condition-on-mapping-nested/mapping.yarrrml', 'condition-on-mapping-nested/mapping.rml.ttl', done);
+ work('condition-on-mapping-nested/mapping.yarrrml', 'condition-on-mapping-nested/mapping.rml.ttl', done, {includeMetadata: false});
});
it('condition on po with datatype', function (done) {
- work('condition-on-po-datatype/mapping.yarrrml', 'condition-on-po-datatype/mapping.rml.ttl', done);
+ work('condition-on-po-datatype/mapping.yarrrml', 'condition-on-po-datatype/mapping.rml.ttl', done, {includeMetadata: false});
+ });
+
+ it('condition on mapping with function for subject', function (done) {
+ work('condition-on-mapping-subject-function/mapping.yarrrml', 'condition-on-mapping-subject-function/mapping.rml.ttl', done, {includeMetadata: false});
+ });
+
+ it('condition on mapping with blank node', function (done) {
+ work('condition-on-mapping-with-blanknode/mapping.yarrrml', 'condition-on-mapping-with-blanknode/mapping.rml.ttl', done, {includeMetadata: false});
+ });
+
+ describe('rr:class', function () {
+ let options = {class: true, includeMetadata: false};
+ doTestCase('rr_class/1-single', options);
+ doTestCase('rr_class/2-multiple', options);
+ doTestCase('rr_class/3-no-iri', options);
+ doTestCase('rr_class/4-rdf-type', options);
+ doTestCase('rr_class/5-custom-rdf-prefix', options);
+ doTestCase('rr_class/6-multiple-rows', options);
+ doTestCase('rr_class/7-function', options);
+ doTestCase('rr_class/8-reference', options);
+ });
+
+ describe('object blank node', function () {
+ it('no template or constant', function (done) {
+ work('object-blank-node/mapping.yarrrml', 'object-blank-node/mapping.rml.ttl', done, {includeMetadata: false});
+ });
+
+ it('template', function (done) {
+ work('object-blank-node/template/mapping.yarrrml', 'object-blank-node/template/mapping.rml.ttl', done, {includeMetadata: false});
+ });
+
+ it('constant', function (done) {
+ work('object-blank-node/constant/mapping.yarrrml', 'object-blank-node/constant/mapping.rml.ttl', done, {includeMetadata: false});
+ });
+ });
+
+ it('multiple input files', function (done) {
+ workMultipleInputFiles(['multiple-input-files/mapping-1.yarrrml', 'multiple-input-files/mapping-2.yarrrml'],
+ 'multiple-input-files/mapping.rml.ttl', done, {includeMetadata: false});
+ });
+
+ describe('external references', function () {
+ const options = {includeMetadata: false};
+
+ doTestCase('external-references/1', options);
+ doTestCase('external-references/2', options);
+ doTestCase('external-references/3', options);
+ doTestCase('external-references/4', options);
+ doTestCase('external-references/5', options);
+ });
+
+ describe('authors', function () {
+ it('array with objects', function (done) {
+ work('author/array-with-objects/mapping.yarrrml', 'author/array-with-objects/mapping.rml.ttl', done);
+ });
+ it('array with strings', function (done) {
+ work('author/array-with-strings/mapping.yarrrml', 'author/array-with-strings/mapping.rml.ttl', done);
+ });
+ it('array with Web IDs', function (done) {
+ work('author/array-with-webids/mapping.yarrrml', 'author/array-with-webids/mapping.rml.ttl', done);
+ });
+ it('single string', function (done) {
+ work('author/single-string/mapping.yarrrml', 'author/single-string/mapping.rml.ttl', done);
+ });
+ });
+
+ it('metadata', function (done) {
+ work('metadata/rml/mapping.yarrrml', 'metadata/rml/mapping.rml.ttl', done);
});
});
-function work(path1, path2, cb) {
- compareY2RFiles(path.resolve(__dirname, '../test/', path1), path.resolve(__dirname, '../test/', path2), cb);
+function doTestCase(testCaseID, options) {
+ it(testCaseID.replace(/[-]/g, ' '), function (done) {
+ work(`${testCaseID}/mapping.yarrr.yml`, `${testCaseID}/mapping.rml.ttl`, done, options);
+ });
+}
+
+function work(path1, path2, cb, options = null) {
+ compareY2RFiles(path.resolve(__dirname, '../test/', path1), path.resolve(__dirname, '../test/', path2), options, cb);
+}
+
+function workMultipleInputFiles(inputFiles, expectedOutputFile, cb, options = null) {
+ const processedInputFiles = inputFiles.map(file => path.resolve(__dirname, '../test/', file));
+
+ compareY2RFiles(processedInputFiles, path.resolve(__dirname, '../test/', expectedOutputFile), options, cb);
}
diff --git a/lib/tools.js b/lib/tools.js
index 81bfde6..f510d78 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -14,20 +14,30 @@ rdfExt.parsers['text/turtle'] = N3Parser;
rdfExt.serializers['application/json+ld'] = new JsonLdSerializerExt({outputFormat: 'string'});
const {isomorphic} = require("rdf-isomorphic");
-function compareY2RFiles(ymlPath, ttlPath, cb) {
- const yaml = fs.readFileSync(ymlPath, 'utf8');
+function compareY2RFiles(ymlPaths, ttlPath, options, cb) {
+ const yamls = [];
+
+ if (typeof ymlPaths === 'string' || ymlPaths instanceof String) {
+ ymlPaths = [ymlPaths];
+ }
+
+ for (const ymlPath of ymlPaths) {
+ const yarrrml = fs.readFileSync(ymlPath, 'utf8');
+ yamls.push({yarrrml});
+ }
+
const ttl = fs.readFileSync(ttlPath, 'utf8');
- compareY2RData(yaml, ttl, cb);
+ compareY2RData(yamls, ttl, options, cb);
}
-function compareY2R2RFiles(ymlPath, ttlPath, cb) {
+function compareY2R2RFiles(ymlPath, ttlPath, options, cb) {
const yaml = fs.readFileSync(ymlPath, 'utf8');
const ttl = fs.readFileSync(ttlPath, 'utf8');
- compareY2R2RData(yaml, ttl, cb);
+ compareY2R2RData(yaml, ttl, options, cb);
}
-function compareY2RData(yaml, ttl, cb) {
- const y2r = new convertYAMLtoRML();
+function compareY2RData(yaml, ttl, options, cb) {
+ const y2r = new convertYAMLtoRML(options);
const yamlQuads = y2r.convert(yaml);
const rmlQuads = [];
const parser = new N3.Parser();
@@ -36,14 +46,19 @@ function compareY2RData(yaml, ttl, cb) {
if (quad)
rmlQuads.push(quad);
else {
- assert(isomorphic(yamlQuads, rmlQuads), true);
+ try {
+ assert(isomorphic(yamlQuads, rmlQuads), true);
+ } catch (e) {
+ assert.deepStrictEqual(yamlQuads,rmlQuads);
+ assert(false, true);
+ }
cb();
}
});
}
-function compareY2R2RData(yaml, ttl, cb) {
- const y2r = new convertYAMLtoR2RML();
+function compareY2R2RData(yaml, ttl, options, cb) {
+ const y2r = new convertYAMLtoR2RML(options);
const yamlQuads = y2r.convert(yaml);
const rmlQuads = [];
const parser = new N3.Parser();
@@ -52,10 +67,12 @@ function compareY2R2RData(yaml, ttl, cb) {
if (quad)
rmlQuads.push(quad);
else {
- if (error) {
- return cb(error);
+ try {
+ assert(isomorphic(yamlQuads, rmlQuads), true);
+ } catch (e) {
+ assert.deepStrictEqual(yamlQuads, rmlQuads);
+ assert(false, true);
}
- assert(isomorphic(yamlQuads, rmlQuads), true);
cb();
}
});
@@ -74,6 +91,7 @@ function logReadable(triples, base = null, cb = (err, result) => {
}
let writer = new N3.Writer({prefixes});
makeReadable(triples, writer);
+ compareY2RFiles
writer.end(cb);
}
diff --git a/lib/watcher.js b/lib/watcher.js
index 1a1f5d1..be48a92 100644
--- a/lib/watcher.js
+++ b/lib/watcher.js
@@ -16,7 +16,7 @@ let initial = true;
let toYARRRML;
function watch(input, output, format) {
- inputFile = input;
+ inputFile = input[0];
outputFile = output;
if (!format || format === 'RML') {
diff --git a/package-lock.json b/package-lock.json
index ffb180e..d1aeb5f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@rmlio/yarrrml-parser",
- "version": "1.1.1",
+ "version": "1.2.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -42,9 +42,9 @@
}
},
"ansi-colors": {
- "version": "3.2.3",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
- "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
+ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
"dev": true
},
"ansi-regex": {
@@ -62,6 +62,16 @@
"color-convert": "^1.9.0"
}
},
+ "anymatch": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz",
+ "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==",
+ "dev": true,
+ "requires": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ }
+ },
"argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
@@ -70,6 +80,18 @@
"sprintf-js": "~1.0.2"
}
},
+ "array.prototype.map": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz",
+ "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.17.0-next.1",
+ "es-array-method-boxes-properly": "^1.0.0",
+ "is-string": "^1.0.4"
+ }
+ },
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
@@ -88,6 +110,11 @@
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
+ "author-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/author-regex/-/author-regex-1.0.0.tgz",
+ "integrity": "sha1-0IiFvmubv5Q5/gh8dihyRfCoFFA="
+ },
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
@@ -111,6 +138,12 @@
"tweetnacl": "^0.14.3"
}
},
+ "binary-extensions": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz",
+ "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==",
+ "dev": true
+ },
"bluebird": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
@@ -125,6 +158,15 @@
"concat-map": "0.0.1"
}
},
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
"browser-stdout": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
@@ -169,6 +211,22 @@
}
}
},
+ "chokidar": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz",
+ "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==",
+ "dev": true,
+ "requires": {
+ "anymatch": "~3.1.1",
+ "braces": "~3.0.2",
+ "fsevents": "~2.1.2",
+ "glob-parent": "~5.1.0",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.3.0"
+ }
+ },
"cliui": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
@@ -284,9 +342,9 @@
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"diff": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
- "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
+ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true
},
"ecc-jsbn": {
@@ -305,22 +363,51 @@
"dev": true
},
"es-abstract": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0.tgz",
- "integrity": "sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug==",
+ "version": "1.17.6",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz",
+ "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
- "is-callable": "^1.1.5",
- "is-regex": "^1.0.5",
+ "is-callable": "^1.2.0",
+ "is-regex": "^1.1.0",
"object-inspect": "^1.7.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.0",
- "string.prototype.trimleft": "^2.1.1",
- "string.prototype.trimright": "^2.1.1"
+ "string.prototype.trimend": "^1.0.1",
+ "string.prototype.trimstart": "^1.0.1"
+ }
+ },
+ "es-array-method-boxes-properly": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz",
+ "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==",
+ "dev": true
+ },
+ "es-get-iterator": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz",
+ "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==",
+ "dev": true,
+ "requires": {
+ "es-abstract": "^1.17.4",
+ "has-symbols": "^1.0.1",
+ "is-arguments": "^1.0.4",
+ "is-map": "^2.0.1",
+ "is-set": "^2.0.1",
+ "is-string": "^1.0.5",
+ "isarray": "^2.0.5"
+ },
+ "dependencies": {
+ "isarray": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
+ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
+ "dev": true
+ }
}
},
"es-to-primitive": {
@@ -366,13 +453,23 @@
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
"find-up": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
- "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"requires": {
- "locate-path": "^3.0.0"
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
}
},
"flat": {
@@ -404,6 +501,13 @@
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
+ "fsevents": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
+ "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
+ "dev": true,
+ "optional": true
+ },
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
@@ -425,9 +529,9 @@
}
},
"glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+ "version": "7.1.6",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
+ "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@@ -437,6 +541,15 @@
"path-is-absolute": "^1.0.0"
}
},
+ "glob-parent": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
+ "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
"growl": {
"version": "1.10.5",
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
@@ -508,6 +621,21 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
+ "is-arguments": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz",
+ "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==",
+ "dev": true
+ },
+ "is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "requires": {
+ "binary-extensions": "^2.0.0"
+ }
+ },
"is-buffer": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
@@ -515,9 +643,9 @@
"dev": true
},
"is-callable": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz",
- "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz",
+ "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==",
"dev": true
},
"is-date-object": {
@@ -526,21 +654,60 @@
"integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
"dev": true
},
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
"is-fullwidth-code-point": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"dev": true
},
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-map": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz",
+ "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==",
+ "dev": true
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
"is-regex": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz",
- "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz",
+ "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==",
"dev": true,
"requires": {
- "has": "^1.0.3"
+ "has-symbols": "^1.0.1"
}
},
+ "is-set": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz",
+ "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==",
+ "dev": true
+ },
+ "is-string": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz",
+ "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==",
+ "dev": true
+ },
"is-symbol": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
@@ -571,6 +738,22 @@
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
+ "iterate-iterator": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz",
+ "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==",
+ "dev": true
+ },
+ "iterate-value": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz",
+ "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==",
+ "dev": true,
+ "requires": {
+ "es-get-iterator": "^1.0.2",
+ "iterate-iterator": "^1.0.1"
+ }
+ },
"js-yaml": {
"version": "3.13.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
@@ -632,19 +815,18 @@
}
},
"locate-path": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
- "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"requires": {
- "p-locate": "^3.0.0",
- "path-exists": "^3.0.0"
+ "p-locate": "^4.1.0"
}
},
"lodash": {
- "version": "4.17.15",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
- "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+ "version": "4.17.19",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
+ "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"dev": true
},
"lodash.uniqwith": {
@@ -653,12 +835,12 @@
"integrity": "sha1-egy/ZfQ7WShiWp1NDcVLGMrcfvM="
},
"log-symbols": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
- "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
+ "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==",
"dev": true,
"requires": {
- "chalk": "^2.0.1"
+ "chalk": "^2.4.2"
}
},
"mime-db": {
@@ -682,56 +864,43 @@
"brace-expansion": "^1.1.7"
}
},
- "minimist": {
- "version": "0.0.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
- "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
- "dev": true
- },
- "mkdirp": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
- "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
- "dev": true,
- "requires": {
- "minimist": "0.0.8"
- }
- },
"mocha": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.2.tgz",
- "integrity": "sha512-FgDS9Re79yU1xz5d+C4rv1G7QagNGHZ+iXF81hO8zY35YZZcLEsJVfFolfsqKFWunATEvNzMK0r/CwWd/szO9A==",
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz",
+ "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==",
"dev": true,
"requires": {
- "ansi-colors": "3.2.3",
+ "ansi-colors": "4.1.1",
"browser-stdout": "1.3.1",
+ "chokidar": "3.3.1",
"debug": "3.2.6",
- "diff": "3.5.0",
+ "diff": "4.0.2",
"escape-string-regexp": "1.0.5",
- "find-up": "3.0.0",
- "glob": "7.1.3",
+ "find-up": "4.1.0",
+ "glob": "7.1.6",
"growl": "1.10.5",
"he": "1.2.0",
"js-yaml": "3.13.1",
- "log-symbols": "2.2.0",
+ "log-symbols": "3.0.0",
"minimatch": "3.0.4",
- "mkdirp": "0.5.1",
- "ms": "2.1.1",
- "node-environment-flags": "1.0.5",
+ "ms": "2.1.2",
"object.assign": "4.1.0",
- "strip-json-comments": "2.0.1",
- "supports-color": "6.0.0",
- "which": "1.3.1",
+ "promise.allsettled": "1.0.2",
+ "serialize-javascript": "3.0.0",
+ "strip-json-comments": "3.0.1",
+ "supports-color": "7.1.0",
+ "which": "2.0.2",
"wide-align": "1.1.3",
- "yargs": "13.3.0",
- "yargs-parser": "13.1.1",
+ "workerpool": "6.0.0",
+ "yargs": "13.3.2",
+ "yargs-parser": "13.1.2",
"yargs-unparser": "1.6.0"
},
"dependencies": {
"glob": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
- "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
+ "version": "7.1.6",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
+ "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
@@ -745,9 +914,9 @@
}
},
"ms": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
- "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"n3": {
@@ -755,30 +924,26 @@
"resolved": "https://registry.npmjs.org/n3/-/n3-1.3.5.tgz",
"integrity": "sha512-McWb1tCWGGAmHeGEakqZj/UqxQR9cpEYZ/JivBj59YfiOAuaIWZxu0B+jnhbCwCZ2AsxdgQ5Dq8fehIJpYQaMQ=="
},
- "node-environment-flags": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz",
- "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==",
- "dev": true,
- "requires": {
- "object.getownpropertydescriptors": "^2.0.3",
- "semver": "^5.7.0"
- }
- },
"node-forge": {
"version": "0.8.5",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.5.tgz",
"integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q=="
},
+ "normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "dev": true
+ },
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"object-inspect": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz",
- "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz",
+ "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==",
"dev": true
},
"object-keys": {
@@ -799,16 +964,6 @@
"object-keys": "^1.0.11"
}
},
- "object.getownpropertydescriptors": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz",
- "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==",
- "dev": true,
- "requires": {
- "define-properties": "^1.1.3",
- "es-abstract": "^1.17.0-next.1"
- }
- },
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@@ -818,21 +973,21 @@
}
},
"p-limit": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz",
- "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"requires": {
"p-try": "^2.0.0"
}
},
"p-locate": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
- "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"requires": {
- "p-limit": "^2.0.0"
+ "p-limit": "^2.2.0"
}
},
"p-try": {
@@ -841,10 +996,18 @@
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
+ "parse-author": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/parse-author/-/parse-author-2.0.0.tgz",
+ "integrity": "sha1-00YL8d3Q367tQtp1QkLmX7aEqB8=",
+ "requires": {
+ "author-regex": "^1.0.0"
+ }
+ },
"path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true
},
"path-is-absolute": {
@@ -857,6 +1020,12 @@
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
+ "picomatch": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
+ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
+ "dev": true
+ },
"pkginfo": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz",
@@ -872,6 +1041,19 @@
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
},
+ "promise.allsettled": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz",
+ "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==",
+ "dev": true,
+ "requires": {
+ "array.prototype.map": "^1.0.1",
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.17.0-next.1",
+ "function-bind": "^1.1.1",
+ "iterate-value": "^1.0.0"
+ }
+ },
"psl": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz",
@@ -1038,6 +1220,15 @@
"util-deprecate": "~1.0.1"
}
},
+ "readdirp": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz",
+ "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==",
+ "dev": true,
+ "requires": {
+ "picomatch": "^2.0.7"
+ }
+ },
"request": {
"version": "2.88.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
@@ -1094,10 +1285,10 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
- "semver": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
- "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "serialize-javascript": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz",
+ "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==",
"dev": true
},
"set-blocking": {
@@ -1137,24 +1328,24 @@
"strip-ansi": "^4.0.0"
}
},
- "string.prototype.trimleft": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz",
- "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==",
+ "string.prototype.trimend": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz",
+ "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
- "function-bind": "^1.1.1"
+ "es-abstract": "^1.17.5"
}
},
- "string.prototype.trimright": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz",
- "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==",
+ "string.prototype.trimstart": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz",
+ "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==",
"dev": true,
"requires": {
"define-properties": "^1.1.3",
- "function-bind": "^1.1.1"
+ "es-abstract": "^1.17.5"
}
},
"string_decoder": {
@@ -1175,18 +1366,35 @@
}
},
"strip-json-comments": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
+ "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==",
"dev": true
},
"supports-color": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz",
- "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
+ "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"dev": true,
"requires": {
- "has-flag": "^3.0.0"
+ "has-flag": "^4.0.0"
+ },
+ "dependencies": {
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ }
+ }
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "requires": {
+ "is-number": "^7.0.0"
}
},
"tough-cookie": {
@@ -1247,9 +1455,9 @@
}
},
"which": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
@@ -1270,6 +1478,12 @@
"string-width": "^1.0.2 || 2"
}
},
+ "workerpool": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz",
+ "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==",
+ "dev": true
+ },
"wrap-ansi": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
@@ -1335,9 +1549,9 @@
}
},
"yargs": {
- "version": "13.3.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
- "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
+ "version": "13.3.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
+ "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==",
"dev": true,
"requires": {
"cliui": "^5.0.0",
@@ -1349,7 +1563,7 @@
"string-width": "^3.0.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
- "yargs-parser": "^13.1.1"
+ "yargs-parser": "^13.1.2"
},
"dependencies": {
"ansi-regex": {
@@ -1358,6 +1572,40 @@
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "path-exists": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+ "dev": true
+ },
"string-width": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
@@ -1381,9 +1629,9 @@
}
},
"yargs-parser": {
- "version": "13.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
- "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
+ "version": "13.1.2",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
+ "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
"dev": true,
"requires": {
"camelcase": "^5.0.0",
diff --git a/package.json b/package.json
index 7cde844..6610238 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@rmlio/yarrrml-parser",
- "version": "1.1.1",
+ "version": "1.2.0",
"description": "Parse YARRRML descriptions into RML RDF statements",
"main": "lib/yarrrml2rml.js",
"scripts": {
@@ -20,7 +20,9 @@
"dependencies": {
"commander": "^2.20.3",
"extend": "^3.0.2",
+ "glob": "^7.1.6",
"n3": "^1.3.5",
+ "parse-author": "^2.0.0",
"pkginfo": "^0.4.1",
"prefix-ns": "^0.1.2",
"q": "^1.5.1",
@@ -31,7 +33,7 @@
"yamljs": "^0.3.0"
},
"devDependencies": {
- "mocha": "^6.2.2"
+ "mocha": "^8.0.1"
},
"bin": {
"yarrrml-parser": "./bin/parser.js",
diff --git a/test/author/array-with-objects/mapping.rml.ttl b/test/author/array-with-objects/mapping.rml.ttl
new file mode 100644
index 0000000..69a3326
--- /dev/null
+++ b/test/author/array-with-objects/mapping.rml.ttl
@@ -0,0 +1,43 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix ex: .
+
+:rules_000 a void:Dataset;
+ dc:contributor :person_000.
+:person_000 dc:contributor foaf:Person;
+ rdfs:label "John Doe";
+ foaf:mbox .
+:rules_000 dc:contributor :person_001.
+:person_001 dc:contributor foaf:Person;
+ rdfs:label "Jane Doe";
+ foaf:homepage .
+:rules_000 void:exampleResource :map_person_000.
+:map_person_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
+ rml:source "data.json";
+ rml:iterator "$.persons[*]";
+ rml:referenceFormulation ql:JSONPath.
+:map_person_000 a rr:TriplesMap;
+ rdfs:label "person".
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.com/{firstname}".
+:pom_000 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
+ rr:constant "http://example.com/Person";
+ rr:termType rr:IRI.
diff --git a/test/author/array-with-objects/mapping.yarrrml b/test/author/array-with-objects/mapping.yarrrml
new file mode 100644
index 0000000..9996df0
--- /dev/null
+++ b/test/author/array-with-objects/mapping.yarrrml
@@ -0,0 +1,16 @@
+prefixes:
+ ex: "http://example.com/"
+
+authors:
+ - name: John Doe
+ email: john@doe.com
+ - name: Jane Doe
+ website: https://janedoe.com
+
+mappings:
+ person:
+ sources:
+ - ['data.json~jsonpath', '$.persons[*]']
+ s: http://example.com/$(firstname)
+ po:
+ - [a, ex:Person]
diff --git a/test/author/array-with-strings/mapping.rml.ttl b/test/author/array-with-strings/mapping.rml.ttl
new file mode 100644
index 0000000..69a3326
--- /dev/null
+++ b/test/author/array-with-strings/mapping.rml.ttl
@@ -0,0 +1,43 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix ex: .
+
+:rules_000 a void:Dataset;
+ dc:contributor :person_000.
+:person_000 dc:contributor foaf:Person;
+ rdfs:label "John Doe";
+ foaf:mbox .
+:rules_000 dc:contributor :person_001.
+:person_001 dc:contributor foaf:Person;
+ rdfs:label "Jane Doe";
+ foaf:homepage .
+:rules_000 void:exampleResource :map_person_000.
+:map_person_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
+ rml:source "data.json";
+ rml:iterator "$.persons[*]";
+ rml:referenceFormulation ql:JSONPath.
+:map_person_000 a rr:TriplesMap;
+ rdfs:label "person".
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.com/{firstname}".
+:pom_000 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
+ rr:constant "http://example.com/Person";
+ rr:termType rr:IRI.
diff --git a/test/author/array-with-strings/mapping.yarrrml b/test/author/array-with-strings/mapping.yarrrml
new file mode 100644
index 0000000..bd9aaad
--- /dev/null
+++ b/test/author/array-with-strings/mapping.yarrrml
@@ -0,0 +1,14 @@
+prefixes:
+ ex: "http://example.com/"
+
+authors:
+ - John Doe
+ - Jane Doe (https://janedoe.com)
+
+mappings:
+ person:
+ sources:
+ - ['data.json~jsonpath', '$.persons[*]']
+ s: http://example.com/$(firstname)
+ po:
+ - [a, ex:Person]
diff --git a/test/author/array-with-webids/mapping.rml.ttl b/test/author/array-with-webids/mapping.rml.ttl
new file mode 100644
index 0000000..b28513d
--- /dev/null
+++ b/test/author/array-with-webids/mapping.rml.ttl
@@ -0,0 +1,36 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix ex: .
+
+:rules_000 a void:Dataset;
+ dc:contributor , ;
+ void:exampleResource :map_person_000.
+:map_person_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
+ rml:source "data.json";
+ rml:iterator "$.persons[*]";
+ rml:referenceFormulation ql:JSONPath.
+:map_person_000 a rr:TriplesMap;
+ rdfs:label "person".
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.com/{firstname}".
+:pom_000 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
+ rr:constant "http://example.com/Person";
+ rr:termType rr:IRI.
diff --git a/test/author/array-with-webids/mapping.yarrrml b/test/author/array-with-webids/mapping.yarrrml
new file mode 100644
index 0000000..0de3c60
--- /dev/null
+++ b/test/author/array-with-webids/mapping.yarrrml
@@ -0,0 +1,14 @@
+prefixes:
+ ex: "http://example.com/"
+
+authors:
+ - http://johndoe.com/#me
+ - http://janedoe.com/#me
+
+mappings:
+ person:
+ sources:
+ - ['data.json~jsonpath', '$.persons[*]']
+ s: http://example.com/$(firstname)
+ po:
+ - [a, ex:Person]
diff --git a/test/author/single-string/mapping.rml.ttl b/test/author/single-string/mapping.rml.ttl
new file mode 100644
index 0000000..3023e58
--- /dev/null
+++ b/test/author/single-string/mapping.rml.ttl
@@ -0,0 +1,39 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix ex: .
+
+:rules_000 a void:Dataset;
+ dc:contributor :person_000.
+:person_000 dc:contributor foaf:Person;
+ rdfs:label "John Doe";
+ foaf:mbox .
+:rules_000 void:exampleResource :map_person_000.
+:map_person_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
+ rml:source "data.json";
+ rml:iterator "$.persons[*]";
+ rml:referenceFormulation ql:JSONPath.
+:map_person_000 a rr:TriplesMap;
+ rdfs:label "person".
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.com/{firstname}".
+:pom_000 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
+ rr:constant "http://example.com/Person";
+ rr:termType rr:IRI.
diff --git a/test/author/single-string/mapping.yarrrml b/test/author/single-string/mapping.yarrrml
new file mode 100644
index 0000000..f52d2ee
--- /dev/null
+++ b/test/author/single-string/mapping.yarrrml
@@ -0,0 +1,12 @@
+prefixes:
+ ex: "http://example.com/"
+
+authors: John Doe
+
+mappings:
+ person:
+ sources:
+ - ['data.json~jsonpath', '$.persons[*]']
+ s: http://example.com/$(firstname)
+ po:
+ - [a, ex:Person]
diff --git a/test/betweenourworlds/anime/mapping.rml.ttl b/test/betweenourworlds/anime/mapping.rml.ttl
new file mode 100644
index 0000000..c9ef665
--- /dev/null
+++ b/test/betweenourworlds/anime/mapping.rml.ttl
@@ -0,0 +1,489 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix afn: .
+@prefix bow: .
+@prefix dbo: .
+
+:source_000 a rml:LogicalSource;
+ rdfs:label "anime_source";
+ rml:source "anime-0.json";
+ rml:iterator "$.data[*]";
+ rml:referenceFormulation ql:JSONPath.
+:source_001 a rml:LogicalSource;
+ rdfs:label "stream_source";
+ rml:source "anime-streams-0.json";
+ rml:iterator "$.[*]";
+ rml:referenceFormulation ql:JSONPath.
+:source_002 a rml:LogicalSource;
+ rdfs:label "episode_source";
+ rml:source "anime-episodes-0.json";
+ rml:iterator "$.[*]";
+ rml:referenceFormulation ql:JSONPath.
+:source_003 a rml:LogicalSource;
+ rdfs:label "season_source";
+ rml:source "anime-seasons-0.json";
+ rml:iterator "$.[*]";
+ rml:referenceFormulation ql:JSONPath.
+:map_anime_000 rml:logicalSource :source_000;
+ a rr:TriplesMap;
+ rdfs:label "anime".
+:s_000 a rr:SubjectMap.
+:map_anime_000 rr:subjectMap :s_000.
+:s_000 rr:template "https://betweenourworlds.org/anime/{attributes.slug}".
+:pom_000 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
+ rr:constant "http://dbpedia.org/ontology/Work";
+ rr:termType rr:IRI.
+:pom_000 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap;
+ rr:constant "http://dbpedia.org/ontology/Cartoon";
+ rr:termType rr:IRI.
+:pom_000 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
+ rr:constant "http://dbpedia.org/ontology/Anime";
+ rr:termType rr:IRI.
+:pom_000 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
+ rr:constant "http://schema.org/Thing";
+ rr:termType rr:IRI.
+:pom_000 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
+ rr:constant "http://schema.org/CreativeWork";
+ rr:termType rr:IRI.
+:pom_001 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_001.
+:pm_001 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_001.
+:pm_001 rr:constant .
+:pm_002 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_002.
+:pm_002 rr:constant rdfs:label.
+:pm_003 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_003.
+:pm_003 rr:constant dbo:title.
+:pom_001 rr:objectMap :om_005.
+:om_005 a rr:ObjectMap;
+ rml:reference "attributes.canonicalTitle";
+ rr:termType rr:Literal.
+:pom_002 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_002.
+:pm_004 a rr:PredicateMap.
+:pom_002 rr:predicateMap :pm_004.
+:pm_004 rr:constant .
+:pm_005 a rr:PredicateMap.
+:pom_002 rr:predicateMap :pm_005.
+:pm_005 rr:constant rdfs:label.
+:pm_006 a rr:PredicateMap.
+:pom_002 rr:predicateMap :pm_006.
+:pm_006 rr:constant dbo:title.
+:pom_002 rr:objectMap :om_006.
+:om_006 a rr:ObjectMap;
+ rml:reference "attributes.titles.en";
+ rr:termType rr:Literal;
+ rr:language "en".
+:pom_003 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_003.
+:pm_007 a rr:PredicateMap.
+:pom_003 rr:predicateMap :pm_007.
+:pm_007 rr:constant .
+:pm_008 a rr:PredicateMap.
+:pom_003 rr:predicateMap :pm_008.
+:pm_008 rr:constant rdfs:label.
+:pm_009 a rr:PredicateMap.
+:pom_003 rr:predicateMap :pm_009.
+:pm_009 rr:constant dbo:title.
+:pom_003 rr:objectMap :om_007.
+:om_007 a rr:ObjectMap;
+ rml:reference "attributes.titles.en_jp";
+ rr:termType rr:Literal;
+ rr:language "ja".
+:pom_004 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_004.
+:pm_010 a rr:PredicateMap.
+:pom_004 rr:predicateMap :pm_010.
+:pm_010 rr:constant .
+:pm_011 a rr:PredicateMap.
+:pom_004 rr:predicateMap :pm_011.
+:pm_011 rr:constant rdfs:label.
+:pm_012 a rr:PredicateMap.
+:pom_004 rr:predicateMap :pm_012.
+:pm_012 rr:constant dbo:title.
+:pom_004 rr:objectMap :om_008.
+:om_008 a rr:ObjectMap;
+ rml:reference "attributes.titles.ja_jp";
+ rr:termType rr:Literal;
+ rr:language "ja".
+:pom_005 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_005.
+:pm_013 a rr:PredicateMap.
+:pom_005 rr:predicateMap :pm_013.
+:pm_013 rr:constant .
+:pm_014 a rr:PredicateMap.
+:pom_005 rr:predicateMap :pm_014.
+:pm_014 rr:constant dbo:numberOfEpisodes.
+:pom_005 rr:objectMap :om_009.
+:om_009 a rr:ObjectMap;
+ rml:reference "attributes.episodeCount";
+ rr:termType rr:Literal.
+:pom_006 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_006.
+:pm_015 a rr:PredicateMap.
+:pom_006 rr:predicateMap :pm_015.
+:pm_015 rr:constant .
+:pom_006 rr:objectMap :om_010.
+:om_010 a rr:ObjectMap;
+ rml:reference "attributes.ageRating";
+ rr:termType rr:Literal.
+:pom_006 rr:objectMap :om_011.
+:om_011 a rr:ObjectMap;
+ rml:reference "attributes.ageRatingGuide";
+ rr:termType rr:Literal.
+:pom_007 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_007.
+:pm_016 a rr:PredicateMap.
+:pom_007 rr:predicateMap :pm_016.
+:pm_016 rr:constant .
+:pom_007 rr:objectMap :om_012.
+:om_012 a rr:ObjectMap;
+ rml:reference "attributes.coverImage.original";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_008 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_008.
+:pm_017 a rr:PredicateMap.
+:pom_008 rr:predicateMap :pm_017.
+:pm_017 rr:constant .
+:pom_008 rr:objectMap :om_013.
+:om_013 a rr:ObjectMap;
+ rml:reference "attributes.endDate";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_009 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_009.
+:pm_018 a rr:PredicateMap.
+:pom_009 rr:predicateMap :pm_018.
+:pm_018 rr:constant .
+:pom_009 rr:objectMap :om_014.
+:om_014 a rr:ObjectMap;
+ rml:reference "attributes.startDate";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_010 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_010.
+:pm_019 a rr:PredicateMap.
+:pom_010 rr:predicateMap :pm_019.
+:pm_019 rr:constant rdfs:comment.
+:pm_020 a rr:PredicateMap.
+:pom_010 rr:predicateMap :pm_020.
+:pm_020 rr:constant .
+:pom_010 rr:objectMap :om_015.
+:om_015 a rr:ObjectMap;
+ rml:reference "attributes.synopsis";
+ rr:termType rr:Literal.
+:pom_011 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_011.
+:pm_021 a rr:PredicateMap.
+:pom_011 rr:predicateMap :pm_021.
+:pm_021 rr:constant .
+:pom_011 rr:objectMap :om_016.
+:om_016 a rr:ObjectMap;
+ rr:template "https://kitsu.io/anime/{attributes.slug}";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_012 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_012.
+:pm_022 a rr:PredicateMap.
+:pom_012 rr:predicateMap :pm_022.
+:pm_022 rr:constant .
+:pom_012 rr:objectMap :om_017.
+:om_017 a rr:ObjectMap;
+ rml:reference "otherWebsites";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_013 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_013.
+:pm_023 a rr:PredicateMap.
+:pom_013 rr:predicateMap :pm_023.
+:pm_023 rr:constant .
+:pom_013 rr:objectMap :om_018.
+:om_018 a rr:ObjectMap;
+ rml:reference "streams";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_014 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_014.
+:pm_024 a rr:PredicateMap.
+:pom_014 rr:predicateMap :pm_024.
+:pm_024 rr:constant rdf:type.
+:pom_014 rr:objectMap :om_019.
+:om_019 a fnml:FunctionTermMap;
+ rr:termType rr:IRI;
+ fnml:functionValue :fn_000.
+:fn_000 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "https://betweenourworlds.org/function/getClass";
+ rr:termType rr:IRI.
+:fn_000 rr:predicateObjectMap :pom_015.
+:pom_015 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_025.
+:pm_025 a rr:PredicateMap;
+ rr:constant afn:value.
+:pom_015 rr:objectMap :om_020.
+:om_020 a rr:ObjectMap;
+ rml:reference "attributes.subtype";
+ rr:termType rr:Literal.
+:pom_016 a rr:PredicateObjectMap.
+:map_anime_000 rr:predicateObjectMap :pom_016.
+:pm_026 a rr:PredicateMap.
+:pom_016 rr:predicateMap :pm_026.
+:pm_026 rr:constant .
+:pom_016 rr:objectMap :om_021.
+:map_trailer_000 rml:logicalSource :source_000;
+ a rr:TriplesMap;
+ rdfs:label "trailer".
+:s_001 a rr:SubjectMap.
+:map_trailer_000 rr:subjectMap :s_001.
+:s_001 rr:template "https://betweenourworlds.org/trailer/{attributes.slug}".
+:pom_017 a rr:PredicateObjectMap.
+:map_trailer_000 rr:predicateObjectMap :pom_017.
+:pm_027 a rr:PredicateMap.
+:pom_017 rr:predicateMap :pm_027.
+:pm_027 rr:constant rdf:type.
+:pom_017 rr:objectMap :om_022.
+:om_022 a rr:ObjectMap;
+ rr:constant "http://schema.org/VideoObject";
+ rr:termType rr:IRI.
+:pom_017 rr:objectMap :om_023.
+:om_023 a rr:ObjectMap;
+ rr:constant "http://schema.org/Thing";
+ rr:termType rr:IRI.
+:pom_017 rr:objectMap :om_024.
+:om_024 a rr:ObjectMap;
+ rr:constant "http://schema.org/CreativeWork";
+ rr:termType rr:IRI.
+:pom_017 rr:objectMap :om_025.
+:om_025 a rr:ObjectMap;
+ rr:constant "http://schema.org/MediaObject";
+ rr:termType rr:IRI.
+:pom_018 a rr:PredicateObjectMap.
+:map_trailer_000 rr:predicateObjectMap :pom_018.
+:pm_028 a rr:PredicateMap.
+:pom_018 rr:predicateMap :pm_028.
+:pm_028 rr:constant .
+:pom_018 rr:objectMap :om_026.
+:om_026 a rr:ObjectMap;
+ rr:template "https://www.youtube.com/watch?v={attributes.youtubeVideoId}";
+ rr:termType rr:Literal.
+:map_stream_000 rml:logicalSource :source_001;
+ a rr:TriplesMap;
+ rdfs:label "stream".
+:s_002 a rr:SubjectMap.
+:map_stream_000 rr:subjectMap :s_002.
+:s_002 rr:template "https://betweenourworlds.org/stream/{slug}-{service}".
+:pom_019 a rr:PredicateObjectMap.
+:map_stream_000 rr:predicateObjectMap :pom_019.
+:pm_029 a rr:PredicateMap.
+:pom_019 rr:predicateMap :pm_029.
+:pm_029 rr:constant rdf:type.
+:pom_019 rr:objectMap :om_027.
+:om_027 a rr:ObjectMap;
+ rr:constant "https://betweenourworlds.org/ontology/Stream";
+ rr:termType rr:IRI.
+:pom_020 a rr:PredicateObjectMap.
+:map_stream_000 rr:predicateObjectMap :pom_020.
+:pm_030 a rr:PredicateMap.
+:pom_020 rr:predicateMap :pm_030.
+:pm_030 rr:constant .
+:pom_020 rr:objectMap :om_028.
+:om_028 a rr:ObjectMap;
+ rml:reference "url";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_021 a rr:PredicateObjectMap.
+:map_stream_000 rr:predicateObjectMap :pom_021.
+:pm_031 a rr:PredicateMap.
+:pom_021 rr:predicateMap :pm_031.
+:pm_031 rr:constant bow:providedBy.
+:pom_021 rr:objectMap :om_029.
+:om_029 a fnml:FunctionTermMap;
+ rr:termType rr:IRI;
+ fnml:functionValue :fn_001.
+:fn_001 rml:logicalSource :source_001;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "https://betweenourworlds.org/function/getStreamAgent";
+ rr:termType rr:IRI.
+:fn_001 rr:predicateObjectMap :pom_022.
+:pom_022 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_032.
+:pm_032 a rr:PredicateMap;
+ rr:constant afn:value.
+:pom_022 rr:objectMap :om_030.
+:om_030 a rr:ObjectMap;
+ rml:reference "service";
+ rr:termType rr:Literal.
+:pom_023 a rr:PredicateObjectMap.
+:map_stream_000 rr:predicateObjectMap :pom_023.
+:pm_033 a rr:PredicateMap.
+:pom_023 rr:predicateMap :pm_033.
+:pm_033 rr:constant bow:object.
+:pom_023 rr:objectMap :om_031.
+:map_episode_000 rml:logicalSource :source_002;
+ a rr:TriplesMap;
+ rdfs:label "episode".
+:s_003 a rr:SubjectMap.
+:map_episode_000 rr:subjectMap :s_003.
+:s_003 rr:template "https://betweenourworlds.org/episode/{anime_slug}-{attributes.number}".
+:pom_024 a rr:PredicateObjectMap.
+:map_episode_000 rr:predicateObjectMap :pom_024.
+:pm_034 a rr:PredicateMap.
+:pom_024 rr:predicateMap :pm_034.
+:pm_034 rr:constant rdf:type.
+:pom_024 rr:objectMap :om_032.
+:om_032 a rr:ObjectMap;
+ rr:constant "http://schema.org/Episode";
+ rr:termType rr:IRI.
+:pom_024 rr:objectMap :om_033.
+:om_033 a rr:ObjectMap;
+ rr:constant "http://schema.org/CreativeWork";
+ rr:termType rr:IRI.
+:pom_024 rr:objectMap :om_034.
+:om_034 a rr:ObjectMap;
+ rr:constant "http://schema.org/Thing";
+ rr:termType rr:IRI.
+:pom_025 a rr:PredicateObjectMap.
+:map_episode_000 rr:predicateObjectMap :pom_025.
+:pm_035 a rr:PredicateMap.
+:pom_025 rr:predicateMap :pm_035.
+:pm_035 rr:constant .
+:pm_036 a rr:PredicateMap.
+:pom_025 rr:predicateMap :pm_036.
+:pm_036 rr:constant rdfs:label.
+:pm_037 a rr:PredicateMap.
+:pom_025 rr:predicateMap :pm_037.
+:pm_037 rr:constant dbo:title.
+:pom_025 rr:objectMap :om_035.
+:om_035 a rr:ObjectMap;
+ rml:reference "attributes.canonicalTitle";
+ rr:termType rr:Literal.
+:pom_026 a rr:PredicateObjectMap.
+:map_episode_000 rr:predicateObjectMap :pom_026.
+:pm_038 a rr:PredicateMap.
+:pom_026 rr:predicateMap :pm_038.
+:pm_038 rr:constant .
+:pom_026 rr:objectMap :om_036.
+:om_036 a rr:ObjectMap;
+ rml:reference "attributes.relativeNumber";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_027 a rr:PredicateObjectMap.
+:map_episode_000 rr:predicateObjectMap :pom_027.
+:pm_039 a rr:PredicateMap.
+:pom_027 rr:predicateMap :pm_039.
+:pm_039 rr:constant rdfs:comment.
+:pm_040 a rr:PredicateMap.
+:pom_027 rr:predicateMap :pm_040.
+:pm_040 rr:constant .
+:pom_027 rr:objectMap :om_037.
+:om_037 a rr:ObjectMap;
+ rml:reference "attributes.synopsis";
+ rr:termType rr:Literal.
+:pom_028 a rr:PredicateObjectMap.
+:map_episode_000 rr:predicateObjectMap :pom_028.
+:pm_041 a rr:PredicateMap.
+:pom_028 rr:predicateMap :pm_041.
+:pm_041 rr:constant .
+:pom_028 rr:objectMap :om_038.
+:pom_029 a rr:PredicateObjectMap.
+:map_episode_000 rr:predicateObjectMap :pom_029.
+:pm_042 a rr:PredicateMap.
+:pom_029 rr:predicateMap :pm_042.
+:pm_042 rr:constant .
+:pom_029 rr:objectMap :om_039.
+:map_season_000 rml:logicalSource :source_003;
+ a rr:TriplesMap;
+ rdfs:label "season".
+:s_004 a rr:SubjectMap.
+:map_season_000 rr:subjectMap :s_004.
+:s_004 rr:template "https://betweenourworlds.org/season/{anime.slug}-{seasonNumber}".
+:pom_030 a rr:PredicateObjectMap.
+:map_season_000 rr:predicateObjectMap :pom_030.
+:pm_043 a rr:PredicateMap.
+:pom_030 rr:predicateMap :pm_043.
+:pm_043 rr:constant rdf:type.
+:pom_030 rr:objectMap :om_040.
+:om_040 a rr:ObjectMap;
+ rr:constant "http://schema.org/Season";
+ rr:termType rr:IRI.
+:pom_030 rr:objectMap :om_041.
+:om_041 a rr:ObjectMap;
+ rr:constant "http://schema.org/CreativeWork";
+ rr:termType rr:IRI.
+:pom_030 rr:objectMap :om_042.
+:om_042 a rr:ObjectMap;
+ rr:constant "http://schema.org/Thing";
+ rr:termType rr:IRI.
+:pom_031 a rr:PredicateObjectMap.
+:map_season_000 rr:predicateObjectMap :pom_031.
+:pm_044 a rr:PredicateMap.
+:pom_031 rr:predicateMap :pm_044.
+:pm_044 rr:constant .
+:pom_031 rr:objectMap :om_043.
+:om_043 a rr:ObjectMap;
+ rml:reference "seasonNumber";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_032 a rr:PredicateObjectMap.
+:map_season_000 rr:predicateObjectMap :pom_032.
+:pm_045 a rr:PredicateMap.
+:pom_032 rr:predicateMap :pm_045.
+:pm_045 rr:constant .
+:pom_032 rr:objectMap :om_044.
+:om_021 a rr:ObjectMap;
+ rr:parentTriplesMap :map_trailer_000;
+ rr:joinCondition :jc_000.
+:jc_000 rr:child "attributes.slug";
+ rr:parent "attributes.slug".
+:om_031 a rr:ObjectMap;
+ rr:parentTriplesMap :map_anime_000;
+ rr:joinCondition :jc_001.
+:jc_001 rr:child "slug";
+ rr:parent "attributes.slug".
+:om_038 a rr:ObjectMap;
+ rr:parentTriplesMap :map_season_000;
+ rr:joinCondition :jc_002.
+:jc_002 rr:child "attributes.seasonNumber";
+ rr:parent "seasonNumber".
+:om_038 rr:joinCondition :jc_003.
+:jc_003 rr:child "anime_id";
+ rr:parent "anime.id".
+:om_039 a rr:ObjectMap;
+ rr:parentTriplesMap :map_anime_000;
+ rr:joinCondition :jc_004.
+:jc_004 rr:child "anime_id";
+ rr:parent "id".
+:om_044 a rr:ObjectMap;
+ rr:parentTriplesMap :map_anime_000;
+ rr:joinCondition :jc_005.
+:jc_005 rr:child "anime.id";
+ rr:parent "id".
diff --git a/test/betweenourworlds/rules-anime.yml b/test/betweenourworlds/anime/mapping.yarrrml
similarity index 100%
rename from test/betweenourworlds/rules-anime.yml
rename to test/betweenourworlds/anime/mapping.yarrrml
diff --git a/test/betweenourworlds/character/mapping.rml.ttl b/test/betweenourworlds/character/mapping.rml.ttl
new file mode 100644
index 0000000..a6048f0
--- /dev/null
+++ b/test/betweenourworlds/character/mapping.rml.ttl
@@ -0,0 +1,127 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix ex: .
+@prefix bow: .
+@prefix dbo: .
+
+:map_character_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
+ rml:source "character-0.json";
+ rml:iterator "$.data[*]";
+ rml:referenceFormulation ql:JSONPath.
+:map_character_000 a rr:TriplesMap;
+ rdfs:label "character".
+:s_000 a rr:SubjectMap.
+:map_character_000 rr:subjectMap :s_000.
+:s_000 rr:template "https://betweenourworlds.org/character/{attributes.slug}".
+:pom_000 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
+ rr:constant "https://betweenourworlds.org/ontology/Character";
+ rr:termType rr:IRI.
+:pom_000 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap;
+ rr:constant "http://schema.org/Thing";
+ rr:termType rr:IRI.
+:pom_001 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_001.
+:pm_001 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_001.
+:pm_001 rr:constant rdfs:label.
+:pm_002 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_002.
+:pm_002 rr:constant .
+:pm_003 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_003.
+:pm_003 rr:constant dbo:title.
+:pom_001 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
+ rml:reference "attributes.name";
+ rr:termType rr:Literal.
+:pom_002 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_002.
+:pm_004 a rr:PredicateMap.
+:pom_002 rr:predicateMap :pm_004.
+:pm_004 rr:constant rdfs:label.
+:pm_005 a rr:PredicateMap.
+:pom_002 rr:predicateMap :pm_005.
+:pm_005 rr:constant .
+:pm_006 a rr:PredicateMap.
+:pom_002 rr:predicateMap :pm_006.
+:pm_006 rr:constant dbo:title.
+:pom_002 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
+ rml:reference "attributes.names.en";
+ rr:termType rr:Literal;
+ rr:language "en".
+:pom_003 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_003.
+:pm_007 a rr:PredicateMap.
+:pom_003 rr:predicateMap :pm_007.
+:pm_007 rr:constant rdfs:label.
+:pm_008 a rr:PredicateMap.
+:pom_003 rr:predicateMap :pm_008.
+:pm_008 rr:constant .
+:pm_009 a rr:PredicateMap.
+:pom_003 rr:predicateMap :pm_009.
+:pm_009 rr:constant dbo:title.
+:pom_003 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
+ rml:reference "attributes.names.ja_jp";
+ rr:termType rr:Literal;
+ rr:language "ja".
+:pom_004 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_004.
+:pm_010 a rr:PredicateMap.
+:pom_004 rr:predicateMap :pm_010.
+:pm_010 rr:constant .
+:pom_004 rr:objectMap :om_005.
+:om_005 a rr:ObjectMap;
+ rr:template "https://myanimelist.net/character/{attributes.malId}";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_005 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_005.
+:pm_011 a rr:PredicateMap.
+:pom_005 rr:predicateMap :pm_011.
+:pm_011 rr:constant .
+:pm_012 a rr:PredicateMap.
+:pom_005 rr:predicateMap :pm_012.
+:pm_012 rr:constant rdfs:comment.
+:pom_005 rr:objectMap :om_006.
+:om_006 a rr:ObjectMap;
+ rml:reference "attributes.description";
+ rr:termType rr:Literal.
+:pom_006 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_006.
+:pm_013 a rr:PredicateMap.
+:pom_006 rr:predicateMap :pm_013.
+:pm_013 rr:constant .
+:pom_006 rr:objectMap :om_007.
+:om_007 a rr:ObjectMap;
+ rml:reference "attributes.image.original";
+ rr:termType rr:Literal;
+ rr:datatype .
+:pom_007 a rr:PredicateObjectMap.
+:map_character_000 rr:predicateObjectMap :pom_007.
+:pm_014 a rr:PredicateMap.
+:pom_007 rr:predicateMap :pm_014.
+:pm_014 rr:constant .
+:pom_007 rr:objectMap :om_008.
+:om_008 a rr:ObjectMap;
+ rml:reference "attributes.otherNames";
+ rr:termType rr:Literal.
diff --git a/test/betweenourworlds/rules-character.yml b/test/betweenourworlds/character/mapping.yarrrml
similarity index 100%
rename from test/betweenourworlds/rules-character.yml
rename to test/betweenourworlds/character/mapping.yarrrml
diff --git a/test/betweenourworlds/rules-anime.rml.ttl b/test/betweenourworlds/rules-anime.rml.ttl
deleted file mode 100644
index d143619..0000000
--- a/test/betweenourworlds/rules-anime.rml.ttl
+++ /dev/null
@@ -1,485 +0,0 @@
-@prefix rr: .
-@prefix rdf: .
-@prefix rdfs: .
-@prefix fnml: .
-@prefix fno: .
-@prefix rml: .
-@prefix ql: .
-@prefix : .
-@prefix afn: .
-@prefix bow: .
-@prefix dbo: .
-
-:source_0 a rml:LogicalSource;
- rdfs:label "anime_source";
- rml:source "anime-0.json";
- rml:iterator "$.data[*]";
- rml:referenceFormulation ql:JSONPath.
-:source_1 a rml:LogicalSource;
- rdfs:label "stream_source";
- rml:source "anime-streams-0.json";
- rml:iterator "$.[*]";
- rml:referenceFormulation ql:JSONPath.
-:source_2 a rml:LogicalSource;
- rdfs:label "episode_source";
- rml:source "anime-episodes-0.json";
- rml:iterator "$.[*]";
- rml:referenceFormulation ql:JSONPath.
-:source_3 a rml:LogicalSource;
- rdfs:label "season_source";
- rml:source "anime-seasons-0.json";
- rml:iterator "$.[*]";
- rml:referenceFormulation ql:JSONPath.
-:map_anime_0 rml:logicalSource :source_0;
- a rr:TriplesMap;
- rdfs:label "anime".
-:s_0 a rr:SubjectMap.
-:map_anime_0 rr:subjectMap :s_0.
-:s_0 rr:template "https://betweenourworlds.org/anime/{attributes.slug}".
-:pom_0 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant rdf:type.
-:pom_0 rr:objectMap :om_0.
-:om_0 a rr:ObjectMap;
- rr:constant "http://dbpedia.org/ontology/Work";
- rr:termType rr:IRI.
-:pom_0 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap;
- rr:constant "http://dbpedia.org/ontology/Cartoon";
- rr:termType rr:IRI.
-:pom_0 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
- rr:constant "http://dbpedia.org/ontology/Anime";
- rr:termType rr:IRI.
-:pom_0 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
- rr:constant "http://schema.org/Thing";
- rr:termType rr:IRI.
-:pom_0 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
- rr:constant "http://schema.org/CreativeWork";
- rr:termType rr:IRI.
-:pom_1 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_1.
-:pm_1 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_1.
-:pm_1 rr:constant .
-:pm_2 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_2.
-:pm_2 rr:constant rdfs:label.
-:pm_3 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_3.
-:pm_3 rr:constant dbo:title.
-:pom_1 rr:objectMap :om_5.
-:om_5 a rr:ObjectMap;
- rml:reference "attributes.canonicalTitle";
- rr:termType rr:Literal.
-:pom_2 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_2.
-:pm_4 a rr:PredicateMap.
-:pom_2 rr:predicateMap :pm_4.
-:pm_4 rr:constant .
-:pm_5 a rr:PredicateMap.
-:pom_2 rr:predicateMap :pm_5.
-:pm_5 rr:constant rdfs:label.
-:pm_6 a rr:PredicateMap.
-:pom_2 rr:predicateMap :pm_6.
-:pm_6 rr:constant dbo:title.
-:pom_2 rr:objectMap :om_6.
-:om_6 a rr:ObjectMap;
- rml:reference "attributes.titles.en";
- rr:termType rr:Literal;
- rr:language "en".
-:pom_3 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_3.
-:pm_7 a rr:PredicateMap.
-:pom_3 rr:predicateMap :pm_7.
-:pm_7 rr:constant .
-:pm_8 a rr:PredicateMap.
-:pom_3 rr:predicateMap :pm_8.
-:pm_8 rr:constant rdfs:label.
-:pm_9 a rr:PredicateMap.
-:pom_3 rr:predicateMap :pm_9.
-:pm_9 rr:constant dbo:title.
-:pom_3 rr:objectMap :om_7.
-:om_7 a rr:ObjectMap;
- rml:reference "attributes.titles.en_jp";
- rr:termType rr:Literal;
- rr:language "ja".
-:pom_4 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_4.
-:pm_10 a rr:PredicateMap.
-:pom_4 rr:predicateMap :pm_10.
-:pm_10 rr:constant .
-:pm_11 a rr:PredicateMap.
-:pom_4 rr:predicateMap :pm_11.
-:pm_11 rr:constant rdfs:label.
-:pm_12 a rr:PredicateMap.
-:pom_4 rr:predicateMap :pm_12.
-:pm_12 rr:constant dbo:title.
-:pom_4 rr:objectMap :om_8.
-:om_8 a rr:ObjectMap;
- rml:reference "attributes.titles.ja_jp";
- rr:termType rr:Literal;
- rr:language "ja".
-:pom_5 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_5.
-:pm_13 a rr:PredicateMap.
-:pom_5 rr:predicateMap :pm_13.
-:pm_13 rr:constant .
-:pm_14 a rr:PredicateMap.
-:pom_5 rr:predicateMap :pm_14.
-:pm_14 rr:constant dbo:numberOfEpisodes.
-:pom_5 rr:objectMap :om_9.
-:om_9 a rr:ObjectMap;
- rml:reference "attributes.episodeCount";
- rr:termType rr:Literal.
-:pom_6 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_6.
-:pm_15 a rr:PredicateMap.
-:pom_6 rr:predicateMap :pm_15.
-:pm_15 rr:constant .
-:pom_6 rr:objectMap :om_10.
-:om_10 a rr:ObjectMap;
- rml:reference "attributes.ageRating";
- rr:termType rr:Literal.
-:pom_6 rr:objectMap :om_11.
-:om_11 a rr:ObjectMap;
- rml:reference "attributes.ageRatingGuide";
- rr:termType rr:Literal.
-:pom_7 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_7.
-:pm_16 a rr:PredicateMap.
-:pom_7 rr:predicateMap :pm_16.
-:pm_16 rr:constant .
-:pom_7 rr:objectMap :om_12.
-:om_12 a rr:ObjectMap;
- rml:reference "attributes.coverImage.original";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_8 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_8.
-:pm_17 a rr:PredicateMap.
-:pom_8 rr:predicateMap :pm_17.
-:pm_17 rr:constant .
-:pom_8 rr:objectMap :om_13.
-:om_13 a rr:ObjectMap;
- rml:reference "attributes.endDate";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_9 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_9.
-:pm_18 a rr:PredicateMap.
-:pom_9 rr:predicateMap :pm_18.
-:pm_18 rr:constant .
-:pom_9 rr:objectMap :om_14.
-:om_14 a rr:ObjectMap;
- rml:reference "attributes.startDate";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_10 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_10.
-:pm_19 a rr:PredicateMap.
-:pom_10 rr:predicateMap :pm_19.
-:pm_19 rr:constant rdfs:comment.
-:pm_20 a rr:PredicateMap.
-:pom_10 rr:predicateMap :pm_20.
-:pm_20 rr:constant .
-:pom_10 rr:objectMap :om_15.
-:om_15 a rr:ObjectMap;
- rml:reference "attributes.synopsis";
- rr:termType rr:Literal.
-:pom_11 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_11.
-:pm_21 a rr:PredicateMap.
-:pom_11 rr:predicateMap :pm_21.
-:pm_21 rr:constant .
-:pom_11 rr:objectMap :om_16.
-:om_16 a rr:ObjectMap;
- rr:template "https://kitsu.io/anime/{attributes.slug}";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_12 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_12.
-:pm_22 a rr:PredicateMap.
-:pom_12 rr:predicateMap :pm_22.
-:pm_22 rr:constant .
-:pom_12 rr:objectMap :om_17.
-:om_17 a rr:ObjectMap;
- rml:reference "otherWebsites";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_13 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_13.
-:pm_23 a rr:PredicateMap.
-:pom_13 rr:predicateMap :pm_23.
-:pm_23 rr:constant .
-:pom_13 rr:objectMap :om_18.
-:om_18 a rr:ObjectMap;
- rml:reference "streams";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_14 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_14.
-:pm_24 a rr:PredicateMap.
-:pom_14 rr:predicateMap :pm_24.
-:pm_24 rr:constant rdf:type.
-:pom_14 rr:objectMap :om_19.
-:om_19 a fnml:FunctionTermMap;
- rr:termType rr:IRI;
- fnml:functionValue :fn_0.
-:fn_0 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "https://betweenourworlds.org/function/getClass";
- rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_15.
-:pom_15 a rr:PredicateObjectMap;
- rr:predicateMap :pm_25.
-:pm_25 a rr:PredicateMap;
- rr:constant .
-:pom_15 rr:objectMap :om_20.
-:om_20 a rr:ObjectMap;
- rml:reference "attributes.subtype";
- rr:termType rr:Literal.
-:pom_16 a rr:PredicateObjectMap.
-:map_anime_0 rr:predicateObjectMap :pom_16.
-:pm_26 a rr:PredicateMap.
-:pom_16 rr:predicateMap :pm_26.
-:pm_26 rr:constant .
-:pom_16 rr:objectMap :om_21.
-:map_trailer_0 rml:logicalSource :source_0;
- a rr:TriplesMap;
- rdfs:label "trailer".
-:s_1 a rr:SubjectMap.
-:map_trailer_0 rr:subjectMap :s_1.
-:s_1 rr:template "https://betweenourworlds.org/trailer/{attributes.slug}".
-:pom_17 a rr:PredicateObjectMap.
-:map_trailer_0 rr:predicateObjectMap :pom_17.
-:pm_27 a rr:PredicateMap.
-:pom_17 rr:predicateMap :pm_27.
-:pm_27 rr:constant rdf:type.
-:pom_17 rr:objectMap :om_22.
-:om_22 a rr:ObjectMap;
- rr:constant "http://schema.org/VideoObject";
- rr:termType rr:IRI.
-:pom_17 rr:objectMap :om_23.
-:om_23 a rr:ObjectMap;
- rr:constant "http://schema.org/Thing";
- rr:termType rr:IRI.
-:pom_17 rr:objectMap :om_24.
-:om_24 a rr:ObjectMap;
- rr:constant "http://schema.org/CreativeWork";
- rr:termType rr:IRI.
-:pom_17 rr:objectMap :om_25.
-:om_25 a rr:ObjectMap;
- rr:constant "http://schema.org/MediaObject";
- rr:termType rr:IRI.
-:pom_18 a rr:PredicateObjectMap.
-:map_trailer_0 rr:predicateObjectMap :pom_18.
-:pm_28 a rr:PredicateMap.
-:pom_18 rr:predicateMap :pm_28.
-:pm_28 rr:constant .
-:pom_18 rr:objectMap :om_26.
-:om_26 a rr:ObjectMap;
- rr:template "https://www.youtube.com/watch?v={attributes.youtubeVideoId}";
- rr:termType rr:Literal.
-:map_stream_0 rml:logicalSource :source_1;
- a rr:TriplesMap;
- rdfs:label "stream".
-:s_2 a rr:SubjectMap.
-:map_stream_0 rr:subjectMap :s_2.
-:s_2 rr:template "https://betweenourworlds.org/stream/{slug}-{service}".
-:pom_19 a rr:PredicateObjectMap.
-:map_stream_0 rr:predicateObjectMap :pom_19.
-:pm_29 a rr:PredicateMap.
-:pom_19 rr:predicateMap :pm_29.
-:pm_29 rr:constant rdf:type.
-:pom_19 rr:objectMap :om_27.
-:om_27 a rr:ObjectMap;
- rr:constant "https://betweenourworlds.org/ontology/Stream";
- rr:termType rr:IRI.
-:pom_20 a rr:PredicateObjectMap.
-:map_stream_0 rr:predicateObjectMap :pom_20.
-:pm_30 a rr:PredicateMap.
-:pom_20 rr:predicateMap :pm_30.
-:pm_30 rr:constant .
-:pom_20 rr:objectMap :om_28.
-:om_28 a rr:ObjectMap;
- rml:reference "url";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_21 a rr:PredicateObjectMap.
-:map_stream_0 rr:predicateObjectMap :pom_21.
-:pm_31 a rr:PredicateMap.
-:pom_21 rr:predicateMap :pm_31.
-:pm_31 rr:constant bow:providedBy.
-:pom_21 rr:objectMap :om_29.
-:om_29 a fnml:FunctionTermMap;
- rr:termType rr:IRI;
- fnml:functionValue :fn_1.
-:fn_1 rml:logicalSource :source_1;
- rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "https://betweenourworlds.org/function/getStreamAgent";
- rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_22.
-:pom_22 a rr:PredicateObjectMap;
- rr:predicateMap :pm_32.
-:pm_32 a rr:PredicateMap;
- rr:constant .
-:pom_22 rr:objectMap :om_30.
-:om_30 a rr:ObjectMap;
- rml:reference "service";
- rr:termType rr:Literal.
-:pom_23 a rr:PredicateObjectMap.
-:map_stream_0 rr:predicateObjectMap :pom_23.
-:pm_33 a rr:PredicateMap.
-:pom_23 rr:predicateMap :pm_33.
-:pm_33 rr:constant bow:object.
-:pom_23 rr:objectMap :om_31.
-:map_episode_0 rml:logicalSource :source_2;
- a rr:TriplesMap;
- rdfs:label "episode".
-:s_3 a rr:SubjectMap.
-:map_episode_0 rr:subjectMap :s_3.
-:s_3 rr:template "https://betweenourworlds.org/episode/{anime_slug}-{attributes.number}".
-:pom_24 a rr:PredicateObjectMap.
-:map_episode_0 rr:predicateObjectMap :pom_24.
-:pm_34 a rr:PredicateMap.
-:pom_24 rr:predicateMap :pm_34.
-:pm_34 rr:constant rdf:type.
-:pom_24 rr:objectMap :om_32.
-:om_32 a rr:ObjectMap;
- rr:constant "http://schema.org/Episode";
- rr:termType rr:IRI.
-:pom_24 rr:objectMap :om_33.
-:om_33 a rr:ObjectMap;
- rr:constant "http://schema.org/CreativeWork";
- rr:termType rr:IRI.
-:pom_24 rr:objectMap :om_34.
-:om_34 a rr:ObjectMap;
- rr:constant "http://schema.org/Thing";
- rr:termType rr:IRI.
-:pom_25 a rr:PredicateObjectMap.
-:map_episode_0 rr:predicateObjectMap :pom_25.
-:pm_35 a rr:PredicateMap.
-:pom_25 rr:predicateMap :pm_35.
-:pm_35 rr:constant .
-:pm_36 a rr:PredicateMap.
-:pom_25 rr:predicateMap :pm_36.
-:pm_36 rr:constant rdfs:label.
-:pm_37 a rr:PredicateMap.
-:pom_25 rr:predicateMap :pm_37.
-:pm_37 rr:constant dbo:title.
-:pom_25 rr:objectMap :om_35.
-:om_35 a rr:ObjectMap;
- rml:reference "attributes.canonicalTitle";
- rr:termType rr:Literal.
-:pom_26 a rr:PredicateObjectMap.
-:map_episode_0 rr:predicateObjectMap :pom_26.
-:pm_38 a rr:PredicateMap.
-:pom_26 rr:predicateMap :pm_38.
-:pm_38 rr:constant .
-:pom_26 rr:objectMap :om_36.
-:om_36 a rr:ObjectMap;
- rml:reference "attributes.relativeNumber";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_27 a rr:PredicateObjectMap.
-:map_episode_0 rr:predicateObjectMap :pom_27.
-:pm_39 a rr:PredicateMap.
-:pom_27 rr:predicateMap :pm_39.
-:pm_39 rr:constant rdfs:comment.
-:pm_40 a rr:PredicateMap.
-:pom_27 rr:predicateMap :pm_40.
-:pm_40 rr:constant .
-:pom_27 rr:objectMap :om_37.
-:om_37 a rr:ObjectMap;
- rml:reference "attributes.synopsis";
- rr:termType rr:Literal.
-:pom_28 a rr:PredicateObjectMap.
-:map_episode_0 rr:predicateObjectMap :pom_28.
-:pm_41 a rr:PredicateMap.
-:pom_28 rr:predicateMap :pm_41.
-:pm_41 rr:constant .
-:pom_28 rr:objectMap :om_38.
-:pom_29 a rr:PredicateObjectMap.
-:map_episode_0 rr:predicateObjectMap :pom_29.
-:pm_42 a rr:PredicateMap.
-:pom_29 rr:predicateMap :pm_42.
-:pm_42 rr:constant .
-:pom_29 rr:objectMap :om_39.
-:map_season_0 rml:logicalSource :source_3;
- a rr:TriplesMap;
- rdfs:label "season".
-:s_4 a rr:SubjectMap.
-:map_season_0 rr:subjectMap :s_4.
-:s_4 rr:template "https://betweenourworlds.org/season/{anime.slug}-{seasonNumber}".
-:pom_30 a rr:PredicateObjectMap.
-:map_season_0 rr:predicateObjectMap :pom_30.
-:pm_43 a rr:PredicateMap.
-:pom_30 rr:predicateMap :pm_43.
-:pm_43 rr:constant rdf:type.
-:pom_30 rr:objectMap :om_40.
-:om_40 a rr:ObjectMap;
- rr:constant "http://schema.org/Season";
- rr:termType rr:IRI.
-:pom_30 rr:objectMap :om_41.
-:om_41 a rr:ObjectMap;
- rr:constant "http://schema.org/CreativeWork";
- rr:termType rr:IRI.
-:pom_30 rr:objectMap :om_42.
-:om_42 a rr:ObjectMap;
- rr:constant "http://schema.org/Thing";
- rr:termType rr:IRI.
-:pom_31 a rr:PredicateObjectMap.
-:map_season_0 rr:predicateObjectMap :pom_31.
-:pm_44 a rr:PredicateMap.
-:pom_31 rr:predicateMap :pm_44.
-:pm_44 rr:constant .
-:pom_31 rr:objectMap :om_43.
-:om_43 a rr:ObjectMap;
- rml:reference "seasonNumber";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_32 a rr:PredicateObjectMap.
-:map_season_0 rr:predicateObjectMap :pom_32.
-:pm_45 a rr:PredicateMap.
-:pom_32 rr:predicateMap :pm_45.
-:pm_45 rr:constant .
-:pom_32 rr:objectMap :om_44.
-:om_21 a rr:ObjectMap;
- rr:parentTriplesMap :map_trailer_0;
- rr:joinCondition :jc_0.
-:jc_0 rr:child "attributes.slug";
- rr:parent "attributes.slug".
-:om_31 a rr:ObjectMap;
- rr:parentTriplesMap :map_anime_0;
- rr:joinCondition :jc_1.
-:jc_1 rr:child "slug";
- rr:parent "attributes.slug".
-:om_38 a rr:ObjectMap;
- rr:parentTriplesMap :map_season_0;
- rr:joinCondition :jc_2.
-:jc_2 rr:child "attributes.seasonNumber";
- rr:parent "seasonNumber".
-:om_38 rr:joinCondition :jc_3.
-:jc_3 rr:child "anime_id";
- rr:parent "anime.id".
-:om_39 a rr:ObjectMap;
- rr:parentTriplesMap :map_anime_0;
- rr:joinCondition :jc_4.
-:jc_4 rr:child "anime_id";
- rr:parent "id".
-:om_44 a rr:ObjectMap;
- rr:parentTriplesMap :map_anime_0;
- rr:joinCondition :jc_5.
-:jc_5 rr:child "anime.id";
- rr:parent "id".
diff --git a/test/betweenourworlds/rules-character.rml.ttl b/test/betweenourworlds/rules-character.rml.ttl
deleted file mode 100644
index b47223e..0000000
--- a/test/betweenourworlds/rules-character.rml.ttl
+++ /dev/null
@@ -1,123 +0,0 @@
-@prefix rr: .
-@prefix rdf: .
-@prefix rdfs: .
-@prefix fnml: .
-@prefix fno: .
-@prefix rml: .
-@prefix ql: .
-@prefix : .
-@prefix ex: .
-@prefix bow: .
-@prefix dbo: .
-
-:map_character_0 rml:logicalSource :source_0.
-:source_0 a rml:LogicalSource;
- rml:source "character-0.json";
- rml:iterator "$.data[*]";
- rml:referenceFormulation ql:JSONPath.
-:map_character_0 a rr:TriplesMap;
- rdfs:label "character".
-:s_0 a rr:SubjectMap.
-:map_character_0 rr:subjectMap :s_0.
-:s_0 rr:template "https://betweenourworlds.org/character/{attributes.slug}".
-:pom_0 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant rdf:type.
-:pom_0 rr:objectMap :om_0.
-:om_0 a rr:ObjectMap;
- rr:constant "https://betweenourworlds.org/ontology/Character";
- rr:termType rr:IRI.
-:pom_0 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap;
- rr:constant "http://schema.org/Thing";
- rr:termType rr:IRI.
-:pom_1 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_1.
-:pm_1 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_1.
-:pm_1 rr:constant rdfs:label.
-:pm_2 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_2.
-:pm_2 rr:constant .
-:pm_3 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_3.
-:pm_3 rr:constant dbo:title.
-:pom_1 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
- rml:reference "attributes.name";
- rr:termType rr:Literal.
-:pom_2 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_2.
-:pm_4 a rr:PredicateMap.
-:pom_2 rr:predicateMap :pm_4.
-:pm_4 rr:constant rdfs:label.
-:pm_5 a rr:PredicateMap.
-:pom_2 rr:predicateMap :pm_5.
-:pm_5 rr:constant .
-:pm_6 a rr:PredicateMap.
-:pom_2 rr:predicateMap :pm_6.
-:pm_6 rr:constant dbo:title.
-:pom_2 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
- rml:reference "attributes.names.en";
- rr:termType rr:Literal;
- rr:language "en".
-:pom_3 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_3.
-:pm_7 a rr:PredicateMap.
-:pom_3 rr:predicateMap :pm_7.
-:pm_7 rr:constant rdfs:label.
-:pm_8 a rr:PredicateMap.
-:pom_3 rr:predicateMap :pm_8.
-:pm_8 rr:constant .
-:pm_9 a rr:PredicateMap.
-:pom_3 rr:predicateMap :pm_9.
-:pm_9 rr:constant dbo:title.
-:pom_3 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
- rml:reference "attributes.names.ja_jp";
- rr:termType rr:Literal;
- rr:language "ja".
-:pom_4 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_4.
-:pm_10 a rr:PredicateMap.
-:pom_4 rr:predicateMap :pm_10.
-:pm_10 rr:constant .
-:pom_4 rr:objectMap :om_5.
-:om_5 a rr:ObjectMap;
- rr:template "https://myanimelist.net/character/{attributes.malId}";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_5 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_5.
-:pm_11 a rr:PredicateMap.
-:pom_5 rr:predicateMap :pm_11.
-:pm_11 rr:constant .
-:pm_12 a rr:PredicateMap.
-:pom_5 rr:predicateMap :pm_12.
-:pm_12 rr:constant rdfs:comment.
-:pom_5 rr:objectMap :om_6.
-:om_6 a rr:ObjectMap;
- rml:reference "attributes.description";
- rr:termType rr:Literal.
-:pom_6 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_6.
-:pm_13 a rr:PredicateMap.
-:pom_6 rr:predicateMap :pm_13.
-:pm_13 rr:constant .
-:pom_6 rr:objectMap :om_7.
-:om_7 a rr:ObjectMap;
- rml:reference "attributes.image.original";
- rr:termType rr:Literal;
- rr:datatype .
-:pom_7 a rr:PredicateObjectMap.
-:map_character_0 rr:predicateObjectMap :pom_7.
-:pm_14 a rr:PredicateMap.
-:pom_7 rr:predicateMap :pm_14.
-:pm_14 rr:constant .
-:pom_7 rr:objectMap :om_8.
-:om_8 a rr:ObjectMap;
- rml:reference "attributes.otherNames";
- rr:termType rr:Literal.
diff --git a/test/condition-function-on-po/mapping.rml.ttl b/test/condition-function-on-po/mapping.rml.ttl
index 68c47d2..fdb803e 100644
--- a/test/condition-function-on-po/mapping.rml.ttl
+++ b/test/condition-function-on-po/mapping.rml.ttl
@@ -3,6 +3,10 @@
@prefix rdfs: .
@prefix fnml: .
@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix rml: .
@prefix ql: .
@prefix : .
@@ -10,104 +14,104 @@
@prefix idlab-fn: .
@prefix grel: .
-:map_person_0 rml:logicalSource :source_0.
-:source_0 a rml:LogicalSource;
+:map_person_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
rml:source "data.json";
rml:iterator "$.persons[*]";
rml:referenceFormulation ql:JSONPath.
-:map_person_0 a rr:TriplesMap;
+:map_person_000 a rr:TriplesMap;
rdfs:label "person".
-:s_0 a rr:SubjectMap.
-:map_person_0 rr:subjectMap :s_0.
-:s_0 rr:template "http://example.com/{firstname}".
-:pom_0 a rr:PredicateObjectMap.
-:map_person_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant rdf:type.
-:pom_0 rr:objectMap :om_0.
-:om_0 a rr:ObjectMap;
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.com/{firstname}".
+:pom_000 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
rr:constant "http://xmlns.com/foaf/0.1/Person";
rr:termType rr:IRI.
-:pom_1 a rr:PredicateObjectMap.
-:map_person_0 rr:predicateObjectMap :pom_1.
-:pm_1 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_1.
-:pm_1 rr:constant .
-:pom_1 rr:objectMap :om_1.
-:om_1 a fnml:FunctionTermMap;
+:pom_001 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_001.
+:pm_001 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_001.
+:pm_001 rr:constant foaf:firstName.
+:pom_001 rr:objectMap :om_001.
+:om_001 a fnml:FunctionTermMap;
rr:termType rr:Literal;
- fnml:functionValue :fn_0.
-:fn_0 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://example.com/idlab/function/trueCondition";
+ fnml:functionValue :fn_000.
+:fn_000 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_2.
-:pom_2 a rr:PredicateObjectMap;
- rr:predicateMap :pm_2.
-:pm_2 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
rr:constant idlab-fn:strBoolean.
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_1.
-:fn_1 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "http://example.com/idlab/function/stringContainsOtherString";
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/stringContainsOtherString";
rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant idlab-fn:str.
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
rml:reference "firstname";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_4.
-:pom_4 a rr:PredicateObjectMap;
- rr:predicateMap :pm_4.
-:pm_4 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_004.
+:pom_004 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_004.
+:pm_004 a rr:PredicateMap;
rr:constant idlab-fn:otherStr.
-:pom_4 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
rr:constant "J";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_5.
-:pom_5 a rr:PredicateObjectMap;
- rr:predicateMap :pm_5.
-:pm_5 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_005.
+:pom_005 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_005.
+:pm_005 a rr:PredicateMap;
rr:constant idlab-fn:delimiter.
-:pom_5 rr:objectMap :om_5.
-:om_5 a rr:ObjectMap;
+:pom_005 rr:objectMap :om_005.
+:om_005 a rr:ObjectMap;
rr:constant "";
rr:termType rr:Literal.
-:fn_0 rr:predicateObjectMap :pom_6.
-:pom_6 a rr:PredicateObjectMap;
- rr:predicateMap :pm_6.
-:pm_6 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_006.
+:pom_006 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_006.
+:pm_006 a rr:PredicateMap;
rr:constant idlab-fn:str.
-:pom_6 rr:objectMap :om_6.
-:om_6 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_2.
-:fn_2 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_2.
-:pomexec_2 rr:predicateMap :pmexec_2.
-:pmexec_2 rr:constant fno:executes.
-:pomexec_2 rr:objectMap :omexec_2.
-:omexec_2 rr:constant "http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase";
+:pom_006 rr:objectMap :om_006.
+:om_006 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_002.
+:fn_002 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_002.
+:pomexec_002 rr:predicateMap :pmexec_002.
+:pmexec_002 rr:constant fno:executes.
+:pomexec_002 rr:objectMap :omexec_002.
+:omexec_002 rr:constant "http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase";
rr:termType rr:IRI.
-:fn_2 rr:predicateObjectMap :pom_7.
-:pom_7 a rr:PredicateObjectMap;
- rr:predicateMap :pm_7.
-:pm_7 a rr:PredicateMap;
+:fn_002 rr:predicateObjectMap :pom_007.
+:pom_007 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_007.
+:pm_007 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_7 rr:objectMap :om_7.
-:om_7 a rr:ObjectMap;
- rml:parentTermMap :ptm_0.
-:ptm_0 rml:reference "firstname".
+:pom_007 rr:objectMap :om_007.
+:om_007 a rr:ObjectMap;
+ rml:parentTermMap :ptm_000.
+:ptm_000 rml:reference "firstname".
diff --git a/test/condition-on-mapping-constant/mapping.rml.ttl b/test/condition-on-mapping-constant/mapping.rml.ttl
index 3086af0..d8ddd17 100644
--- a/test/condition-on-mapping-constant/mapping.rml.ttl
+++ b/test/condition-on-mapping-constant/mapping.rml.ttl
@@ -4,71 +4,74 @@
@prefix fnml: .
@prefix fno: .
@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix rml: .
@prefix ql: .
@prefix : .
@prefix ex: .
-:map_track_0 rml:logicalSource :source_0.
-:source_0 a rml:LogicalSource;
+:map_track_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
rml:source "data.json";
rml:iterator "$.features.[*].properties";
rml:referenceFormulation ql:JSONPath.
-:map_track_0 a rr:TriplesMap;
+:map_track_000 a rr:TriplesMap;
rdfs:label "track".
-:s_0 a rr:SubjectMap.
-:map_track_0 rr:subjectMap :s_0.
-:s_0 rr:template "http://example.com/sector/{sector}".
-:pom_0 a rr:PredicateObjectMap.
-:map_track_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant ex:name.
-:pom_0 rr:objectMap :om_0.
-:om_0 a rr:ObjectMap;
+:s_000 a rr:SubjectMap.
+:map_track_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.com/sector/{sector}".
+:pom_000 a rr:PredicateObjectMap.
+:map_track_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant ex:name.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
rml:reference "sector";
rr:termType rr:Literal.
-:map_sector0_0 rml:logicalSource :source_1.
-:source_1 a rml:LogicalSource;
+:map_sector0_000 rml:logicalSource :source_001.
+:source_001 a rml:LogicalSource;
rml:source "source_1.csv";
rml:referenceFormulation ql:CSV.
-:map_sector0_0 a rr:TriplesMap;
+:map_sector0_000 a rr:TriplesMap;
rdfs:label "sector0".
-:s_1 a rr:SubjectMap.
-:map_sector0_0 rr:subjectMap :s_1.
-:s_1 rr:template "http://example.com/Lap{Lap}/Sector1/{Athlete}".
-:pom_1 a rr:PredicateObjectMap.
-:map_sector0_0 rr:predicateObjectMap :pom_1.
-:pm_1 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_1.
-:pm_1 rr:constant ex:Sector.
-:pom_1 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap;
- rr:parentTriplesMap :map_track_0;
- rml:joinCondition :jc_0.
-:jc_0 a fnml:FunctionTermMap;
- fnml:functionValue :fn_0.
-:fn_0 rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://example.com/idlab/function/equal";
+:s_001 a rr:SubjectMap.
+:map_sector0_000 rr:subjectMap :s_001.
+:s_001 rr:template "http://example.com/Lap{Lap}/Sector1/{Athlete}".
+:pom_001 a rr:PredicateObjectMap.
+:map_sector0_000 rr:predicateObjectMap :pom_001.
+:pm_001 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_001.
+:pm_001 rr:constant ex:Sector.
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap;
+ rr:parentTriplesMap :map_track_000;
+ rml:joinCondition :jc_000.
+:jc_000 a fnml:FunctionTermMap;
+ fnml:functionValue :fn_000.
+:fn_000 rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/equal";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_2.
-:pom_2 a rr:PredicateObjectMap;
- rr:predicateMap :pm_2.
-:pm_2 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
rr:constant .
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
rr:constant "0";
rr:termType rr:Literal.
-:fn_0 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant .
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
- rml:parentTermMap :ptm_0.
-:ptm_0 rml:reference "sector".
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
+ rml:parentTermMap :ptm_000.
+:ptm_000 rml:reference "sector".
diff --git a/test/condition-on-mapping-nested/mapping.rml.ttl b/test/condition-on-mapping-nested/mapping.rml.ttl
index f111bde..479ce32 100644
--- a/test/condition-on-mapping-nested/mapping.rml.ttl
+++ b/test/condition-on-mapping-nested/mapping.rml.ttl
@@ -4,6 +4,9 @@
@prefix fnml: .
@prefix fno: .
@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix rml: .
@prefix ql: .
@prefix : .
@@ -11,120 +14,120 @@
@prefix grel: .
@prefix idlab-fn: .
-:map_myMapping_0 rml:logicalSource :source_0.
-:source_0 a rml:LogicalSource;
+:map_myMapping_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
rml:source "data.csv";
rml:referenceFormulation ql:CSV.
-:map_myMapping_0 a rr:TriplesMap;
+:map_myMapping_000 a rr:TriplesMap;
rdfs:label "myMapping".
-:s_0 a rr:SubjectMap.
-:map_myMapping_0 rr:subjectMap :s_0.
-:s_0 rr:template "http://example.com#{ID}".
-:pom_0 a rr:PredicateObjectMap.
-:map_myMapping_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant rdf:type.
-:pom_0 rr:objectMap :om_0.
-:om_0 a rr:ObjectMap;
+:s_000 a rr:SubjectMap.
+:map_myMapping_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.com#{ID}".
+:pom_000 a rr:PredicateObjectMap.
+:map_myMapping_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant rdf:type.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap;
rr:constant "http://example.com#Person";
rr:termType rr:IRI.
-:pom_1 a rr:PredicateObjectMap.
-:map_myMapping_0 rr:predicateObjectMap :pom_1.
-:pm_1 a rr:PredicateMap.
-:pom_1 rr:predicateMap :pm_1.
-:pm_1 rr:constant ex:isFriendsWith.
-:pom_1 rr:objectMap :om_1.
-:map_myOtherMapping_0 rml:logicalSource :source_1.
-:source_1 a rml:LogicalSource;
+:pom_001 a rr:PredicateObjectMap.
+:map_myMapping_000 rr:predicateObjectMap :pom_001.
+:pm_001 a rr:PredicateMap.
+:pom_001 rr:predicateMap :pm_001.
+:pm_001 rr:constant ex:isFriendsWith.
+:pom_001 rr:objectMap :om_001.
+:map_myOtherMapping_000 rml:logicalSource :source_001.
+:source_001 a rml:LogicalSource;
rml:source "data2.csv";
rml:referenceFormulation ql:CSV.
-:map_myOtherMapping_0 a rr:TriplesMap;
+:map_myOtherMapping_000 a rr:TriplesMap;
rdfs:label "myOtherMapping".
-:s_1 a rr:SubjectMap.
-:map_myOtherMapping_0 rr:subjectMap :s_1.
-:s_1 rr:template "http://example.com#heroes_{ID}".
-:pom_2 a rr:PredicateObjectMap.
-:map_myOtherMapping_0 rr:predicateObjectMap :pom_2.
-:pm_2 a rr:PredicateMap.
-:pom_2 rr:predicateMap :pm_2.
-:pm_2 rr:constant rdf:type.
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
+:s_001 a rr:SubjectMap.
+:map_myOtherMapping_000 rr:subjectMap :s_001.
+:s_001 rr:template "http://example.com#heroes_{ID}".
+:pom_002 a rr:PredicateObjectMap.
+:map_myOtherMapping_000 rr:predicateObjectMap :pom_002.
+:pm_002 a rr:PredicateMap.
+:pom_002 rr:predicateMap :pm_002.
+:pm_002 rr:constant rdf:type.
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
rr:constant "http://example.com#Hero";
rr:termType rr:IRI.
-:om_1 a rr:ObjectMap;
- rr:parentTriplesMap :map_myOtherMapping_0;
- rml:joinCondition :jc_0.
-:jc_0 a fnml:FunctionTermMap;
- fnml:functionValue :fn_0.
-:fn_0 rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_and";
+:om_001 a rr:ObjectMap;
+ rr:parentTriplesMap :map_myOtherMapping_000;
+ rml:joinCondition :jc_000.
+:jc_000 a fnml:FunctionTermMap;
+ fnml:functionValue :fn_000.
+:fn_000 rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_and";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant grel:param_rep_b.
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_1.
-:fn_1 rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "http://example.com/idlab/function/equal";
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/equal";
rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_4.
-:pom_4 a rr:PredicateObjectMap;
- rr:predicateMap :pm_4.
-:pm_4 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_004.
+:pom_004 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_004.
+:pm_004 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_4 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
rml:reference "otherID";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_5.
-:pom_5 a rr:PredicateObjectMap;
- rr:predicateMap :pm_5.
-:pm_5 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_005.
+:pom_005 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_005.
+:pm_005 a rr:PredicateMap;
rr:constant grel:valueParameter2.
-:pom_5 rr:objectMap :om_5.
-:om_5 a rr:ObjectMap;
- rml:parentTermMap :ptm_0.
-:ptm_0 rml:reference "friendID".
-:fn_0 rr:predicateObjectMap :pom_6.
-:pom_6 a rr:PredicateObjectMap;
- rr:predicateMap :pm_6.
-:pm_6 a rr:PredicateMap;
+:pom_005 rr:objectMap :om_005.
+:om_005 a rr:ObjectMap;
+ rml:parentTermMap :ptm_000.
+:ptm_000 rml:reference "friendID".
+:fn_000 rr:predicateObjectMap :pom_006.
+:pom_006 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_006.
+:pm_006 a rr:PredicateMap;
rr:constant grel:param_rep_b.
-:pom_6 rr:objectMap :om_6.
-:om_6 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_2.
-:fn_2 rr:predicateObjectMap :pomexec_2.
-:pomexec_2 rr:predicateMap :pmexec_2.
-:pmexec_2 rr:constant fno:executes.
-:pomexec_2 rr:objectMap :omexec_2.
-:omexec_2 rr:constant "http://example.com/idlab/function/equal";
+:pom_006 rr:objectMap :om_006.
+:om_006 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_002.
+:fn_002 rr:predicateObjectMap :pomexec_002.
+:pomexec_002 rr:predicateMap :pmexec_002.
+:pmexec_002 rr:constant fno:executes.
+:pomexec_002 rr:objectMap :omexec_002.
+:omexec_002 rr:constant "http://example.com/idlab/function/equal";
rr:termType rr:IRI.
-:fn_2 rr:predicateObjectMap :pom_7.
-:pom_7 a rr:PredicateObjectMap;
- rr:predicateMap :pm_7.
-:pm_7 a rr:PredicateMap;
+:fn_002 rr:predicateObjectMap :pom_007.
+:pom_007 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_007.
+:pm_007 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_7 rr:objectMap :om_7.
-:om_7 a rr:ObjectMap;
+:pom_007 rr:objectMap :om_007.
+:om_007 a rr:ObjectMap;
rml:reference "name";
rr:termType rr:Literal.
-:fn_2 rr:predicateObjectMap :pom_8.
-:pom_8 a rr:PredicateObjectMap;
- rr:predicateMap :pm_8.
-:pm_8 a rr:PredicateMap;
+:fn_002 rr:predicateObjectMap :pom_008.
+:pom_008 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_008.
+:pm_008 a rr:PredicateMap;
rr:constant grel:valueParameter2.
-:pom_8 rr:objectMap :om_8.
-:om_8 a rr:ObjectMap;
- rml:parentTermMap :ptm_1.
-:ptm_1 rml:reference "friendName".
+:pom_008 rr:objectMap :om_008.
+:om_008 a rr:ObjectMap;
+ rml:parentTermMap :ptm_001.
+:ptm_001 rml:reference "friendName".
diff --git a/test/condition-on-mapping-subject-function/input.csv b/test/condition-on-mapping-subject-function/input.csv
new file mode 100644
index 0000000..a87b05f
--- /dev/null
+++ b/test/condition-on-mapping-subject-function/input.csv
@@ -0,0 +1,4 @@
+id
+0
+""
+1
diff --git a/test/condition-on-mapping-subject-function/mapping.rml.ttl b/test/condition-on-mapping-subject-function/mapping.rml.ttl
new file mode 100644
index 0000000..73b005d
--- /dev/null
+++ b/test/condition-on-mapping-subject-function/mapping.rml.ttl
@@ -0,0 +1,109 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix grel: .
+@prefix idlab-fn: .
+
+:map_person_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
+ rml:source "input.csv";
+ rml:referenceFormulation ql:CSV.
+:map_person_000 a rr:TriplesMap;
+ rdfs:label "person".
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 a fnml:FunctionTermMap;
+ rr:termType rr:IRI;
+ fnml:functionValue :fn_000.
+:fn_000 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
+ rr:termType rr:IRI.
+:fn_000 rr:predicateObjectMap :pom_000.
+:pom_000 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_000.
+:pm_000 a rr:PredicateMap;
+ rr:constant idlab-fn:strBoolean.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/notEqual";
+ rr:termType rr:IRI.
+:fn_001 rr:predicateObjectMap :pom_001.
+:pom_001 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_001.
+:pm_001 a rr:PredicateMap;
+ rr:constant grel:valueParameter.
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap;
+ rml:reference "id";
+ rr:termType rr:Literal.
+:fn_001 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
+ rr:constant grel:valueParameter2.
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
+ rr:constant "";
+ rr:termType rr:Literal.
+:fn_000 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
+ rr:constant idlab-fn:str.
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap, fnml:FunctionTermMap;
+ rr:termType rr:IRI;
+ fnml:functionValue :fn_002.
+:fn_002 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_002.
+:pomexec_002 rr:predicateMap :pmexec_002.
+:pmexec_002 rr:constant fno:executes.
+:pomexec_002 rr:objectMap :omexec_002.
+:omexec_002 rr:constant "http://users.ugent.be/~bjdmeest/function/grel.ttl#array_join";
+ rr:termType rr:IRI.
+:fn_002 rr:predicateObjectMap :pom_004.
+:pom_004 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_004.
+:pm_004 a rr:PredicateMap;
+ rr:constant grel:p_array_a.
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
+ rr:constant "http://example.org/";
+ rr:termType rr:Literal.
+:fn_002 rr:predicateObjectMap :pom_005.
+:pom_005 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_005.
+:pm_005 a rr:PredicateMap;
+ rr:constant grel:p_array_a.
+:pom_005 rr:objectMap :om_005.
+:om_005 a rr:ObjectMap;
+ rml:reference "id";
+ rr:termType rr:Literal.
+:pom_006 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_006.
+:pm_006 a rr:PredicateMap.
+:pom_006 rr:predicateMap :pm_006.
+:pm_006 rr:constant rdf:type.
+:pom_006 rr:objectMap :om_006.
+:om_006 a rr:ObjectMap;
+ rr:constant "http://schema.org/Person";
+ rr:termType rr:IRI.
diff --git a/test/condition-on-mapping-subject-function/mapping.yarrrml b/test/condition-on-mapping-subject-function/mapping.yarrrml
new file mode 100644
index 0000000..ed51346
--- /dev/null
+++ b/test/condition-on-mapping-subject-function/mapping.yarrrml
@@ -0,0 +1,20 @@
+prefixes:
+ grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#
+ idlab-fn: http://example.com/idlab/function/
+
+mappings:
+ person:
+ sources:
+ - [input.csv~csv]
+ s:
+ function: grel:array_join
+ parameters:
+ - [grel:p_array_a, "http://example.org/"]
+ - [grel:p_array_a, "$(id)"]
+ condition:
+ function: idlab-fn:notEqual
+ parameters:
+ - [grel:valueParameter, "$(id)"]
+ - [grel:valueParameter2, ""]
+ po:
+ - [a, schema:Person]
diff --git a/test/condition-on-mapping-with-blanknode/mapping.rml.ttl b/test/condition-on-mapping-with-blanknode/mapping.rml.ttl
new file mode 100644
index 0000000..6ca2c64
--- /dev/null
+++ b/test/condition-on-mapping-with-blanknode/mapping.rml.ttl
@@ -0,0 +1,83 @@
+@prefix rr: .
+@prefix rdf: .
+@prefix rdfs: .
+@prefix fnml: .
+@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
+@prefix rml: .
+@prefix ql: .
+@prefix : .
+@prefix idlab-fn: .
+@prefix grel: .
+
+:map_test_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
+ rml:source "test.csv";
+ rml:referenceFormulation ql:CSV.
+:map_test_000 a rr:TriplesMap;
+ rdfs:label "test".
+:s_000 a rr:SubjectMap.
+:map_test_000 rr:subjectMap :s_000.
+:s_000 a fnml:FunctionTermMap;
+ rr:termType rr:BlankNode;
+ fnml:functionValue :fn_000.
+:fn_000 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
+ rr:termType rr:IRI.
+:fn_000 rr:predicateObjectMap :pom_000.
+:pom_000 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_000.
+:pm_000 a rr:PredicateMap;
+ rr:constant idlab-fn:strBoolean.
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/equal";
+ rr:termType rr:IRI.
+:fn_001 rr:predicateObjectMap :pom_001.
+:pom_001 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_001.
+:pm_001 a rr:PredicateMap;
+ rr:constant grel:valueParameter.
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap;
+ rml:reference "id";
+ rr:termType rr:Literal.
+:fn_001 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
+ rr:constant grel:valueParameter2.
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
+ rr:constant "1";
+ rr:termType rr:Literal.
+:fn_000 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
+ rr:constant idlab-fn:str.
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
+ rr:termType rr:BlankNode.
+:pom_004 a rr:PredicateObjectMap.
+:map_test_000 rr:predicateObjectMap :pom_004.
+:pm_004 a rr:PredicateMap.
+:pom_004 rr:predicateMap :pm_004.
+:pm_004 rr:constant rdf:type.
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
+ rr:constant "http://example.com/Test";
+ rr:termType rr:IRI.
diff --git a/test/condition-on-mapping-with-blanknode/mapping.yarrrml b/test/condition-on-mapping-with-blanknode/mapping.yarrrml
new file mode 100644
index 0000000..2844d66
--- /dev/null
+++ b/test/condition-on-mapping-with-blanknode/mapping.yarrrml
@@ -0,0 +1,15 @@
+prefixes:
+ idlab-fn: http://example.com/idlab/function/
+ grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#
+
+mappings:
+ test:
+ sources:
+ - [test.csv~csv]
+ condition:
+ function: idlab-fn:equal
+ parameters:
+ - [grel:valueParameter, $(id)]
+ - [grel:valueParameter2, 1]
+ po:
+ - [a, http://example.com/Test]
diff --git a/test/condition-on-mapping/r2rml/mapping.r2rml.ttl b/test/condition-on-mapping/r2rml/mapping.r2rml.ttl
index 1b54953..115b506 100644
--- a/test/condition-on-mapping/r2rml/mapping.r2rml.ttl
+++ b/test/condition-on-mapping/r2rml/mapping.r2rml.ttl
@@ -3,76 +3,80 @@
@prefix rdfs: .
@prefix fnml: .
@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix : .
@prefix idlab-fn: .
@prefix grel: .
-:map_test_0 rr:logicalTable :source_0.
-:source_0 a rr:LogicalTable;
+:map_test_000 rr:logicalTable :source_000.
+:source_000 a rr:LogicalTable;
rr:tableName "test";
rr:sqlVersion rr:MySQL.
-:map_test_0 a rr:TriplesMap;
+:map_test_000 a rr:TriplesMap;
rdfs:label "test".
-:s_0 a rr:SubjectMap.
-:map_test_0 rr:subjectMap :s_0.
-:s_0 a fnml:FunctionTermMap;
+:s_000 a rr:SubjectMap.
+:map_test_000 rr:subjectMap :s_000.
+:s_000 a fnml:FunctionTermMap;
rr:termType rr:IRI;
- fnml:functionValue :fn_0.
-:fn_0 rr:logicalTable :source_0;
- rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://example.com/idlab/function/trueCondition";
+ fnml:functionValue :fn_000.
+:fn_000 rr:logicalTable :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_0.
-:pom_0 a rr:PredicateObjectMap;
- rr:predicateMap :pm_0.
-:pm_0 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_000.
+:pom_000 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_000.
+:pm_000 a rr:PredicateMap;
rr:constant idlab-fn:strBoolean.
-:pom_0 rr:objectMap :om_0.
-:om_0 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_1.
-:fn_1 rr:logicalTable :source_0;
- rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "http://example.com/idlab/function/equal";
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rr:logicalTable :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/equal";
rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_1.
-:pom_1 a rr:PredicateObjectMap;
- rr:predicateMap :pm_1.
-:pm_1 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_001.
+:pom_001 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_001.
+:pm_001 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_1 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap;
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap;
rr:column "id";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_2.
-:pom_2 a rr:PredicateObjectMap;
- rr:predicateMap :pm_2.
-:pm_2 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
rr:constant grel:valueParameter2.
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
rr:constant "1";
rr:termType rr:Literal.
-:fn_0 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant idlab-fn:str.
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
rr:template "http://example.com/{id}";
- rr:termType rr:Literal.
-:pom_4 a rr:PredicateObjectMap.
-:map_test_0 rr:predicateObjectMap :pom_4.
-:pm_4 a rr:PredicateMap.
-:pom_4 rr:predicateMap :pm_4.
-:pm_4 rr:constant rdf:type.
-:pom_4 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
+ rr:termType rr:IRI.
+:pom_004 a rr:PredicateObjectMap.
+:map_test_000 rr:predicateObjectMap :pom_004.
+:pm_004 a rr:PredicateMap.
+:pom_004 rr:predicateMap :pm_004.
+:pm_004 rr:constant rdf:type.
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
rr:constant "http://example.com/Test";
rr:termType rr:IRI.
diff --git a/test/condition-on-mapping/rml/mapping.rml.ttl b/test/condition-on-mapping/rml/mapping.rml.ttl
index e22547f..4caeea5 100644
--- a/test/condition-on-mapping/rml/mapping.rml.ttl
+++ b/test/condition-on-mapping/rml/mapping.rml.ttl
@@ -3,78 +3,82 @@
@prefix rdfs: .
@prefix fnml: .
@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix rml: .
@prefix ql: .
@prefix : .
@prefix idlab-fn: .
@prefix grel: .
-:map_test_0 rml:logicalSource :source_0.
-:source_0 a rml:LogicalSource;
+:map_test_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
rml:source "test.csv";
rml:referenceFormulation ql:CSV.
-:map_test_0 a rr:TriplesMap;
+:map_test_000 a rr:TriplesMap;
rdfs:label "test".
-:s_0 a rr:SubjectMap.
-:map_test_0 rr:subjectMap :s_0.
-:s_0 a fnml:FunctionTermMap;
+:s_000 a rr:SubjectMap.
+:map_test_000 rr:subjectMap :s_000.
+:s_000 a fnml:FunctionTermMap;
rr:termType rr:IRI;
- fnml:functionValue :fn_0.
-:fn_0 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://example.com/idlab/function/trueCondition";
+ fnml:functionValue :fn_000.
+:fn_000 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_0.
-:pom_0 a rr:PredicateObjectMap;
- rr:predicateMap :pm_0.
-:pm_0 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_000.
+:pom_000 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_000.
+:pm_000 a rr:PredicateMap;
rr:constant idlab-fn:strBoolean.
-:pom_0 rr:objectMap :om_0.
-:om_0 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_1.
-:fn_1 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "http://example.com/idlab/function/equal";
+:pom_000 rr:objectMap :om_000.
+:om_000 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/equal";
rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_1.
-:pom_1 a rr:PredicateObjectMap;
- rr:predicateMap :pm_1.
-:pm_1 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_001.
+:pom_001 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_001.
+:pm_001 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_1 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap;
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap;
rml:reference "id";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_2.
-:pom_2 a rr:PredicateObjectMap;
- rr:predicateMap :pm_2.
-:pm_2 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
rr:constant grel:valueParameter2.
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
rr:constant "1";
rr:termType rr:Literal.
-:fn_0 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant idlab-fn:str.
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
rr:template "http://example.com/{id}";
- rr:termType rr:Literal.
-:pom_4 a rr:PredicateObjectMap.
-:map_test_0 rr:predicateObjectMap :pom_4.
-:pm_4 a rr:PredicateMap.
-:pom_4 rr:predicateMap :pm_4.
-:pm_4 rr:constant rdf:type.
-:pom_4 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
+ rr:termType rr:IRI.
+:pom_004 a rr:PredicateObjectMap.
+:map_test_000 rr:predicateObjectMap :pom_004.
+:pm_004 a rr:PredicateMap.
+:pom_004 rr:predicateMap :pm_004.
+:pm_004 rr:constant rdf:type.
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
rr:constant "http://example.com/Test";
rr:termType rr:IRI.
diff --git a/test/condition-on-po-datatype/mapping.rml.ttl b/test/condition-on-po-datatype/mapping.rml.ttl
index 5b249b6..2ef9521 100644
--- a/test/condition-on-po-datatype/mapping.rml.ttl
+++ b/test/condition-on-po-datatype/mapping.rml.ttl
@@ -4,6 +4,9 @@
@prefix fnml: .
@prefix fno: .
@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix rml: .
@prefix ql: .
@prefix : .
@@ -13,71 +16,71 @@
@prefix xsd: .
@prefix prov: .
-:map_events_0 rml:logicalSource :source_0.
-:source_0 a rml:LogicalSource;
+:map_events_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
rml:source "data.csv";
rml:referenceFormulation ql:CSV.
-:map_events_0 a rr:TriplesMap;
+:map_events_000 a rr:TriplesMap;
rdfs:label "events".
-:s_0 a rr:SubjectMap.
-:map_events_0 rr:subjectMap :s_0.
-:s_0 rr:template "https://example.org/ns/test#event_{id}".
-:pom_0 a rr:PredicateObjectMap.
-:map_events_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant prov:endedAtTime.
-:pom_0 rr:objectMap :om_0.
-:om_0 a fnml:FunctionTermMap;
- rr:datatype xsd:dateTime;
+:s_000 a rr:SubjectMap.
+:map_events_000 rr:subjectMap :s_000.
+:s_000 rr:template "https://example.org/ns/test#event_{id}".
+:pom_000 a rr:PredicateObjectMap.
+:map_events_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant prov:endedAtTime.
+:pom_000 rr:objectMap :om_000.
+:om_000 a fnml:FunctionTermMap;
rr:termType rr:Literal;
- fnml:functionValue :fn_0.
-:fn_0 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://example.com/idlab/function/trueCondition";
+ rr:datatype xsd:dateTime;
+ fnml:functionValue :fn_000.
+:fn_000 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_1.
-:pom_1 a rr:PredicateObjectMap;
- rr:predicateMap :pm_1.
-:pm_1 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_001.
+:pom_001 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_001.
+:pm_001 a rr:PredicateMap;
rr:constant idlab-fn:strBoolean.
-:pom_1 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_1.
-:fn_1 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "http://example.com/idlab/function/notEqual";
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/notEqual";
rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_2.
-:pom_2 a rr:PredicateObjectMap;
- rr:predicateMap :pm_2.
-:pm_2 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
rml:reference "end_date";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant grel:valueParameter2.
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
rr:constant "";
rr:termType rr:Literal.
-:fn_0 rr:predicateObjectMap :pom_4.
-:pom_4 a rr:PredicateObjectMap;
- rr:predicateMap :pm_4.
-:pm_4 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_004.
+:pom_004 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_004.
+:pm_004 a rr:PredicateMap;
rr:constant idlab-fn:str.
-:pom_4 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
rml:reference "end_date";
rr:termType rr:Literal.
diff --git a/test/condition-on-po/r2rml/mapping.r2rml.ttl b/test/condition-on-po/r2rml/mapping.r2rml.ttl
index 5d1e524..de96e7c 100644
--- a/test/condition-on-po/r2rml/mapping.r2rml.ttl
+++ b/test/condition-on-po/r2rml/mapping.r2rml.ttl
@@ -3,74 +3,78 @@
@prefix rdfs: .
@prefix fnml: .
@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix : .
@prefix grel: .
@prefix idlab-fn: .
-:map_person_0 rr:logicalTable :source_0.
-:source_0 a rr:LogicalTable;
+:map_person_000 rr:logicalTable :source_000.
+:source_000 a rr:LogicalTable;
rr:tableName "test";
rr:sqlVersion rr:MySQL.
-:map_person_0 a rr:TriplesMap;
+:map_person_000 a rr:TriplesMap;
rdfs:label "person".
-:s_0 a rr:SubjectMap.
-:map_person_0 rr:subjectMap :s_0.
-:s_0 rr:template "http://example.org/{firstname}".
-:pom_0 a rr:PredicateObjectMap.
-:map_person_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant .
-:pom_0 rr:objectMap :om_0.
-:om_0 a fnml:FunctionTermMap;
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.org/{firstname}".
+:pom_000 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant foaf:firstName.
+:pom_000 rr:objectMap :om_000.
+:om_000 a fnml:FunctionTermMap;
rr:termType rr:Literal;
- fnml:functionValue :fn_0.
-:fn_0 rr:logicalTable :source_0;
- rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://example.com/idlab/function/trueCondition";
+ fnml:functionValue :fn_000.
+:fn_000 rr:logicalTable :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_1.
-:pom_1 a rr:PredicateObjectMap;
- rr:predicateMap :pm_1.
-:pm_1 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_001.
+:pom_001 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_001.
+:pm_001 a rr:PredicateMap;
rr:constant idlab-fn:strBoolean.
-:pom_1 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_1.
-:fn_1 rr:logicalTable :source_0;
- rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "http://example.com/idlab/function/equal";
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rr:logicalTable :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/equal";
rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_2.
-:pom_2 a rr:PredicateObjectMap;
- rr:predicateMap :pm_2.
-:pm_2 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
rr:column "firstname";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant grel:valueParameter2.
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
rr:constant "test";
rr:termType rr:Literal.
-:fn_0 rr:predicateObjectMap :pom_4.
-:pom_4 a rr:PredicateObjectMap;
- rr:predicateMap :pm_4.
-:pm_4 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_004.
+:pom_004 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_004.
+:pm_004 a rr:PredicateMap;
rr:constant idlab-fn:str.
-:pom_4 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
rr:column "firstname";
rr:termType rr:Literal.
diff --git a/test/condition-on-po/rml/mapping.rml.ttl b/test/condition-on-po/rml/mapping.rml.ttl
index 653e96c..1711a08 100644
--- a/test/condition-on-po/rml/mapping.rml.ttl
+++ b/test/condition-on-po/rml/mapping.rml.ttl
@@ -3,76 +3,80 @@
@prefix rdfs: .
@prefix fnml: .
@prefix fno: .
+@prefix d2rq: .
+@prefix void: .
+@prefix dc: .
+@prefix foaf: .
@prefix rml: .
@prefix ql: .
@prefix : .
@prefix grel: .
@prefix idlab-fn: .
-:map_person_0 rml:logicalSource :source_0.
-:source_0 a rml:LogicalSource;
+:map_person_000 rml:logicalSource :source_000.
+:source_000 a rml:LogicalSource;
rml:source "test.csv";
rml:referenceFormulation ql:CSV.
-:map_person_0 a rr:TriplesMap;
+:map_person_000 a rr:TriplesMap;
rdfs:label "person".
-:s_0 a rr:SubjectMap.
-:map_person_0 rr:subjectMap :s_0.
-:s_0 rr:template "http://example.org/{firstname}".
-:pom_0 a rr:PredicateObjectMap.
-:map_person_0 rr:predicateObjectMap :pom_0.
-:pm_0 a rr:PredicateMap.
-:pom_0 rr:predicateMap :pm_0.
-:pm_0 rr:constant .
-:pom_0 rr:objectMap :om_0.
-:om_0 a fnml:FunctionTermMap;
+:s_000 a rr:SubjectMap.
+:map_person_000 rr:subjectMap :s_000.
+:s_000 rr:template "http://example.org/{firstname}".
+:pom_000 a rr:PredicateObjectMap.
+:map_person_000 rr:predicateObjectMap :pom_000.
+:pm_000 a rr:PredicateMap.
+:pom_000 rr:predicateMap :pm_000.
+:pm_000 rr:constant foaf:firstName.
+:pom_000 rr:objectMap :om_000.
+:om_000 a fnml:FunctionTermMap;
rr:termType rr:Literal;
- fnml:functionValue :fn_0.
-:fn_0 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_0.
-:pomexec_0 rr:predicateMap :pmexec_0.
-:pmexec_0 rr:constant fno:executes.
-:pomexec_0 rr:objectMap :omexec_0.
-:omexec_0 rr:constant "http://example.com/idlab/function/trueCondition";
+ fnml:functionValue :fn_000.
+:fn_000 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_000.
+:pomexec_000 rr:predicateMap :pmexec_000.
+:pmexec_000 rr:constant fno:executes.
+:pomexec_000 rr:objectMap :omexec_000.
+:omexec_000 rr:constant "http://example.com/idlab/function/trueCondition";
rr:termType rr:IRI.
-:fn_0 rr:predicateObjectMap :pom_1.
-:pom_1 a rr:PredicateObjectMap;
- rr:predicateMap :pm_1.
-:pm_1 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_001.
+:pom_001 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_001.
+:pm_001 a rr:PredicateMap;
rr:constant idlab-fn:strBoolean.
-:pom_1 rr:objectMap :om_1.
-:om_1 a rr:ObjectMap, fnml:FunctionTermMap;
- fnml:functionValue :fn_1.
-:fn_1 rml:logicalSource :source_0;
- rr:predicateObjectMap :pomexec_1.
-:pomexec_1 rr:predicateMap :pmexec_1.
-:pmexec_1 rr:constant fno:executes.
-:pomexec_1 rr:objectMap :omexec_1.
-:omexec_1 rr:constant "http://example.com/idlab/function/equal";
+:pom_001 rr:objectMap :om_001.
+:om_001 a rr:ObjectMap, fnml:FunctionTermMap;
+ fnml:functionValue :fn_001.
+:fn_001 rml:logicalSource :source_000;
+ rr:predicateObjectMap :pomexec_001.
+:pomexec_001 rr:predicateMap :pmexec_001.
+:pmexec_001 rr:constant fno:executes.
+:pomexec_001 rr:objectMap :omexec_001.
+:omexec_001 rr:constant "http://example.com/idlab/function/equal";
rr:termType rr:IRI.
-:fn_1 rr:predicateObjectMap :pom_2.
-:pom_2 a rr:PredicateObjectMap;
- rr:predicateMap :pm_2.
-:pm_2 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_002.
+:pom_002 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_002.
+:pm_002 a rr:PredicateMap;
rr:constant grel:valueParameter.
-:pom_2 rr:objectMap :om_2.
-:om_2 a rr:ObjectMap;
+:pom_002 rr:objectMap :om_002.
+:om_002 a rr:ObjectMap;
rml:reference "firstname";
rr:termType rr:Literal.
-:fn_1 rr:predicateObjectMap :pom_3.
-:pom_3 a rr:PredicateObjectMap;
- rr:predicateMap :pm_3.
-:pm_3 a rr:PredicateMap;
+:fn_001 rr:predicateObjectMap :pom_003.
+:pom_003 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_003.
+:pm_003 a rr:PredicateMap;
rr:constant grel:valueParameter2.
-:pom_3 rr:objectMap :om_3.
-:om_3 a rr:ObjectMap;
+:pom_003 rr:objectMap :om_003.
+:om_003 a rr:ObjectMap;
rr:constant "test";
rr:termType rr:Literal.
-:fn_0 rr:predicateObjectMap :pom_4.
-:pom_4 a rr:PredicateObjectMap;
- rr:predicateMap :pm_4.
-:pm_4 a rr:PredicateMap;
+:fn_000 rr:predicateObjectMap :pom_004.
+:pom_004 a rr:PredicateObjectMap;
+ rr:predicateMap :pm_004.
+:pm_004 a rr:PredicateMap;
rr:constant idlab-fn:str.
-:pom_4 rr:objectMap :om_4.
-:om_4 a rr:ObjectMap;
+:pom_004 rr:objectMap :om_004.
+:om_004 a rr:ObjectMap;
rml:reference "firstname";
rr:termType rr:Literal.
diff --git a/test/condition-on-single-object/mapping.rml.ttl b/test/condition-on-single-object/mapping.rml.ttl
index 653e96c..16c3084 100644
--- a/test/condition-on-single-object/mapping.rml.ttl
+++ b/test/condition-on-single-object/mapping.rml.ttl
@@ -3,76 +3,77 @@
@prefix rdfs: .
@prefix fnml: .
@prefix fno: .
+@prefix d2rq: