RMLio / RML-Mapper

Generate High Quality Linked Data from multiple originally (semi-)structured data (legacy)
http://RML.io
52 stars 20 forks source link

using parameters in the templates #9

Open seralf opened 7 years ago

seralf commented 7 years ago

Hi

I have a case in which I need to provide at runtime certain parameters, in order to select the correct source from a collection of similar sources, and at the same time this should reflect on the generated uri.

Considering the following snippet from an example mapping based on some of the provided ones:

<#AirportMapping>
    rml:logicalSource [
        rml:source "{date}/airport.csv";
        rml:referenceFormulation ql:CSV
    ];
    rr:subjectMap [
     rr:template "http://airport.example.com/{date}/{id}";
     rr:class transit:Stop ;
    ];

I can correctly run

java ... RML-Mapper.jar -m my_mapping.ttl -o my_dump.ttl -p date=2016

then the processor correctly search for /2016/airport.csv, but it did not create (as I was wrongly expected) the subject(s) for http\://airport.example.com/2016/... In other terms my question is: Is there any way to interfere on the uri templates using parameters passed at runtime? I think once a parameter is passed from command line as a key/value pair, it could be helpful and very natural to have it available for templating.

canarvaeza commented 6 years ago

Hi,

Did you solve this?

seralf commented 6 years ago

no, I didn't sorry

canarvaeza commented 6 years ago

I think this option should be really usefull.

chiarisilver commented 6 years ago

It would be very useful also for me!