History of yelp_reviews
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 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/yelp_reviews/__init__.py b/entries/yelp_reviews/__init__.py
index 5d497ad..3a759a2 100644
--- a/entries/yelp_reviews/__init__.py
+++ b/entries/yelp_reviews/__init__.py
@@ -34,7 +34,7 @@ url = ['https://www.cs.cornell.edu/~arb/data/cat-edge-madison-restaurant-reviews
'https://www.cs.cornell.edu/~arb/data/cat-edge-vegas-bars-reviews/']
citation = [('I. Amburg, N. Veldt, A. R. Benson, "Diverse and Experienced Group Discovery via Hypergraph Clustering." Proceedings of the 2022 SIAM International Conference on Data Mining (SDM), 145-153 (2022)', 'https://doi.org/10.1137/1.9781611977172.17'),
('Yelp, "Yelp Dataset." Kaggle', 'https://www.kaggle.com/yelp-dataset/yelp-dataset')]
-icon_hash = None
+date_added = '2026-10-25'
upstream_license = ("Yelp Dataset Terms of Use", "https://www.yelp.com/dataset")
restricted = True
upstream_prefix = 'gdrive://'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/yelp_reviews/__init__.py b/entries/yelp_reviews/__init__.py
index cb16fd0..5d497ad 100644
--- a/entries/yelp_reviews/__init__.py
+++ b/entries/yelp_reviews/__init__.py
@@ -26,9 +26,9 @@ description = """Bipartite networks of Yelp users and groups of users who review
The networks have the following properties:
-- `is_group`: whether the node is a group of reviewers (otherwise it is a user).
-- User nodes: `id`, the number of the user in the source data (users that appear in no group are not included).
-- Group nodes: `category`, the establishment category reviewed by the group. The same set of users can appear in more than one group (in different months or categories)."""
+- (Node) `is_group`: whether the node is a group of reviewers (otherwise it is a user).
+- (Node) `id` (users): the number of the user in the source data (users that appear in no group are not included).
+- (Node) `category` (groups): the establishment category reviewed by the group. The same set of users can appear in more than one group (in different months or categories)."""
tags = ['Online', 'Commerce', 'Unweighted', 'Metadata']
url = ['https://www.cs.cornell.edu/~arb/data/cat-edge-madison-restaurant-reviews/',
'https://www.cs.cornell.edu/~arb/data/cat-edge-vegas-bars-reviews/']
[entries] Remove unneeded code from the entries 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/yelp_reviews/__init__.py b/entries/yelp_reviews/__init__.py
index 5c297fe..cb16fd0 100644
--- a/entries/yelp_reviews/__init__.py
+++ b/entries/yelp_reviews/__init__.py
@@ -55,7 +55,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fnames, alt, fmt in files:
if alts is not None and alt not in alts:
[entries] Remove the remarks on the distribution of the data from the descriptions of beer_reviews, bluesky_failla, citibike, divvy, facebook100, goodreads, hiv_transmission, hollywood_actors, mind_news, movielens_10m_tags, movielens_32m, movielens_ratings, netflix_prize, opensky_flights, opensky_flights_full, regulondb, statsbomb, yelp_restaurants and yelp_reviews 8be09c8
The descriptions said whether the data may be distributed (access tokens, restrictions, redistribution bans, take-downs); the site shows restricted entries itself, and the descriptions now only describe the data.
diff --git a/entries/yelp_reviews/__init__.py b/entries/yelp_reviews/__init__.py
index 61fdce5..5c297fe 100644
--- a/entries/yelp_reviews/__init__.py
+++ b/entries/yelp_reviews/__init__.py
@@ -28,9 +28,7 @@ The networks have the following properties:
- `is_group`: whether the node is a group of reviewers (otherwise it is a user).
- User nodes: `id`, the number of the user in the source data (users that appear in no group are not included).
-- Group nodes: `category`, the establishment category reviewed by the group. The same set of users can appear in more than one group (in different months or categories).
-
-The files of this entry are available only with an access token, since the Yelp Dataset terms forbid sharing the data with third parties."""
+- Group nodes: `category`, the establishment category reviewed by the group. The same set of users can appear in more than one group (in different months or categories)."""
tags = ['Online', 'Commerce', 'Unweighted', 'Metadata']
url = ['https://www.cs.cornell.edu/~arb/data/cat-edge-madison-restaurant-reviews/',
'https://www.cs.cornell.edu/~arb/data/cat-edge-vegas-bars-reviews/']
[entries] Restrict the entries whose upstream terms forbid redistribution ddb6c8c
movielens_100k (the MovieLens license forbids redistribution without permission), and yelp_reviews and yelp_restaurants (the Yelp Dataset terms forbid sharing the data with third parties) are now restricted: their files are available only with an access token, as their descriptions now say. yelp_reviews gets the Yelp Dataset terms as its license.
diff --git a/entries/yelp_reviews/__init__.py b/entries/yelp_reviews/__init__.py
index 495cb3c..61fdce5 100644
--- a/entries/yelp_reviews/__init__.py
+++ b/entries/yelp_reviews/__init__.py
@@ -28,14 +28,17 @@ The networks have the following properties:
- `is_group`: whether the node is a group of reviewers (otherwise it is a user).
- User nodes: `id`, the number of the user in the source data (users that appear in no group are not included).
-- Group nodes: `category`, the establishment category reviewed by the group. The same set of users can appear in more than one group (in different months or categories)."""
+- Group nodes: `category`, the establishment category reviewed by the group. The same set of users can appear in more than one group (in different months or categories).
+
+The files of this entry are available only with an access token, since the Yelp Dataset terms forbid sharing the data with third parties."""
tags = ['Online', 'Commerce', 'Unweighted', 'Metadata']
url = ['https://www.cs.cornell.edu/~arb/data/cat-edge-madison-restaurant-reviews/',
'https://www.cs.cornell.edu/~arb/data/cat-edge-vegas-bars-reviews/']
citation = [('I. Amburg, N. Veldt, A. R. Benson, "Diverse and Experienced Group Discovery via Hypergraph Clustering." Proceedings of the 2022 SIAM International Conference on Data Mining (SDM), 145-153 (2022)', 'https://doi.org/10.1137/1.9781611977172.17'),
('Yelp, "Yelp Dataset." Kaggle', 'https://www.kaggle.com/yelp-dataset/yelp-dataset')]
icon_hash = None
-upstream_license = None
+upstream_license = ("Yelp Dataset Terms of Use", "https://www.yelp.com/dataset")
+restricted = True
upstream_prefix = 'gdrive://'
files = [(('1H_aP6a11Iggg9lww4hbxyweuiLV-xrY9:zip:cat-edge-madison-restaurant-reviews/hyperedges.txt',
'1H_aP6a11Iggg9lww4hbxyweuiLV-xrY9:zip:cat-edge-madison-restaurant-reviews/hyperedge-labels.txt',
[entries] New entry: yelp_reviews be7fab2
diff --git a/entries/yelp_reviews/__init__.py b/entries/yelp_reviews/__init__.py
new file mode 100644
index 0000000..495cb3c
--- /dev/null
+++ b/entries/yelp_reviews/__init__.py
@@ -0,0 +1,81 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-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 = "Yelp reviewers of establishment categories (2005-2017)"
+description = """Bipartite networks of Yelp users and groups of users who reviewed establishments of the same category in the same month, compiled by Amburg, Veldt and Benson from the Yelp dataset distributed on Kaggle. The reviews of establishments of a given type in one city were split into month-long periods, and for each period and each establishment category (a Yelp sub-category, such as "Thai" or "Cocktail Bars") a group was formed with all users who reviewed an establishment of that category in that period; an edge connects each group to each of its users. Only groups with at least two users are included. The reviews span the years 2005 to 2017; the date of each group is not given in the data, and users are identified only by anonymous numbers.
+
+- `madison`: restaurants in Madison, Wisconsin, with ten cuisine categories (one of which, "Mongolian", has no group).
+- `vegas`: bars and nightlife establishments in Las Vegas, Nevada, with 18 categories (of which "Airport Lounges", "Tiki Bars" and "Wine Bars" have no group).
+
+The networks have the following properties:
+
+- `is_group`: whether the node is a group of reviewers (otherwise it is a user).
+- User nodes: `id`, the number of the user in the source data (users that appear in no group are not included).
+- Group nodes: `category`, the establishment category reviewed by the group. The same set of users can appear in more than one group (in different months or categories)."""
+tags = ['Online', 'Commerce', 'Unweighted', 'Metadata']
+url = ['https://www.cs.cornell.edu/~arb/data/cat-edge-madison-restaurant-reviews/',
+ 'https://www.cs.cornell.edu/~arb/data/cat-edge-vegas-bars-reviews/']
+citation = [('I. Amburg, N. Veldt, A. R. Benson, "Diverse and Experienced Group Discovery via Hypergraph Clustering." Proceedings of the 2022 SIAM International Conference on Data Mining (SDM), 145-153 (2022)', 'https://doi.org/10.1137/1.9781611977172.17'),
+ ('Yelp, "Yelp Dataset." Kaggle', 'https://www.kaggle.com/yelp-dataset/yelp-dataset')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'gdrive://'
+files = [(('1H_aP6a11Iggg9lww4hbxyweuiLV-xrY9:zip:cat-edge-madison-restaurant-reviews/hyperedges.txt',
+ '1H_aP6a11Iggg9lww4hbxyweuiLV-xrY9:zip:cat-edge-madison-restaurant-reviews/hyperedge-labels.txt',
+ '1H_aP6a11Iggg9lww4hbxyweuiLV-xrY9:zip:cat-edge-madison-restaurant-reviews/hyperedge-label-identities.txt'),
+ 'madison', None),
+ (('1Eh1AMoSm3Zu2dK6Cjp1zi84fHLqriaZE:zip:cat-edge-vegas-bars-reviews/hyperedges.txt',
+ '1Eh1AMoSm3Zu2dK6Cjp1zi84fHLqriaZE:zip:cat-edge-vegas-bars-reviews/hyperedge-labels.txt',
+ '1Eh1AMoSm3Zu2dK6Cjp1zi84fHLqriaZE:zip:cat-edge-vegas-bars-reviews/hyperedge-labels-identities.txt'),
+ 'vegas', 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 fnames, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ if isinstance(fnames, str):
+ fnames = [fnames]
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+
+ # One group per line, space-separated 1-based user numbers
+ groups, members, n = read_hyperedges(fs[0], sep=" ")
+ labels = read_ints(fs[1])
+ assert len(labels) == n
+ cats = [l.strip() for l in fs[2] if l.strip() != ""]
+
+ # Only the users that occur in some group
+ used, members = numpy.unique(members, return_inverse=True)
+ g = bipartite_graph(groups, members, n, len(used), "is_group")
+ g.vp.id = g.new_vp("int")
+ g.vp.id.a[:len(used)] = used + 1
+ g.vp.category = g.new_vp("string")
+ for i, c in enumerate(labels):
+ g.vp.category[len(used) + i] = cats[c - 1]
+ yield alt, g