-
Notifications
You must be signed in to change notification settings - Fork 529
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
Found unique recipe schema instrucitons #230
Comments
@jrvanderveen I came across this too (different site) just the other day. The schema for Here is the solution that I've been testing. I don't love the implementation, because it's not the most readable. But basically, build a string by looping through
Edit: Looking at this more now, looks like I missed a |
Thank you both @jrvanderveen and @jksimoniii for raising this issue! Certainly, this is something we'll want to address and will require some thought on implementation. @jksimoniii I'm brainstorming here: since each of the schema objects obviously conform to a schema could we marshal them into python dataclasses with dacite? That way we can write functionality on the against the Pinging @hhursev for thoughts and guidance! |
I decided to go ahead and push this commit. Pull the latest updates and PRs are more than welcome! Thanks for letting us know about the issue! What @jksimoniii had outlined is the exact cause for this. I've decided to go ahead and implement a "fix" for this specific case. Which brings us to the next topic raised by @bfcarpio. Schemas are quite .. um
complex for parsing. Despite Schema/Recipe being a subset of the vocabulary above, I suspect it won't be easy to organize into python classes/methods hierarchy. (won't be remotely the hardest thing either though). I'd say we keep on patching for now and if our _schemaorg file becomes gruesome then we can start thinking of using or creating a separate package. |
Thanks for addressing the issue. The last thing that I would point out is that we may want
|
Oh man, you got a point here. HowToSection.name should be included (especially when I look at the url here). I plan on submitting an update now which will lead to the following result:
Can you confirm if this is what you too had in mind @jksimoniii . Thanks |
Yeah, that looks good to me! I added some extra line breaks in mine for readability, but that's probably worth another conversation around output formatting. |
OR
and I'll adjust the failing tests from the previously implemented schema sites. It seems the "name" may be a rather important property. Let's vote 3/5. @jksimoniii @bfcarpio @jrvanderveen @jayaddison @hhursev (😄) Thumbs up for:
Thumbs down for:
|
This is the first time I've seen a name associated with |
EDIT: Sorry, I only saw the |
the caps is from how they've written it on the site. I was about to gather more examples for you but you already gave your vote! 😃 So - finito! |
Didn't mention the issue in the commit thus for references we include "name" starting from here. I'm closing the issue. Thanks everyone for the swift replies! |
Little late to the party here but I agree with everyone I think the implementation your going with could be really useful and is a more accurate pull of the instruction. Also @jksimoniii the risotto was amazing I would definitely recommend! |
Hi,
Was working on a PR for a new site https://www.feastingathome.com/tomato-risotto/ (Small but good blog site). It uses a recipe schema however it contains a interesting difference in the instructions that is not accounted for. There is a set of optional instructions. EX:
It has 5 steps that work fine and contain the "text" attribute
{"@type":"HowToStep","text":"In a large skillet, heat oil over medium-high heat. Add tomatoes (whole) and sear, stirring occasionally, until they burst and soften, about 7 minutes. Turn heat off. Chop if extra-large.","name":"BLISTER TOMATOES","url":"https://www.feastingathome.com/tomato-risotto/#instruction-step-1"},
But it contains a set of optional instructions that look like this
{"@type":"HowToSection","name":"Optional Seared Prawns:","itemListElement":[{"@type":"HowToStep","text":"If adding the prawns, mix spices and salt in a bowl. Coat shrimp with the spices. Heat 2-3 tablespoons oil in a skillet (you may need to do this in batches) over medium-high heat, sear each side 2-3 minutes or until cooked through. \u00a0Top the risotto with the seared prawns.","url":"https://www.feastingathome.com/tomato-risotto/#instruction-step-6"}]}]
It apearrs to be a nested set of optional instructions contained within the
itemListElement
attribute.This causes the get instructions to fail in _schemaorg.py
Im down to work on this. Wanted to get your opinions on it first however.
The text was updated successfully, but these errors were encountered: