-
Notifications
You must be signed in to change notification settings - Fork 3
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
Relax resource.name
rules but keep it required and unique
#27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested some changes:
- Align the definitions
- Include human-readable aspect for both
- Reinstate uniqueness of resource names as a MUST
- Added section on required properties
@@ -191,23 +191,17 @@ Thus, a consumer of resource object `MAY` assume if no format or mediatype prope | |||
|
|||
### Metadata Properties | |||
|
|||
#### Required Properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Required properties section should be kept, since name
is a required property.
@@ -146,7 +146,7 @@ In addition to the required properties, the following properties `SHOULD` be inc | |||
|
|||
##### `name` | |||
|
|||
A short url-usable (and preferably human-readable) name of the package. This `MUST` be lower-case and contain only alphanumeric characters along with ".", "\_" or "-" characters. It will function as a unique identifier and therefore `SHOULD` be unique in relation to any registry in which this package will be deposited (and preferably globally unique). | |||
A short url-usable (and preferably human-readable) name of the package. This `SHOULD` be lower-case and contain only alphanumeric characters along with ".", "\_" or "-" characters. It will function as a unique identifier and therefore `SHOULD` be unique in relation to any registry in which this package will be deposited (and preferably globally unique). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A short url-usable (and preferably human-readable) name of the package. This `SHOULD` be lower-case and contain only alphanumeric characters along with ".", "\_" or "-" characters. It will function as a unique identifier and therefore `SHOULD` be unique in relation to any registry in which this package will be deposited (and preferably globally unique). | |
A simple name or identifier for the package. | |
The name `SHOULD` be human-readable and consist only of lowercase alphanumeric characters plus ".", "-" and "\_". | |
The name `SHOULD` be unique in relation to any registry in which this package will be deposited (and preferably globally unique). |
- Rewrote to align with resource
name
- Removed the url-usable (since this aligns with the character recommendation)
package. | ||
- It `MUST` consist only of lowercase alphanumeric characters plus ".", "-" and "\_". | ||
- If present, the name `SHOULD` be unique amongst all resources in this data package. | ||
- It `SHOULD` consist only of lowercase alphanumeric characters plus ".", "-" and "\_". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It `SHOULD` consist only of lowercase alphanumeric characters plus ".", "-" and "\_". | |
- It `SHOULD` be human-readable and consist only of lowercase alphanumeric characters plus ".", "-" and "\_". |
Add suggestion to be human-readable, cf. package name.
@peterdesmet Personally, and based on Rufus's arguments, I consider BTW, maybe it can be just enforced on an extension level? E.g. data package doesn't require |
Thanks @roll, I think the main issue for me is the "resource access by names" feature, which is currently key to reading data in frictionless-r. Rufus argument "All you need to identify a resource is a url or relative path!" is incorrect in my opinion, since So I suggest:
|
@peterdesmet Regarding implementations, I think the key here is that an implementation can generate names if it needs it (e.g. BTW I'm curious if we can finally make |
👍 Might be good to start from the original text on
Perhaps. And indeed as part of schema partial. It is non-backward compatible change though. |
Hmmm, like @peterdesmet I am loath to drop resource.name. My mental model of a
I think this is a key observation by @peterdesmet, and equally applies to fields. This gives us a guaranteed way of identifying fields and resources, even without names. In an API like foo <- list(field1 = "a", field2 = "b", field3 = "c")
foo[["field1"] # "a"
foo[[1]] # "a" We could do a similar thing with For example, a foreign keys def using names looking like this: "foreignKeys": [
{
"fields": "product",
"reference": {
"resource": ["product-info"],
"fields": ["product"]
}
}
] could be equivalently specified with indices like this (assuming "product-info" was the first resource in the datapackage, and "product" was its first field): "foreignKeys": [
{
"fields": "product",
"reference": {
"resource": [1],
"fields": [1]
}
}
] Whether we're using the
Agreed. As an identifier,
Oof, I didn't realize |
@khusmann excellent points, just a bit reluctant to roll out [resource name or index] everywhere where a resource is mentioned. It makes sense, but it is quite the dramatic change, just like dropping @roll can I suggest reducing this PR to removing the string constraints for And to create a separate PR for no longer requiring |
Focusing on the string constraints on |
Deploying with Cloudflare Pages
|
Great! I think we have a broad agreement on removing |
resource.name
rules but keep it required resource.name
rules but keep it required and unique
ACCEPTED by WG (6/9) |
name
should no longer be required (and need not be slug-friendly) specs#685Rationale
It's a fixed version of #21. In this edition,
resource.name
andfield.name
will have the same level of requirements (making it quite nice symmetry across the specs). Please see the reasons for relaxing the rules in the linked issue and PR.