Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource object should support additional properties/methods: local, remote, inline, multipart, tabular, source #23

Open
OriHoch opened this issue Jul 30, 2017 · 3 comments
Milestone

Comments

@OriHoch
Copy link
Collaborator

OriHoch commented Jul 30, 2017

  • resource.tabular -> true if resource is tabular
  • resource.table -> to access tableschema.Table for tabular resource
    • we support this but via the dataStream, need to see how to support it directly from the resource object
  • source/source_type (this two are still under consideration)

see the implementation docs: https://github.com/frictionlessdata/implementations#datapackage

@roll
Copy link
Member

roll commented Aug 3, 2017

Related to this issue:

Iterating or reading over the resource produces combined rows from all the path or data elements

foreach ($resource as $row) {};  // iterating
$resource->read();  // get all the data as an array

Not sure what's $resource->read() current behavior related to tabular/non-tabular resources. In other implementations we just expose Table API for tabular resources via resource.table.

@roll
Copy link
Member

roll commented Aug 3, 2017

@OriHoch
Also I think may it will be nicer instead of resource.source_type to expose following flags:

  • resource.multipart
  • resource.local
  • resource.remote
  • resource.inline

It will be logical continuation for resource.tabular flag, field.required flag etc

cc @georgiana-b

@roll roll changed the title resource object should support additional properties/methods: tabular, table, source_type, source resource object should support additional properties/methods: local, remote, inline, multipart, tabular, source Sep 13, 2017
@roll roll changed the title resource object should support additional properties/methods: local, remote, inline, multipart, tabular, source Resource object should support additional properties/methods: local, remote, inline, multipart, tabular, source Sep 13, 2017
@roll
Copy link
Member

roll commented Sep 13, 2017

So yes that's how (using boolean flags) now it's implemented in Python, JavaScript and Ruby:

resource.local
resource.remote
resource.inline
resource.multipart
resource.tabular

And alias for descriptor.data/path:

resource.source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants