frictionlessdata / datapackage

Data Package is a standard consisting of a set of simple yet extensible specifications to describe datasets, data files and tabular data. It is a data definition language (DDL) and data API that facilitates findability, accessibility, interoperability, and reusability (FAIR) of data.
https://datapackage.org
The Unlicense
498 stars 113 forks source link

Unclear about whether URL fragments are allowed as Data Resource `path` attributes #652

Closed iSnow closed 4 years ago

iSnow commented 4 years ago

The specs say:


URL or Path A "url-or-path" is a string with the following additional constraints:

Examples:

# fully qualified url
"path": "http://ex.datapackages.org/big-csv/my-big.csv"

# relative path
# **note: this will work both as a relative path on disk and on online**
"path": "my-data-directory/my-csv.csv"

So, on the one hand, we have "URLs MUST be fully qualified.", which means they have to be prefixed with http/https and the domain name. On the other hand, unqualified URLs work as a relative path online. That seems contradictory to me.

I'd like some clarity here - in the path attribute of a Data Resource, are path fragments allowed or not? If yes, do I understand it right that if the Descriptor (datapackage.json) is loaded from an URL, every path fragment is considered a relative URL, relative to the Descriptor URL? And if the Descriptor is loaded from a local file, it is considered a relative file system path?

OR

unqualified URL fragments are not allowed and the note above is wrong.

rufuspollock commented 4 years ago

I'd like some clarity here - in the path attribute of a Data Resource, are path fragments allowed or not? If yes, do I understand it right that if the Descriptor (datapackage.json) is loaded from an URL, every path fragment is considered a relative URL, relative to the Descriptor URL? And if the Descriptor is loaded from a local file, it is considered a relative file system path?

That is the correct interpretation. Note, strictly, the spec simply defines what is acceptable in that field and the hermenutics of that (i.e. the usage / meaning) can be indicated (and are indicated) but are, strictly, up to the implementor.

rufuspollock commented 4 years ago

FIXED. Feel free to re-open if needed 😄