When running csv2rdf with just a -t table csv2rdf does not locate the metadata document, and instead performs the default conversion (note we should also provide a flag to adjust this behaviour #188).
It would be useful if csv2rdf could follow the spirit of the conventions specified in the specs for local files too.
Suggestion
NOTE: the specification falls back to RFC 5785 to specify the well-known location for the csvm templates file; however this RFC says nothing of what to do for the file:/// URI scheme.
Therefore I think the closest behaviour we can achieve here is to fallback to checking for a tool specific config folder ~/.csv2rdf/csvm, and use the template file from there; if no such template file is specified then we should use the default template file from the spec:
{+url}-metadata.json
csv-metadata.json
This would then give us the expected results where inputs like the following work:
with the final fall back csv-metadata.json being resolved in terms of the original provided URI/path. Resolution here will mean that a sibling csv-metadata.json to the supplied -t file will be located.
When running
csv2rdf
with just a-t
table csv2rdf does not locate the metadata document, and instead performs the default conversion (note we should also provide a flag to adjust this behaviour #188).It would be useful if
csv2rdf
could follow the spirit of the conventions specified in the specs for local files too.Suggestion
NOTE: the specification falls back to RFC 5785 to specify the well-known location for the
csvm
templates file; however this RFC says nothing of what to do for thefile:///
URI scheme.Therefore I think the closest behaviour we can achieve here is to fallback to checking for a tool specific config folder
~/.csv2rdf/csvm
, and use the template file from there; if no such template file is specified then we should use the default template file from the spec:This would then give us the expected results where inputs like the following work:
-t file:///Users/rick/data/my-data.csv
->
file:///Users/rick/data/my-data.csv-metadata.json
-t ../data/my-data.csv
->
../data/my-data.csv-metadata.json
with the final fall back
csv-metadata.json
being resolved in terms of the original provided URI/path. Resolution here will mean that a siblingcsv-metadata.json
to the supplied-t
file will be located.