question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Merging path and url for resources

See original GitHub issue

At the moment we have path and url. I originally had this to make it super easy for tool implementors (no lists of web protocols to match against `http://, https://, ftp://, etc).

At the same time it adds cognitive complexity to the spec and for publishers and confusion about whether one could use both #223 #232

The approach would be probably going forward just to have path and define like:

the location of the resource specified either as a fully qualified url or a unix-style path.
Data Packages may be found online or locally on disk and path should be interpreted
relative to that context (on disk it is a file path, online it is a url path). 

If a relative path is used it is interpreted relative to the base directory for the data
package (the parent directory of the datapackage.json).

Examples:

http://ex.datapackages.org/big-csv/my-big.csv
/examples/my-csv.csv  # absolute path
examples/my-csv.csv   # relative path

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:37 (33 by maintainers)

github_iconTop GitHub Comments

1reaction
pwalshcommented, Nov 10, 2016

@rgrp do you have a PR in the wings for this? I think the wording for the spec should be quite straight forward. I think we should also have a set of clear examples alongside that that addresses some of the above points.

Again here, I think in the various places this has been discussed, there is general agreement that it simplifies the prep of a data package for a publisher, and reduces ambiguity in multiple properties that do essentially the same thing, at the relatively small cost of implementing code needing to handle the file pointer disambiguation (fs vs http).

Any comments from the @frictionlessdata/specs-working-group before we start the PR process?

1reaction
pwalshcommented, Jul 12, 2016

So @rgrp I’m in agreement with your points:

  • Merge to path and allow it to be a full url (makes semantic sense: “path to the resource file”)
  • Deprecate url
  • Require implementors to do some regex’ing to distinguish urls from relative paths

Additionally, cache should be implemented, and follow the same rules. (worth mentioning here for the possibility that users were relying on presence of both url and path to keep local copies of remote resources.)

@roll @amercader @akariv @vitorbaptista you are all writing code around this in various places. What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Path.Combine for URLs?
42 Answers 42 ; /// Basically a Path.Combine for URLs. Ensures exactly one '/' separates each segment, /// and exactly on '&' separates...
Read more >
Merging Path
Merge - Focus on forward action & merge the path from where we are to where we want to be. Motivationally Listen -...
Read more >
Path.Combine Method (System.IO)
This method is intended to concatenate individual strings into a single string that represents a file path. However, if an argument other than...
Read more >
Getting started with merge requests - GitLab Documentation
When working in a Git-based platform, you can use branching strategies to collaborate on code. A repository is composed by its default branch,...
Read more >
Add app resources
Android Studio helps you add new resources and alternative resources in ... Add a resource directory; Change your resource directory; Resource merging.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found