herminiogg / ShExML

A heterogeneous data mapping language based on Shape Expressions
http://shexml.herminiogarcia.com
MIT License
15 stars 2 forks source link

Relative path for source #106

Closed luigi-asprino closed 2 years ago

luigi-asprino commented 3 years ago

Hi,

It seemed to me that the only way to declare a source file is via URL and (if I'm not wrong) you cannot express a relative filepath with a URL. I tested the following source declarations:

SOURCE src <./data/test.json>
SOURCE src <data/test.json>
SOURCE src <file:./data/test.json>
SOURCE src <file:/./data/test.json>
SOURCE src <file://./data/test.json>
SOURCE src <file:///./data/test.json>

The last four are not valid URLs (of course) but I found these formats are suggested in some stackoverflow threads. From my standpoint, allowing relative paths "./data/test.json" or "data/test.json" would be enough.

herminiogg commented 2 years ago

Hi @luigi-asprino,

In the new release, v0.2.7, you can use relative paths for sources. Your two first suggestions are now possible. The possibility to use the wildcard was also incorporated as when using the file:/// protocol so you can make something like: `SOURCE src <data/test_.json>` which will select all the files that match.

I hope that this feature can be helpful for you!

Best regards, Herminio

luigi-asprino commented 2 years ago

Great! Thank you!