rudof-project / rudof

RDF data shapes implementation in Rust
https://rudof-project.github.io
Apache License 2.0
35 stars 3 forks source link

perhaps treat file paths in CLI options as relative IRIs? #175

Open jonassmedegaard opened 2 weeks ago

jonassmedegaard commented 2 weeks ago

I stumbled upon #135 which reminded me of XDG specs consistently talking about URIs, never file paths.

How about doing similar for rudof: internally pass around only IRIs (i.e. technically Oxiri objects/structs, I guess), and only close to the UI surface of the CLI tool translate those from/to file paths. That is, advertise data-related options as accepting IRIs, using file:// as default scheme, and (if required) using current working directory as default base IRI.

On a related note, Oxiri v0.2.5 introduced handling relative IRIs.

labra commented 1 week ago

Yes, I was playing with that possibility in my recent work on adding support for imports which require the use of relative URIs and I think it is doable.

In fact, I noticed that there are like two different things to consider: Urls and File Paths, and that sometimes we need to jump from one to the other.

In our representation of InputSpec we created a union of three things: Paths, stdin and Urls which act as input specification and we convert them to IRIs in order to provide an IRI that represents the source of a ShEx schema which can act as it's base when importing another schema.

I keep this issue open because that work is not yet finished, but I think it goes in that direction.