<script type="application/ld+json">{"@context": "https://schema.org","@graph": [{"@type": "Recipe","name": "Blätterteig-Schnitten mit Aprikose","description": "Luftiger Blätterteig und frische saftige Aprikosenstücke, ein ideales Dessert für spontane Gäste. Super schnell ist dieses Rezept gebacken und kann direkt vernascht werden.","keywords": "Rezepte,Dessert,einfache Desserts,Fingerfood \u0026 Snacks,Anlässe,Brunch,Party,Saison,Sommer,Aprikosen-Rezepte,Blätterteig,Ei,Milch,Aprikose,Butter,Zucker,Bourbon-Vanillezucker,Mehl,Mandeln,Aprikosenkonfitüre,Pistazien","recipeYield": ["12","12 Stücke"],"recipeCuisine": "deutsche Rezepte","dateModified": "2022-09-29T16:53:30+02:00","prepTime": "PT0M","datePublished": "2022-08-10T08:59:36+02:00","cookTime": "PT20M","totalTime": "PT20M","recipeInstructions": ["1. Ofen auf 200 Grad (Umluft 180 Grad) vorheizen. Blätterteig-Platten einzeln auf zwei Bleche mit Backpapier legen und etwas antauen lassen. Von allen Platten der Länge nach 2 dünne Streifen abschneiden. 1 Ei trennen. Eigelb mit Milch verquirlen und die Teigplatten und Streifen bepinseln. Je zwei Teigstreifen als Umrandung für jede Platten aufkleben. Die Platten mit einer Gabel leicht einstechen.","2. Aprikosen waschen putzen und vierteln. Butter mit Zucker und Bourbon-Vanillezucker schaumig schlagen. Übriges Eiweiß und das ganze Ei unterrühren. Mehl und Mandeln unterheben. Ca. 2 EL der Creme mittig auf die einzelnen Platten geben und verstreichen die Ränder freilassen. Aprikosenviertel auf die Creme setzen. Ca. 20-25 Min. backen. Auskühlen lassen. Aprikosenkonfitüre in einem kleinen Topf zum Kochen bringen. Mit einem Pinsel die Aprikosen damit bepinseln. Nach Belieben mit gemahlenen Pistazien garnieren."],"recipeIngredient": ["1 Pck. Tk- Blätterteig (à 4 Streifen)","2 Ei","1 EL Milch","700 g Aprikose","80 g weiche Butter","70 g Zucker","1 Pck. Bourbon-Vanillezucker","50 g Mehl","50 g gemahlene Mandeln","3 - 4 EL Aprikosenkonfitüre","etwas gemahlene Pistazien zur Deko"],"recipeCategory": "einfache Desserts","author": {"@type": "Person","name": "Siggi","url": "https://www.einfachbacken.de/autoren/siggi"},"nutrition": {"@type": "NutritionInformation","servingSize": "Portion"},"image": {"@type": "ImageObject","representativeOfPage": "True","url": "https://www.einfachbacken.de/sites/einfachbacken.de/files/styles/facebook/public/2018-08/blaetterteig_mit_aprikosen_42387-png-converted.jpg?h=4521fff0\u0026itok=iW6awCD5","width": "1200","height": "630"},"aggregateRating": {"@type": "AggregateRating","ratingValue": "4.4","ratingCount": "5","bestRating": "5","worstRating": "1"},"publisher": {"@type": "Organization","name": "einfach backen","url": "https://www.einfachbacken.de","logo": {"@type": "ImageObject","url": "https://www.einfachbacken.de/assets/images/logo-einfachbacken-60.jpg","width": 146,"height": 60},"address": {"@type": "PostalAddress","addressCountry": "DE","addressLocality": "Offenburg","postalCode": "77652","streetAddress": "Hubert Burda Platz 1"}}}]
}</script>
Describe the bug
If the object ['
graph'] was found, the check '$checkContext' in the JsonService class is returned as false.
To Reproduce
Steps to reproduce the behavior:
Without method 'mapGraphField' the array results:
Using method 'mapGraphField' in class HttpJsonLdParser produces the array
array(19) {
["@type"] => string(6) "Recipe"
...
}
The object ['context'] is then no longer present in this array.
Additional context
The recipe from the URL specified above cannot then be imported and an error is thrown:
No parser could be found for the specified import.
I change each time:
($this->jsonService->isSchemaObject($xxx, 'Recipe', true, false))
to
($this->jsonService->isSchemaObject($xxx, 'Recipe', false, false))
in class HttpJsonLdParser->parseJsonLdElement, class HttpJsonLdParser-> searchForRecipeInArray
The recipe is imported.
Would that be taken out of class JsonService
if ($checkContext) {
if (!isset($obj['@context']) || ! preg_match('@^https?://schema\.org/?$@', $obj['@context'])) {
// We have no correct context property
return false;
}
}
and this into class HttpJsonLdParser->parseJsonLdElement after
if ($json === null) {
throw new HtmlParsingException($this->l->t('JSON cannot be decoded.'));
}
insert
if (!isset($json['@context']) || ! preg_match('@^https?://schema\.org/?$@', $json['@context'])) {
// We have no correct context property
throw new Exception('No schema was found.');
}
this could be fixed.
This would then allow more recipes to be imported.
Nextcloud: 27.1.5 Cookbook 0.10.5
Recipe:
https://www.einfachbacken.de/rezepte/blaetterteig-schnitten-mit-aprikose
Describe the bug If the object [' graph'] was found, the check '$checkContext' in the JsonService class is returned as false.
To Reproduce Steps to reproduce the behavior: Without method 'mapGraphField' the array results:
Using method 'mapGraphField' in class HttpJsonLdParser produces the array
The object ['context'] is then no longer present in this array.
Additional context The recipe from the URL specified above cannot then be imported and an error is thrown: No parser could be found for the specified import.
I change each time:
($this->jsonService->isSchemaObject($xxx, 'Recipe', true, false))
to($this->jsonService->isSchemaObject($xxx, 'Recipe', false, false))
in class HttpJsonLdParser->parseJsonLdElement, class HttpJsonLdParser-> searchForRecipeInArray
The recipe is imported.
Would that be taken out of class JsonService
and this into class HttpJsonLdParser->parseJsonLdElement after
insert
this could be fixed.
This would then allow more recipes to be imported.