logo Netzschleuder network catalog, repository, and centrifuge

History of foursquare

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/foursquare/__init__.py b/entries/foursquare/__init__.py
index 97f9538..f387732 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -34,7 +34,7 @@ The networks have the following properties:
 tags = ['Social', 'Online', 'Unweighted', 'Metadata']
 url = 'https://sites.google.com/site/yangdingqi/home/foursquare-dataset'
 citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'https://doi.org/10.1145/2493432.2493464')]
-icon_hash = '595b2553549f067e0263b553'
+date_added = '2020-08-11'
 upstream_license = None
 # The original download location is no longer online; the same archive
 # (dataset_ubicomp2013.zip) is in the authors' public Google Drive, linked
[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/foursquare/__init__.py b/entries/foursquare/__init__.py
index de0748a..97f9538 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -27,10 +27,10 @@ description = r"""Two bipartite networks of users and restaurant venues in New Y
 
 The networks have the following properties:
 
-- `is_user`: whether the node is a user (True) or a venue (False).
-- `name`: the anonymized user or venue ID.
-- `tags`: for venues, the list of tags that users added to the venue (e.g. "cupcake", "trendy"); empty for users and for venues without tags.
-- `tip_text` (edges, `NYC_restaurant_tips` only): the text of the tip."""
+- (Node) `is_user`: whether the node is a user (True) or a venue (False).
+- (Node) `name`: the anonymized user or venue ID.
+- (Node) `tags`: for venues, the list of tags that users added to the venue (e.g. "cupcake", "trendy"); empty for users and for venues without tags.
+- (Edge) `tip_text` (edges, `NYC_restaurant_tips` only): the text of the tip."""
 tags = ['Social', 'Online', 'Unweighted', 'Metadata']
 url = 'https://sites.google.com/site/yangdingqi/home/foursquare-dataset'
 citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'https://doi.org/10.1145/2493432.2493464')]
[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/foursquare/__init__.py b/entries/foursquare/__init__.py
index 666c397..de0748a 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__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] Move unavailable upstream sources to verified alternatives by Tiago de Paula Peixoto 2137af6
The upstream sources of these entries are gone, moved, or refuse automated
downloads; each now downloads the same data (byte-identical to the cached
files, or for board_directors, identical apart from line endings) from:

- add_health: the Wayback Machine (Moreno's site, as its sibling entries)
- board_directors: T. Opsahl's site (opsahl.co.uk)
- copenhagen, cow_signed_relations, fullerene_structures,
  german_power_grid: figshare's API (its downloader refuses the server)
- drosophila_flybi: the same address, without a doubled slash
- dutch_criticism: V. Batagelj's repository of Pajek data on GitHub
- fly_larva: the copy of the supplementary files in Europe PMC
- foursquare: the authors' Google Drive file
- game_thrones, microsoft_concept, un_migrations: pinned Wayback Machine
  snapshots
- internet_top_pop: the Topology Zoo repository on GitHub
- scotus_majority: Harvard Dataverse and Wayback Machine snapshots
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index a71ef60..666c397 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -36,11 +36,15 @@ url = 'https://sites.google.com/site/yangdingqi/home/foursquare-dataset'
 citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'https://doi.org/10.1145/2493432.2493464')]
 icon_hash = '595b2553549f067e0263b553'
 upstream_license = None
-upstream_prefix = 'http://www-public.it-sudparis.eu/~zhang_da/pub/'
-files = [(('dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_checkins.txt',
-           'dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_tags.txt'), 'NYC_restaurant_checkin', None),
-         (('dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_tips.txt',
-           'dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_tags.txt'), 'NYC_restaurant_tips', None)]
+# The original download location is no longer online; the same archive
+# (dataset_ubicomp2013.zip) is in the authors' public Google Drive, linked
+# from the dataset page
+upstream_prefix = 'gdrive://'
+archive = '1nlfogLwfachIOoywnPE003csLHEyqGEY:zip:dataset_ubicomp2013'
+files = [((f'{archive}/dataset_ubicomp2013_checkins.txt',
+           f'{archive}/dataset_ubicomp2013_tags.txt'), 'NYC_restaurant_checkin', None),
+         ((f'{archive}/dataset_ubicomp2013_tips.txt',
+           f'{archive}/dataset_ubicomp2013_tags.txt'), 'NYC_restaurant_tips', None)]
 
 
 def fetch_upstream(force=False):
[entries] Fix parse bugs and improve the metadata of existing entries by Tiago de Paula Peixoto c996a0e
From a review of the dataset descriptions against the upstream sources
and papers, and from user reports:

- parse fixes (wrong edge direction or directedness, shifted or
  misnamed properties, merged node identities, duplicated or missing
  edges and nodes, wrong types), e.g. arxiv_citation (the HepTh dates
  were a copy of the HepPh ones; now from the KDD Cup 2003 data),
  eu_procurements, foursquare_global, hiv_transmission, genetic_multiplex,
  gnutella (adds the 05 snapshot), roadnet, macaque_neural, python_dependency
- descriptions rewritten from the upstream sources, documenting every
  property
- corrected titles, citations and DOIs, licences (ustream_license typo,
  the data's own terms), tags and ICON ids
- url lists for entries with several sources or dataset pages
- SocioPatterns entries moved to the site's new data location, with the
  daily networks of sp_infectious and sp_primary_school
- the Michael Fire entries marked as orphans (served from the mirror)
- redundant type forcings removed after the graph-tool coercion fixes
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index d90bd6e..a71ef60 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -20,13 +20,22 @@ from .. import *
 import io
 
 title = "Foursquare NYC restaurants (2012)"
-description = """Two bipartite networks of users and restaurant locations in New York City on Foursquare, from 24 October 2011 to 20 February 2012. In one network, an edge denotes a check-in event of a user at a restaurant. In the other, an edge exists if a user left a tip/comment on a restaurant. Metadata include comments.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
+description = r"""Two bipartite networks of users and restaurant venues in New York City on the location-based social network Foursquare, collected by D. Yang and collaborators. Nodes are users and venues, and user and venue identifiers are anonymized but consistent across the two networks.
+
+- `NYC_restaurant_checkin`: each edge is a check-in of a user at a restaurant, between 24 October 2011 and 20 February 2012; repeated check-ins of the same user at the same venue appear as parallel edges.
+- `NYC_restaurant_tips`: each edge is a tip (a short text comment) left by a user on a restaurant. Tips were collected without time limit, so a user may have left a tip on a venue without checking in there during the check-in collection period.
+
+The networks have the following properties:
+
+- `is_user`: whether the node is a user (True) or a venue (False).
+- `name`: the anonymized user or venue ID.
+- `tags`: for venues, the list of tags that users added to the venue (e.g. "cupcake", "trendy"); empty for users and for venues without tags.
+- `tip_text` (edges, `NYC_restaurant_tips` only): the text of the tip."""
 tags = ['Social', 'Online', 'Unweighted', 'Metadata']
 url = 'https://sites.google.com/site/yangdingqi/home/foursquare-dataset'
 citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'https://doi.org/10.1145/2493432.2493464')]
 icon_hash = '595b2553549f067e0263b553'
-ustream_license = None
+upstream_license = None
 upstream_prefix = 'http://www-public.it-sudparis.eu/~zhang_da/pub/'
 files = [(('dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_checkins.txt',
            'dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_tags.txt'), 'NYC_restaurant_checkin', None),
@@ -60,11 +69,11 @@ def parse(alts=None):
             fs[0].seek(0)
             def get_lines():
                 for line in fs[0]:
-                    vals = line.split()
+                    vals = line.rstrip("\n").split("\t", 2)
                     for i in range(2):
                         vals[i] = int(vals[i])
                     vals[1] += nmax
-                    yield vals[:2] + [" ".join(vals[2:])]
+                    yield vals
             eprops = []
             if "tips" in alt:
                 g.ep.tip_text = g.new_ep("string")
@@ -77,7 +86,7 @@ def parse(alts=None):
             vs = {g.vp.name[v] : v for v in g.vertices() if not g.vp.is_user[v]}
             g.vp.tags = tags = g.new_vp("vector<string>")
             for line in fs[1]:
-                vals = line.split()
+                vals = line.rstrip("\n").split("\t")
                 if len(vals) < 2:
                     continue
                 try:
Update copyright information by Tiago de Paula Peixoto 73a4f0d
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index 6e19a90..d90bd6e 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# 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
Update copyright information by Tiago de Paula Peixoto 3d288ea
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index 8112e8f..6e19a90 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 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
Update copyright information by Tiago de Paula Peixoto 8d005ae
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index e390365..8112e8f 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 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
Update copyright info by Tiago de Paula Peixoto db2efcc
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index 2d6091e..e390365 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 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
Update citations to use DOIs by Tiago de Paula Peixoto e878874
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index 4f9b2dc..2d6091e 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -24,7 +24,7 @@ description = """Two bipartite networks of users and restaurant locations in New
 [^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Social', 'Online', 'Unweighted', 'Metadata']
 url = 'https://sites.google.com/site/yangdingqi/home/foursquare-dataset'
-citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'http://dl.acm.org/citation.cfm?id=2493464')]
+citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'https://doi.org/10.1145/2493432.2493464')]
 icon_hash = '595b2553549f067e0263b553'
 ustream_license = None
 upstream_prefix = 'http://www-public.it-sudparis.eu/~zhang_da/pub/'
Change license from GPLv3 to AGPLv3 by Tiago de Paula Peixoto d754be5
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index cc73bc9..4f9b2dc 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -3,18 +3,18 @@
 #
 # Copyright (C) 2020 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 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 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 General Public License for more details.
+# 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 General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# 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 *
 import io
Add explicit attribution to descriptions obtained from ICON by Tiago de Paula Peixoto 1645314
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
index 84a961e..cc73bc9 100644
--- a/entries/foursquare/__init__.py
+++ b/entries/foursquare/__init__.py
@@ -20,7 +20,8 @@ from .. import *
 import io
 
 title = "Foursquare NYC restaurants (2012)"
-description = "Two bipartite networks of users and restaurant locations in New York City on Foursquare, from 24 October 2011 to 20 February 2012. In one network, an edge denotes a check-in event of a user at a restaurant. In the other, an edge exists if a user left a tip/comment on a restaurant. Metadata include comments."
+description = """Two bipartite networks of users and restaurant locations in New York City on Foursquare, from 24 October 2011 to 20 February 2012. In one network, an edge denotes a check-in event of a user at a restaurant. In the other, an edge exists if a user left a tip/comment on a restaurant. Metadata include comments.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
 tags = ['Social', 'Online', 'Unweighted', 'Metadata']
 url = 'https://sites.google.com/site/yangdingqi/home/foursquare-dataset'
 citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'http://dl.acm.org/citation.cfm?id=2493464')]
Initial commit by Tiago de Paula Peixoto cc85872
diff --git a/entries/foursquare/__init__.py b/entries/foursquare/__init__.py
new file mode 100644
index 0000000..84a961e
--- /dev/null
+++ b/entries/foursquare/__init__.py
@@ -0,0 +1,87 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 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 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+import io
+
+title = "Foursquare NYC restaurants (2012)"
+description = "Two bipartite networks of users and restaurant locations in New York City on Foursquare, from 24 October 2011 to 20 February 2012. In one network, an edge denotes a check-in event of a user at a restaurant. In the other, an edge exists if a user left a tip/comment on a restaurant. Metadata include comments."
+tags = ['Social', 'Online', 'Unweighted', 'Metadata']
+url = 'https://sites.google.com/site/yangdingqi/home/foursquare-dataset'
+citation = [('D. Yang, et al. "Fine-grained preference-aware location search leveraging crowdsourced digital footprints from LBSNs." Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM. (2013).', 'http://dl.acm.org/citation.cfm?id=2493464')]
+icon_hash = '595b2553549f067e0263b553'
+ustream_license = None
+upstream_prefix = 'http://www-public.it-sudparis.eu/~zhang_da/pub/'
+files = [(('dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_checkins.txt',
+           'dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_tags.txt'), 'NYC_restaurant_checkin', None),
+         (('dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_tips.txt',
+           'dataset_ubicomp2013.zip:dataset_ubicomp2013/dataset_ubicomp2013_tags.txt'), 'NYC_restaurant_tips', 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:
+            bfs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
+            fs = [io.TextIOWrapper(f, encoding="ISO-8859-1") for f in bfs]
+            g = Graph(directed=False)
+            g.vp.is_user = g.new_vp("bool")
+            nmax = 0
+            for line in fs[0]:
+                nmax = max(nmax, int((line.split()[0])))
+            fs[0].seek(0)
+            def get_lines():
+                for line in fs[0]:
+                    vals = line.split()
+                    for i in range(2):
+                        vals[i] = int(vals[i])
+                    vals[1] += nmax
+                    yield vals[:2] + [" ".join(vals[2:])]
+            eprops = []
+            if "tips" in alt:
+                g.ep.tip_text = g.new_ep("string")
+                eprops.append(g.ep.tip_text)
+            g.vp.name = g.add_edge_list(get_lines(), hashed=True,
+                                        hash_type="int", eprops=eprops)
+            g.vp.is_user.fa = g.vp.name.fa <= nmax
+            g.vp.name.fa[g.vp.name.fa > nmax] -= nmax
+
+            vs = {g.vp.name[v] : v for v in g.vertices() if not g.vp.is_user[v]}
+            g.vp.tags = tags = g.new_vp("vector<string>")
+            for line in fs[1]:
+                vals = line.split()
+                if len(vals) < 2:
+                    continue
+                try:
+                    v = vs[int(vals[0])]
+                except KeyError:
+                    continue
+                tags[v] = [x for x in vals[1].split(",") if x != ""]
+        yield alt, g