Two mapping files create two R2RML mappings
Closed this issue · 6 comments
I wanted to split sources and mapping files, first according to "data producer" (as we have two institutions in the same data source). You can see the split and result in this commit on our mapping repo. The problem: Two files with file names mapping-stabs-ve.xrm
and mapping-rie-ve.xrm
create two separate R2RML mapping files. The R2RML mapping is encoded in the pipeline. I could of course change it there, too, but still would have to deal with multiple mapping files.
Wouldn't it be better to have one mapping file output in src-gen
?
@oschihin If you only want one generated R2RML mapping file, then you can put all map
elements into the same XRM file. The behavior that each XRM file containing one or more map
elements yields a corresponding generated mapping file is on purpose like that. This makes it for example possible to manage an R2RML mapping for a relational source and a RML mapping for a XML source in the same project.
On the other hand, how you split up sources, vocabularies or templates into separate XRM files has no impact on the amount of generated mapping files.
@mchlrch ok, I see the point. In my case, it would be nice to have shorter mapping files. For now, they're ok, but soon will be hard to handle. But then, there's outlines etc. And I'll need additional pipelines, all doable.
Thanks, I'll close.
One idea would be to add an optional argument to https://github.com/Staatsarchiv-Basel-Stadt/StABS-scope2RDF/blob/ece6c44b9add62fa567096fb065f9ce217c89e7f/src/mapping-rie-ve.xrm#L1 output r2rml
, for instance : output r2rml mymapping.r2rml.ttl
, what do you think?
Sounds like an interesting option, it would definitely help. One thought: Could template elements be used across different mapping files? This would allow to have simply a "template file".
Yes, templates, as well as vocabularies, can be used anywhere in the mappings. I have created such a "template file" in my mapping project: https://github.com/wikibus/migrate-sources/blob/master/mapping/templates.xrm
I don't see an open issue left in here, closing.