Starting at the website's root, you can find function examples by following the path DOCS / Connect to RML / MORE EXAMPLES / Click here for more examples.
This renders file rml/function-examples.md.
To add an example to that file, proceed as follows:
-
Copy comment
<!-- To uppercase -->and the entire section<section id="to-uppercase">below it and paste these at the end of the file. -
Adapt the new comment line, section id, title, and all text in
ChallengeandHow to solveto your example. -
Try out your example in an environment with the YARRRML parser and the RMLMapper.
-
Put the contents of your final YARRRML file in the yaml code block in
Mapping file in YARRRML. -
Use the RML output of the YARRRML file as the basis for a beautified RML file. Beautify as follows:
a. use RML-SDK to nicely nest nodes. I used the following command line:
node ./bin/rmlio.js rdf turtle -i ${RML_FILE} -o ${BEAUTIFIED_RML_FILE} -p -b \ http://www.w3.org/ns/r2rml#subjectMap \ http://www.w3.org/ns/r2rml#predicateObjectMap \ http://www.w3.org/ns/r2rml#predicateMap \ http://www.w3.org/ns/r2rml#objectMap \ http://www.w3.org/ns/r2rml#joinCondition \ http://semweb.mmlab.be/ns/fnml#functionValue
b. Remove triples with
void:predicates or objects like::rules_000 a void:Dataset; void:exampleResource :map_vegetables_000.c. Rename. For example, change
source_000intosource-vegetables,map_vegetables_000intomap-vegetables.d. Delete irrelevant prefixes, for example
d2rq,void,dc. -
Test your beautified RML file.
-
Put the contents of your final RML file in the turtle code block in
Mapping file in RML. -
Put the output of RMLMapper in the turtle code block in
Mapping engine output. -
Add a link to your new section in the
nav: |list at the top of the document.