Example Mapping Files

Within this part of the user documentation we have provided a wide array of sample mapping files to aid you in the creation of your own.

 

 

Page Structure

As with the https://data-lens.atlassian.net/wiki/spaces/DLD/pages/305758400 document, the examples will be clearly displayed using the following colour codes. Please note all Provenance Named Graphs have been omitted for simplicity and therefore the RDF output will be represented in NTtriples.

RML mapping files will be blue
Example input data will be yellow
Output RDF triples will be green

 

Example 1 - Simple CSV

id

name

id

name

10001

Alice

10002

Bob

 


 

Example 2 - Simple JSON

 


 

Example 3 - Simple XML

 


 

Example 4 - Simple SQL

id

firstname

lastname

occupation

10001

Alice

Johnson

Tech

10002

Bob

Smith

Sales

 


 

Example 5 - Simple SQL with Query

id

firstname

lastname

occupation

10001

Alice

Johnson

Tech

10002

Bob

Smith

Sales

 


 

Example 6 - Function within a Subject Map

id

name

id

name

10001

Alice

10002

Bob

 


 

Example 7 - Complex Embedded Functions

In this example we are using embedded function, functions within functions. We start with an if then else function where if the input contains the text “NIS“, split the input at the underscore (_), else split the input at the forward slash (/).

source_id

source_id

CTM16X00-LUZ-K-S/04/0001

580338M3_SURM3_BASE

121951W9MLXNISDTAUSUS_77NISDTAUSUS_0001