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 Manually Create a Mapping File 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 |
---|---|
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 |
---|---|
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 |
---|
CTM16X00-LUZ-K-S/04/0001 |
580338M3_SURM3_BASE |
121951W9MLXNISDTAUSUS_77NISDTAUSUS_0001 |
Â
Â
Â