Open Djyp opened 4 years ago
It looks pretty cool :smile: !
Some questions :
suitableForDiet
, is it a data like : ['vegan', 'gluten free']
?Properties from Recipe
?step
look pretty useless indeedestimatedCost
could be hard to set depending on regions, product origins, currency, etc. Is it compulsory ? I'm not sure.inLanguage
makes me think about internationalisation, it's maybe something we need to include from the start ?Some data types from marmiton.org seem strange :
"recipeYield": "6 personnes"
instead of a number ? Is it a virtual composed of a number and a unit ?recipeIngredients
are strings composed of a quantity, a unit and the product, I guess it's ok but would it be better to store a compound data like : { qty: Number, unit: Enum, ingredient: String }
? And build virtual string from it ?I have added a data dictionnary in documentation repository, it could be easier to handle a single file rather than editing here in issue, in different posts. What do you think about discussing here and editing there ?
I deleted obviously unwanted fields and formatted JSON to match table, if it's not wanted I can revert to marmiton's example. Please edit freely as well !
EDIT : Removed comments on the empty fields (which are not empty anymore :stuck_out_tongue: ). I agree with all other comments !
PS : what a table, you did great ! :muscle: :nerd_face:
Phew, just finished editing the table :sweat:
I don't understand
suitableForDiet
, is it a data like :['vegan', 'gluten free']
?
Yes !
What is inside
Properties from Recipe
?
Look at https://schema.org/Recipe, the Recipe type is like a class. Properties from Recipe
are properties specific to a Recipe, then there are inherited properties for HowTo
, CreativeWork
and Thing
. Of course it's just for the schema.org specification, our Recipe class will hold all the chosen properties
I would include
name
,author
,description
,image
from the long list at the bottom
Sure ! I wasn't done yet ;)
estimatedCost
could be hard to set depending on regions, product origins, currency, etc. Is it compulsory ? I'm not sure.
I guess we could take that off indeed. It would always be subjective.
What about all the empty rows ? You did not deal with it or it is not wanted ? Most of them seems not really useful.
I wasn't done, that why the first title contained «work in progress» 😉 The table was soooo long I had to complete later.
Some data types from marmiton.org seem strange
recipeYield
is either QuantitativeValue or Text
. What you see here is just the JSON-LD they chose to have on their website. We can persist whatever we want. I guess text is better so it's possible to store «4 parts», «One loaf», «A 40 cm wide pizza», «about 20 cookies»
For recipeIngredients
I was thinking about having all the ingredients in a text, it would be way eaiser to add new recipes like that. Many people will copy-paste from other ressources. Then we parse the text so that each line becomes a single ingredient. We will be able to build the JSON like that. If we want to parse it all to get a shopping list we will find a way.
We don't have
keywords
in the table but it exists in marmiton's datas, is it needed ? I think it's for filter efficiency/complexity but we already have categories and cuisines and if we store ingredients like described above, it would be possible to filter by ingredient too.
I am a 100% sure the keywords and description are calculated from the title and the ingredients to help with SEO. We don't need those, do we ?
I have added a data dictionnary
:tada: yeah !!
Sorry did not get the WIP status (thought it was for the discussion :stuck_out_tongue: ) :pray:
Ok for all thoses answers, it's pretty clear for me and it looks great ! What a work ! I will update data dictionnary according to this. Will PR it for a better worflow.
Here are the properties we intend to keep
Schema.org proposed property | Format | |
---|---|---|
cookTime | Duration in ISO format | |
recipeCategory | entrée, dessert | |
recipeCuisine | type of cuisine (French, Mexican, …) | |
recipeIngredient | schema.org says it's a single ingredient but it's a list of ingredients | |
recipeInstructions | Text | |
recipeYield | quantiy produced (number of servings, number of people) | |
suitableForDiet | Vegan, Lactose-free, Gluten free | |
prepTime | Duration to prepare the items do the instructions | |
tool | An object used (but not consumed) when performing instructions or a direction. Could be useful to tell you need a oven or a piping bag | |
totalTime | Total duration, calculated =prepTime+cookTime+waitTime | |
author | of course ! | ✔️ |
dateCreated | ✔️ | |
dateModified | ✔️ | |
datePublished | ✔️ | |
discussionUrl | ✔️ Could be used but not persisted | |
inLanguage | language in IETF BCP 47 Standard | ✔️ of course ! |
isFamilyFriendly | boolean | :question: it's a recipe ! but what if… :thinking: |
isPartOf | ✔️ To indicate the recipe is part of a cookbook | |
description | ✔️ Could bring context information "my grandma's most popular recipe", "typical dish in Kenya" and maybe comments from the author like "despire the instructions I always cook it 10 more minutes in my oven" | |
image | ✔️ of course ! | |
name | ✔️ obviously yes ! | |
url | ✔️ just for JSON-LD |
Here are the properties we need to talk about
Schema.org proposed property | Format | |
---|---|---|
abstract | summarized description | 🤷♂ maybe |
estimatedCost | Obvious | ✔️ |
accessibilityAPI | Indicates that the resource is compatible with the referenced accessibility API | ❓ Everything related to acessibility should be discussed |
accessibilityControl | Identifies input methods that are sufficient to fully control the described resource | ❓ |
accessibilityFeature | Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility | ❓ |
accessibilitySummary | Summary about accessibility | ❓ |
aggregateRating | The global rating | 🤷♂ Not sure if we should rate recipes, people like a recipe or not, I think if anything useful we could guess popular recipes with how much they are liked (activitypub-wise), shared and maybe forked |
comment | 🤷♂ Why not, but regarding ActivityPub comments are activity | |
commentCount | Only if we use comments | |
creativeWorkStatus | Draft, Published, Obsolete | ❓ |
exampleOf | ❓ could be used to tell what is work is forked from | |
isAccessibleForFree | boolean | ❓ let's use it in json-ld and always have on true |
isBasedOn | ❓ could be used to tell what is work is forked from | |
thumbnailUrl | ❓ could be used to have a thumbnail url of the image url | |
video | ❓ not sure |
I should have described all data types correctly.
It feels like all properties I wasn't sure of should just be put away
oh ! And I wanted to add a waitTime
property which doesn't exist in the Recipe schema.
It has been discussed https://github.com/schemaorg/schemaorg/issues/2164 but never really approved despite a few positive reactions to the idea
Abstract
: I think it's redundant with descriptionestimatedCost
: too highly relative to many environment factorscomment
: Would be comments ? why not, could be a nice feature in the future.commentCount
: It looks like a computed data, no need to persist ?creativeWorkStatus
: Could be nice on a collaborative purpose like : "I'm trying to set a super potatoe pie (why not ^^) but it's experimental, by setting status to experimental I could specify that it is not a ready to cook recipe but it is open to comments and improvements." Sorry for the example x)exampleOf
: Is it like : "this pie is an example of this recipe ?", I would put in an other model, more related to content sharing, like an activity that would be an instance of a specific recipe ?isAccessibleForFree
: Do we go for a possible reserved access ? I'm for scoped access related to instance rights but everthing should be free ? Or is it to let an instance decide whether they want to have premium access or not ? True important discussion here :yum: isBasedOn
: I see it as an extend this recipe, why not ! We could fork a recipe to Make our ownthumbnailUrl
: why not, I think I don't get it totally ^^video
: Yes, for future ! Do we need to implement it from the beginning ?waitTime
: Could be a very important data for some recipes. For instance I cook a lot of stuff that need this waitTime (bread, dough, etc.). Though it could be included in the prepTime.I will update data types in data dictionnary directly and make a PR to let you validate it ! Don't need to do it here I think.
Other models would be User
, Cookbook
. I don't see many different models.
Other models would be
User
,Cookbook
. I don't see many different models.
I don't see anything else either.
Regarding the PR :
Could a recipe have several categories ?
Sure ! Something could be a dessert or part of a breakfast (I deleted the question in my commit)
Could a recipe have several cuisines ?
I think not, if a dish as more than one origin it's probably a fusion dish like mexican-japanese food. (I deleted the question in my commit)
Is it raw ingredient or is it computed one with qty and unit ?
I'm not sure how to store the data. So for an easy way to add ingredients, I think the end-user should just have a textarea where he lists the ingredients with the quantity. One line, one ingredient. Then, I think we should analyze the list to extract each ingredients so we can compute a shopping list or calculate the quantities to double a recipe, or make it to yield 6 portions instead of 4. (question not deleted, tell me what you think)
Same for the recipeInstructions, I think we should have a single textarea than we split it in array of strings.
(recipeYield) Does it needs a related variable unit ?
No, not a fiex one. Let's have something where we are free to type "1 loaf", "300g of salad", "12 servings" or "4 personnes". The data should be language blind. If at any moment we need only the number we can have a special getter to extract it from the string. (I deleted the question in my commit)
(language)
I change the exemple from fr
to fr-fr
. We should always have the country because not all french countries have the same ways to specify quantities even if they have the same language.
In Europe, for example, french and british people use weight for many ingredients (which is more acurate but that's not the point here). In US and Canada, people use volumes for those ingredients (like flour or sugar). So statian recipes would say 2 cups flour
and brit recipes would say 440g flour
.
On top of that, not all countries use the same word for the same ingredients. A zuccini
is the french and english word in north america for the french courgette
.
(isFamilyFriendly)
I added a description in the commit
(isPartOf)
Not sure why I put it in the list like it was obvious. Indeed we need to talk about it. So the goal of this property is to link recipes. Like a specific sauce would be a part of a certain indian recipe. I think this could be really useful. But maybe people will have difficulties to understand it :shrug:
Maybe it could be added later ?
Agreed with everything. isPartOf
was indeed pretty obvious, my bad :yum:
I'm not sure how to store the data. So for an easy way to add ingredients, I think the end-user should just have a textarea where he lists the ingredients with the quantity. One line, one ingredient. Then, I think we should analyze the list to extract each ingredients so we can compute a shopping list or calculate the quantities to double a recipe, or make it to yield 6 portions instead of 4. (question not deleted, tell me what you think)
Same for the recipeInstructions, I think we should have a single textarea than we split it in array of strings.
It is indeed a good idea to keep it simple on client side with the textarea. I think it is also a good idea to compute the data from the string to extract and classify it. It leads to automatic shopping list, sharper search possibilities, etc. I would say that we could compute and store it to one yield (no matter is the unit chosen for it) in order to scale easily from one to any yield. It could look like :
const contentFromTextarea = ''1 cup of sugar, 200g of butter, ...";
const yields = 2;
// Default computation is for one yield
const storedData = [
{
ingredient: 'sugar',
quantity: 0.5,
unit: 'cup',
},
{
ingredient: 'butter',
quantity: 100,
unit: 'gram',
},
];
I think it could be awesome but it's quite a big computation to do because user input could be a huge mess :stuck_out_tongue:
I commited on current PR just to fix the table and close following questions :
isPartOf
isFamilyFriendly
The main remaining topic is on those instructions and ingredients and I guess we are pretty good.
I will add a commit for user and cookbook during lunch time if I manage to fix my work early on this morning :stuck_out_tongue: and will add discussion here or in an other issue, I don't know what is best practice in this kind of situation :smiley:
I commited a first proposal for Cookbook and User models.
Some points we need to discuss :
Let's talk about the data !
A year ago, I started thinking about the best way to store a recipe, and how to build the database. I came accross https://schema.org/Recipe
And here's my thought about it
Example of a recipe in JSON-LD on marmiton.org