These are chat archives for frictionlessdata/chat

14th
Feb 2017
Adam Kariv
@akariv
Feb 14 2017 15:04

Hi, is there such a convention for addressing a specific resource file inside a datapackage:

<datapackage.json-url>#<resource-name>
?

For example http://example.com/path/to/datapackage.json#my-lovely-resource
Or even http://example.com/path/to/datapackage.json#1 for the 2nd resource in the datapackage?
Rufus Pollock
@rufuspollock
Feb 14 2017 15:06
@akariv not atm, but default i guess would be json-pointer ...
Adam Kariv
@akariv
Feb 14 2017 15:08
A json pointer would point to the resource descriptor, but I want a notatio that would resolve to the actual URL of the data file of the resource.
Use case:
Daniel Fowler
@danfowler
Feb 14 2017 15:10
@akariv @rufuspollock https://tools.ietf.org/html/rfc6901
Adam Kariv
@akariv
Feb 14 2017 15:14
Use case:
Suppose I have published multiple CSV files on the web packaged in a data package. I would like to still be able to give a direct link to a specific file itself.
I could give the URL of file (as it has one), but it would break the encapsulation principle.
@danfowler, yes - although since it's a convention anyway I see no advantage of using that over http://example.com/path/to/datapackage.json#0 or http://example.com/path/to/datapackage.json#resource-name (since we have a resource name, we should be able to use it and not rely on the order of the resources in the data package)
Daniel Fowler
@danfowler
Feb 14 2017 15:28

I suppose so, but conventions are good right?

With your examples, might we also want to reference other fields in a Data Package, not just the resources?

I guess this also points to why maybe resources would’ve been better served by an object rather than an array.

Adam Kariv
@akariv
Feb 14 2017 15:31
The thing is that it's not referencing a field in the datapackage - to get the URL for the resource there's some calculation that needs to be done.
So while
http://example.com/path/to/datapackage.json#/resources/0/name might resolve to my-lovely-resource and
http://example.com/path/to/datapackage.json#/resources/0/path might resolve to data/lovely-resource.csv,
http://example.com/path/to/datapackage.json#my-lovely-resource should resolve to http://example.com/path/to/data/lovely-resource.csv
Daniel Fowler
@danfowler
Feb 14 2017 15:43
ah
so it’s a different thing anyway
Adam Kariv
@akariv
Feb 14 2017 15:46
We can have both probably (since json pointers always start with / and resource names or index never do).
But I wonder if we'd like to introduce such conventions, and if so where would we define them.
Daniel Fowler
@danfowler
Feb 14 2017 16:24

Seems aligned with which generates valid datapackage.json URLs from various inputs:

http://specs.frictionlessdata.io/data-package-identifier/

Although that specification seems weirdly dependent on how GitHub renders raw URLs

Adam Kariv
@akariv
Feb 14 2017 16:27
Yes, seems like a good place to add this (identifiers for specific resources). @rufuspollock wdyt?