logo Netzschleuder network catalog, repository, and centrifuge

History of recipe_rec

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/recipe_rec/__init__.py b/entries/recipe_rec/__init__.py
index 60c6778..eb98c1b 100644
--- a/entries/recipe_rec/__init__.py
+++ b/entries/recipe_rec/__init__.py
@@ -35,7 +35,7 @@ url = ['https://github.com/meettyj/RecipeRec',
        'https://zenodo.org/records/14003376',
        'https://github.com/xgi-org/xgi-data']
 citation = [('Y. Tian, C. Zhang, Z. Guo, C. Huang, R. Metoyer, N. V. Chawla, "RecipeRec: A Heterogeneous Graph Learning Model for Recipe Recommendation." Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence (IJCAI-22), 3466-3472 (2022)', 'https://doi.org/10.24963/ijcai.2022/481')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = ('CC BY 4.0', 'https://creativecommons.org/licenses/by/4.0/')
 upstream_prefix = 'https://zenodo.org/records/14003376/files'
 files = [('recipe-rec.json', None, None)]
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/recipe_rec/__init__.py b/entries/recipe_rec/__init__.py
index 449e58e..60c6778 100644
--- a/entries/recipe_rec/__init__.py
+++ b/entries/recipe_rec/__init__.py
@@ -26,9 +26,10 @@ description = """A bipartite network of recipes of the cooking website Food.com
 
 The network has the following properties:
 
-- `is_recipe`: whether the node is a recipe (otherwise an ingredient).
-- `name`: the name of the recipe or ingredient.
-- Recipes: `recipe_id`, the identifier of the recipe on Food.com; `url`, the address of the recipe on Food.com."""
+- (Node) `is_recipe`: whether the node is a recipe (otherwise an ingredient).
+- (Node) `name`: the name of the recipe or ingredient.
+- (Node) `recipe_id` (recipes): the identifier of the recipe on Food.com.
+- (Node) `url` (recipes): the address of the recipe on Food.com."""
 tags = ['Informational', 'Online', 'Unweighted', 'Metadata']
 url = ['https://github.com/meettyj/RecipeRec',
        'https://zenodo.org/records/14003376',
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/recipe_rec/__init__.py b/entries/recipe_rec/__init__.py
index 2f141b3..449e58e 100644
--- a/entries/recipe_rec/__init__.py
+++ b/entries/recipe_rec/__init__.py
@@ -47,7 +47,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fname, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] New entry: recipe_rec by Tiago de Paula Peixoto 1ab6dcc
diff --git a/entries/recipe_rec/__init__.py b/entries/recipe_rec/__init__.py
new file mode 100644
index 0000000..2f141b3
--- /dev/null
+++ b/entries/recipe_rec/__init__.py
@@ -0,0 +1,77 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+
+from .. import *
+
+
+title = "Food.com recipes and their ingredients (RecipeRec, 2022)"
+description = """A bipartite network of recipes of the cooking website Food.com and their ingredients, from the RecipeRec dataset of Tian et al. (collected from Food.com for a study of recipe recommendation), as distributed by XGI-data. Each recipe is connected to the ingredients it uses. Some recipes have the same set of ingredients (77,733 recipes, 74,870 distinct sets). The other parts of the RecipeRec dataset (e.g. the users and their ratings of the recipes) are not included in the XGI-data version.
+
+The network has the following properties:
+
+- `is_recipe`: whether the node is a recipe (otherwise an ingredient).
+- `name`: the name of the recipe or ingredient.
+- Recipes: `recipe_id`, the identifier of the recipe on Food.com; `url`, the address of the recipe on Food.com."""
+tags = ['Informational', 'Online', 'Unweighted', 'Metadata']
+url = ['https://github.com/meettyj/RecipeRec',
+       'https://zenodo.org/records/14003376',
+       'https://github.com/xgi-org/xgi-data']
+citation = [('Y. Tian, C. Zhang, Z. Guo, C. Huang, R. Metoyer, N. V. Chawla, "RecipeRec: A Heterogeneous Graph Learning Model for Recipe Recommendation." Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence (IJCAI-22), 3466-3472 (2022)', 'https://doi.org/10.24963/ijcai.2022/481')]
+icon_hash = None
+upstream_license = ('CC BY 4.0', 'https://creativecommons.org/licenses/by/4.0/')
+upstream_prefix = 'https://zenodo.org/records/14003376/files'
+files = [('recipe-rec.json', None, None)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fname, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        # HIF (hypergraph interchange format) of XGI
+        with open_upstream_file(name, fname, "r") as f:
+            d = json.load(f)
+        recipes = [e for e in d["edges"]]
+        for r in recipes:
+            r["id"] = int(re.search(r"-(\d+)$", r["attrs"]["url"]).group(1))
+        recipes.sort(key=lambda r: r["id"])
+        ingredients = sorted(set(x["node"] for x in d["incidences"]))
+        iindex = {x: i for i, x in enumerate(ingredients)}
+        N = len(ingredients)
+        rindex = {r["edge"]: N + i for i, r in enumerate(recipes)}
+        g = Graph(directed=False)
+        g.add_vertex(N + len(recipes))
+        g.vp.is_recipe = g.new_vp("bool")
+        g.vp.is_recipe.a[N:] = True
+        g.vp.name = g.new_vp("string", vals=ingredients +
+                                            [r["attrs"]["name"] for r in recipes])
+        g.vp.recipe_id = g.new_vp("int", val=-1)
+        g.vp.recipe_id.a[N:] = [r["id"] for r in recipes]
+        g.vp.url = g.new_vp("string", vals=[""] * N + [r["attrs"]["url"] for r in recipes])
+        g.add_edge_list(sorted(set((iindex[x["node"]], rindex[x["edge"]])
+                                   for x in d["incidences"]), key=lambda e: e[::-1]))
+        yield alt, g