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

Add tools database #1875

Open
seyfeb opened this issue Nov 2, 2023 · 0 comments
Open

Add tools database #1875

seyfeb opened this issue Nov 2, 2023 · 0 comments
Labels
Backend Issue or PR related to the backend code database issues that require a database migration enhancement New feature or request Frontend Issue or PR related to the frontend code investigation-required The Issue or PR needs more in-depth analysis

Comments

@seyfeb
Copy link
Collaborator

seyfeb commented Nov 2, 2023

Analogous to an ingredient database, see #135, a database for tools required for a recipe should be introduced.

This would allow for enhanced filtering of recipes, like

  • "Show all recipes that use a cookie cutter"
  • "Show all recipes that need only one pan"
  • "Hide all recipes that would require an oven"
  • etc.

A similar structure for the database, management, UI, ... as for the ingredients could be used.

Here is some JSON based on the discussion #1874:

Shortened JSON
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Recipe",

  // ...
  "tool": [
    {
      "@type": "HowToTool",
      "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
      "name": "large skillet",
      "description": "",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 1,
        "unitText": "unit",
        "unitCode": "C62"
      }
    },
    {
      "@type": "HowToTool",
      "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
      "name": "bowl",
      "description": "ca. 500 ml",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 1,
        "unitText": "unit",
        "unitCode": "C62"
      }
    },
    {
      "@type": "HowToTool",
      "identifier": "e015a3fb-ca67-4890-9ec7-05359828fa0c",
      "name": "baking dish",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 1,
        "unitText": "unit",
        "unitCode": "C62"
      }
    },
  ],
  "recipeInstructions": [
    {
      "@type": "HowToSection",
      "position": 1,
      // ...
      "itemListElement": [
        {
          "@type": "HowToDirection",
          // ...
          "tool": [
            {
              "@type": "HowToTool",
              "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
              "name": "large skillet",
              "description": "",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 1,
                "unitText": "unit",
                "unitCode": "C62"
              }
            }
          ]
        },
        {
          "@type": "HowToDirection",
          "position": 2,
          // ...
          "tool": []
        }
      ]
    },
    {
      "@type": "HowToSection",
      // ...
      "itemListElement": [
        {
          "@type": "HowToDirection",
          // ...
          "tool": [
            {
              "@type": "HowToTool",
              "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
              "name": "bowl",
              "description": "ca. 500 ml",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 1,
                "unitText": "unit",
                "unitCode": "C62"
              }
            }
          ]
        }
      ]
    },
    {
      "@type": "HowToDirection",
      // ...
      "tool": [
        {
          "@type": "HowToTool",
          "identifier": "e015a3fb-ca67-4890-9ec7-05359828fa0c",
          "name": "baking dish",
          "requiredQuantity": {
            "@type": "QuantitativeValue",
            "value": 1,
            "unitText": "unit",
            "unitCode": "C62"
          }
        }
      ]
    }
  ]
}
</script>
Full JSON
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Recipe",
  "name": "Delicious Lasagna",
  "totalTime": "PT1H30M",
  "cookTime": "PT40min",
  "recipeIngredient": [],
  "tool": [
    {
      "@type": "HowToTool",
      "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
      "name": "large skillet",
      "description": "",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 1,
        "unitText": "unit",
        "unitCode": "C62"
      }
    },
    {
      "@type": "HowToTool",
      "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
      "name": "bowl",
      "description": "ca. 500 ml",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 1,
        "unitText": "unit",
        "unitCode": "C62"
      }
    },
    {
      "@type": "HowToTool",
      "identifier": "e015a3fb-ca67-4890-9ec7-05359828fa0c",
      "name": "baking dish",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 1,
        "unitText": "unit",
        "unitCode": "C62"
      }
    },
  ],
  "supply": [
    {
      "@type": "HowToSupply",
      "identifier": "37d8e801-13fe-4ce9-ba93-6b8a35e6646f",
      "name": "ground beef",
      "description": "",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 0.5,
        "unitText": "kilogram",
        "unitCode": "KGM"
      }
    },
    {
      "@type": "HowToSupply",
      "identifier": "887ab19e-97be-43b1-bf20-b423b38eda5a",
      "name": "onion",
      "description": "diced",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 0.5,
        "unitText": "cup",
        "unitCode": "CU"
      }
    },
    {
      "@type": "HowToSupply",
      "identifier": "5bea667a-344a-44e9-a842-b6187e95b702",
      "description": "minced",
      "name": "garlic",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 2,
        "unitText": "clove"
      }
    },
    {
      "@type": "HowToSupply",
      "identifier": "f0a77778-5292-4bf4-8be2-4541a1cbd6ee",
      "name": "ricotta cheese",
      "description": "",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 2,
        "unitText": "cups",
        "unitCode": "CU"
      }
    },
    {
      "@type": "HowToSupply",
      "identifier": "ce0388ac-617f-4a15-9273-9ba805bf7523",
      "name": "shredded mozzarella cheese",
      "description": "",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 0.5,
        "unitText": "cup",
        "unitCode": "CU"
      }
    },
    {
      "@type": "HowToSupply",
      "identifier": "4563b9e4-460b-4325-96f2-9fc5ef349e81",
      "name": "salt",
      "description": "to taste"
    },
    {
      "@type": "HowToSupply",
      "identifier": "6811be83-8282-4851-bb88-749b3be727af",
      "name": "pepper",
      "description": "to taste"
    },
    {
      "@type": "HowToSupply",
      "identifier": "f16704c8-9b3f-4009-b6d1-1ec843e416f3",
      "name": "lasagne noodles",
      "description": "",
      "requiredQuantity": {
        "@type": "QuantitativeValue",
        "value": 12,
        "unitText": "piece",
        "unitCode": "C62"
      }
    }
  ],
  "recipeInstructions": [
    {
      "@type": "HowToSection",
      "position": 1,
      "name": "Prepare the Meat Sauce",
      "description": "First the meat sauce needs to be prepared. Be aware that this will take a lot of time to get the best result.",
      "image": [
        "meat_sauce_1.jpg",
        "meat_sauce_2.jpg"
      ],
      "thumbnailUrl": [
        "meat_sauce_1_thumb.jpg",
        "meat_sauce_2_thumb.jpg"
      ],
      "itemListElement": [
        {
          "@type": "HowToDirection",
          "position": 1,
          "image": ["ground_beef_in_pan.jpg"],
          "thumbnailUrl": ["ground_beef_in_pan_thumb.jpg"],
          "timeRequired": ["PT6M"],
          "text": "In a large skillet, brown the ground beef and the onions.",
          "supply": [
            {
              "@type": "HowToSupply",
              "identifier": "37d8e801-13fe-4ce9-ba93-6b8a35e6646f",
              "name": "ground beef",
              "description": "",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 0.5,
                "unitText": "kilogram",
                "unitCode": "KGM"
              }
            },
            {
              "@type": "HowToSupply",
              "identifier": "887ab19e-97be-43b1-bf20-b423b38eda5a",
              "name": "onion",
              "description": "diced",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 0.5,
                "unitText": "cup",
                "unitCode": "CU"
              }
            }
          ],
          "tool": [
            {
              "@type": "HowToTool",
              "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
              "name": "large skillet",
              "description": "",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 1,
                "unitText": "unit",
                "unitCode": "C62"
              }
            }
          ]
        },
        {
          "@type": "HowToDirection",
          "position": 2,
          "image": [],
          "thumbnailUrl": [],
          "timeRequired": ["PT4M"],
          "text": "Add minced garlic and sauté for a few minutes.",
          "supply": [
            {
              "@type": "HowToSupply",
              "identifier": "5bea667a-344a-44e9-a842-b6187e95b702",
              "description": "minced",
              "name": "garlic",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 2,
                "unitText": "clove"
              }
            }
          ],
          "tool": []
        }
      ]
    },
    {
      "@type": "HowToSection",
      "position": 2,
      "name": "Prepare the Cheese Filling",
      "description": "Get ready for the cheesy part...",
      "image": [],
      "thumbnailUrl": [],
      "itemListElement": [
        {
          "@type": "HowToDirection",
          "position": 1,
          "image": ["cheese_in_a_bowl.jpg"],
          "thumbnailUrl": ["cheese_in_a_bowl_thumb.jpg"],
          "timeRequired": ["PT2M"],
          "text": "In a bowl, combine ricotta cheese, mozzarella cheese, salt, and pepper.",
          "supply": [
            {
              "@type": "HowToSupply",
              "identifier": "f0a77778-5292-4bf4-8be2-4541a1cbd6ee",
              "name": "ricotta cheese",
              "description": "",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 2,
                "unitText": "cups",
                "unitCode": "CU"
              }
            },
            {
              "@type": "HowToSupply",
              "identifier": "ce0388ac-617f-4a15-9273-9ba805bf7523",
              "name": "shredded mozzarella cheese",
              "description": "",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 0.5,
                "unitText": "cup",
                "unitCode": "CU"
              }
            },
            {
              "@type": "HowToSupply",
              "identifier": "4563b9e4-460b-4325-96f2-9fc5ef349e81",
              "name": "salt",
              "description": "to taste"
            },
            {
              "@type": "HowToSupply",
              "identifier": "6811be83-8282-4851-bb88-749b3be727af",
              "name": "pepper",
              "description": "to taste"
            }
          ],
          "tool": [
            {
              "@type": "HowToTool",
              "identifier": "b3c0d2ff-009c-423e-89e8-e0245d027006",
              "name": "bowl",
              "description": "ca. 500 ml",
              "requiredQuantity": {
                "@type": "QuantitativeValue",
                "value": 1,
                "unitText": "unit",
                "unitCode": "C62"
              }
            }
          ]
        }
      ]
    },
    {
      "@type": "HowToDirection",
      "position": 3,
      "image": ["lasagna_layer.jpg"],
      "thumbnailUrl": ["lasagna_layer_thumb.jpg"],
      "timeRequired": ["PT10M"],
      "text": "In a baking dish, layer lasagna noodles, meat sauce, and cheese filling.",
      "supply": [
        {
          "@type": "HowToSupply",
          "identifier": "f16704c8-9b3f-4009-b6d1-1ec843e416f3",
          "name": "lasagne noodles",
          "description": "",
          "requiredQuantity": {
            "@type": "QuantitativeValue",
            "value": 12,
            "unitText": "piece",
            "unitCode": "C62"
          }
        },
        {
          "@type": "HowToSupply",
          "name": "meat sauce",
        },
        {
          "@type": "HowToSupply",
          "name": "cheese filling",
        }
      ],
      "tool": [
        {
          "@type": "HowToTool",
          "identifier": "e015a3fb-ca67-4890-9ec7-05359828fa0c",
          "name": "baking dish",
          "requiredQuantity": {
            "@type": "QuantitativeValue",
            "value": 1,
            "unitText": "unit",
            "unitCode": "C62"
          }
        }
      ]
    }
  ]
}
</script>
@seyfeb seyfeb added enhancement New feature or request Backend Issue or PR related to the backend code Frontend Issue or PR related to the frontend code investigation-required The Issue or PR needs more in-depth analysis database issues that require a database migration labels Nov 2, 2023
@seyfeb seyfeb added this to Backlog in NextCloud app via automation Nov 2, 2023
@seyfeb seyfeb added this to To do in UI rework via automation Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Issue or PR related to the backend code database issues that require a database migration enhancement New feature or request Frontend Issue or PR related to the frontend code investigation-required The Issue or PR needs more in-depth analysis
Projects
NextCloud app
  
Backlog
Development

No branches or pull requests

1 participant