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

Proposal: add types as part of property keys (e.g. marketing:contains_toy.boolean = true) #21

Open
Tracked by #70
stephanegigandet opened this issue May 13, 2021 · 0 comments

Comments

@stephanegigandet
Copy link

stephanegigandet commented May 13, 2021

This is related to the namespace discussion in #17

@CharlesNepote 's example use of namespace was:

"recalled_product" => "yes"
"recalled_product:date" => "2021-05"
"recalled_product:link" => "https://rappel.conso.gouv.fr/fiche-rappel/383/Interne"

For the property above, the namespace suffix is also an indication of the type of value for the property.

I'm thinking it would make a lot of sense to specify the type directly in the key:

recalled_product.boolean = true | false -> the UI can handle displaying and inputing in different languages
recalled_product.date : the UI knows it's a date, so it can display a calendar
recalled_product.link : the UI knows it's a link, so it can display it as a link

Other useful types:

some_property.string
some_property.string:fr -> French value for the string (as suggested by Charles in #17)
number_of_units.integer

We could try to indicate "dimensions" as well:

packaging:width.length + packaging:height.length + packaging:length.length : all 3 properties are of the "length" dimension.
price_on_packaging.price : the propert is a price

And something that would be immensely useful is to allow taxonomies in types:

packaging:main_color.taxonomy:colors : the UI would allow input and output of "Blue" in any language

Something else that would be very tempting is to indicate in the property key name if it can have multiple values or not.
e.g. "packaging:colors.taxonomy:colors@" -> the @ (or any other sign or scheme) indicates that the property can have multiple values.

Of course all this should be transparent to users, they won't have to deal with the : , the . or the @, the UI will take care of it.

What do you think?

Part of

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

No branches or pull requests

1 participant