logo Netzschleuder network catalog, repository, and centrifuge

History of facebook_pages

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/facebook_pages/__init__.py b/entries/facebook_pages/__init__.py
index ecb8034..551a407 100644
--- a/entries/facebook_pages/__init__.py
+++ b/entries/facebook_pages/__init__.py
@@ -42,7 +42,7 @@ url = ['https://snap.stanford.edu/data/gemsec-Facebook.html',
        'https://github.com/benedekrozemberczki/datasets']
 citation = [('B. Rozemberczki, R. Davies, R. Sarkar, and C. Sutton, "GEMSEC: Graph Embedding with Self Clustering." Proceedings of the 2019 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), 65-72 (2019).', 'https://doi.org/10.1145/3341161.3342890'),
             ('B. Rozemberczki, C. Allen, and R. Sarkar, "Multi-scale attributed node embedding." Journal of Complex Networks 9(2), cnab014 (2021).', 'https://doi.org/10.1093/comnet/cnab014')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = ('MIT License', 'https://github.com/benedekrozemberczki/datasets/blob/3b19135105432cbca65765c1113b91c395ed9d44/LICENSE')
 upstream_prefix = 'https://snap.stanford.edu/data'
 cats = ['athletes', 'artist', 'company', 'government', 'new_sites',
[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/facebook_pages/__init__.py b/entries/facebook_pages/__init__.py
index f50a757..ecb8034 100644
--- a/entries/facebook_pages/__init__.py
+++ b/entries/facebook_pages/__init__.py
@@ -30,8 +30,11 @@ description = r"""Networks of verified ("blue") Facebook pages, collected throug
 
 The networks have the following properties:
 
-- GEMSEC networks: none besides the node indices.
-- `musae`: `facebook_id`, the Facebook identifier of the page; `name`, the name of the page; `page_type`, its category ("politician", "government", "tvshow" or "company"); `features`, the indices of its binary features."""
+- (Node) None in the GEMSEC networks, besides the node indices.
+- (Node) `facebook_id` (`musae`): the Facebook identifier of the page.
+- (Node) `name` (`musae`): the name of the page.
+- (Node) `page_type` (`musae`): its category ("politician", "government", "tvshow" or "company").
+- (Node) `features` (`musae`): the indices of its binary features."""
 tags = ['Social', 'Online', 'Unweighted', 'Metadata']
 url = ['https://snap.stanford.edu/data/gemsec-Facebook.html',
        'https://snap.stanford.edu/data/facebook-large-page-page-network.html',
[entries] New entry: facebook_pages by Tiago de Paula Peixoto 264683f
diff --git a/entries/facebook_pages/__init__.py b/entries/facebook_pages/__init__.py
new file mode 100644
index 0000000..f50a757
--- /dev/null
+++ b/entries/facebook_pages/__init__.py
@@ -0,0 +1,98 @@
+#! /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 *
+
+import csv
+import json
+
+title = "Facebook verified page networks (2017)"
+description = r"""Networks of verified ("blue") Facebook pages, collected through the Facebook Graph API in November 2017 by B. Rozemberczki and collaborators for benchmarks of node embedding and classification methods. Nodes are pages, and an undirected edge connects two pages that like each other (mutual likes). There are two data sets:
+
+- GEMSEC: eight networks of pages of a single category, `athletes`, `artist`, `company`, `government`, `new_sites` (news sites), `politician`, `public_figure` and `tvshow`. The pages were reindexed for anonymity, so the networks have no node attributes. The edge lists contain self-loops (from 23 in `politician` and `tvshow` to 295 in `new_sites`), which are kept.
+- `musae`: a network of 22,470 pages of four categories (politicians, governmental organizations, television shows and companies), from the MUSAE study, with the names, Facebook identifiers and categories of the pages, and lists of binary features extracted from the descriptions written by the page owners (only the indices of the features are given, not their meaning). The edge list contains 179 self-loops, which are kept. SNAP no longer offers this data set for download; it was obtained from a pinned snapshot of the SNAP file in the Internet Archive (February 17, 2024).
+
+The networks have the following properties:
+
+- GEMSEC networks: none besides the node indices.
+- `musae`: `facebook_id`, the Facebook identifier of the page; `name`, the name of the page; `page_type`, its category ("politician", "government", "tvshow" or "company"); `features`, the indices of its binary features."""
+tags = ['Social', 'Online', 'Unweighted', 'Metadata']
+url = ['https://snap.stanford.edu/data/gemsec-Facebook.html',
+       'https://snap.stanford.edu/data/facebook-large-page-page-network.html',
+       'https://web.archive.org/web/20240217063517/https://snap.stanford.edu/data/facebook_large.zip',
+       'https://github.com/benedekrozemberczki/datasets']
+citation = [('B. Rozemberczki, R. Davies, R. Sarkar, and C. Sutton, "GEMSEC: Graph Embedding with Self Clustering." Proceedings of the 2019 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), 65-72 (2019).', 'https://doi.org/10.1145/3341161.3342890'),
+            ('B. Rozemberczki, C. Allen, and R. Sarkar, "Multi-scale attributed node embedding." Journal of Complex Networks 9(2), cnab014 (2021).', 'https://doi.org/10.1093/comnet/cnab014')]
+icon_hash = None
+upstream_license = ('MIT License', 'https://github.com/benedekrozemberczki/datasets/blob/3b19135105432cbca65765c1113b91c395ed9d44/LICENSE')
+upstream_prefix = 'https://snap.stanford.edu/data'
+cats = ['athletes', 'artist', 'company', 'government', 'new_sites',
+        'politician', 'public_figure', 'tvshow']
+files = [(f'gemsec_facebook_dataset.tar.gz:facebook_clean_data/{c}_edges.csv', c, None)
+         for c in cats]
+files += [(('facebook_large.zip:facebook_large/musae_facebook_edges.csv',
+            'facebook_large.zip:facebook_large/musae_facebook_target.csv',
+            'facebook_large.zip:facebook_large/musae_facebook_features.json'),
+           'musae', None)]
+# facebook_large.zip is no longer available from SNAP
+archived_urls = {
+    'facebook_large.zip': 'https://web.archive.org/web/20240217063517id_/https://snap.stanford.edu/data/facebook_large.zip'}
+
+def fetch_upstream(force=False):
+    name = __name__.split(".")[-1]
+    fetch_upstream_files(name, upstream_prefix, files[:-1], force)
+    # The Wayback Machine refuses connections when rate-limited, so retry
+    return fetch_archived_files(name, archived_urls, force, tries=6)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    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 open_upstream_file(name, fnames[0], "rb") as f:
+            E = numpy.loadtxt(f, delimiter=",", skiprows=1, dtype="int64")
+        g = Graph(directed=False)
+        # nodes are indexed consecutively from zero, and all appear in the
+        # edge lists
+        g.add_vertex(E.max() + 1)
+        g.add_edge_list(E)
+        if alt == "musae":
+            with open_upstream_file(name, fnames[1], "r") as f:
+                rows = list(csv.DictReader(f))
+            assert len(rows) == g.num_vertices()
+            g.vp.facebook_id = g.new_vp("int64_t")
+            g.vp.name = g.new_vp("string")
+            g.vp.page_type = g.new_vp("string")
+            for r in rows:
+                v = int(r["id"])
+                g.vp.facebook_id[v] = int(r["facebook_id"])
+                g.vp.name[v] = r["page_name"]
+                g.vp.page_type[v] = r["page_type"]
+            with open_upstream_file(name, fnames[2], "r") as f:
+                feats = json.load(f)
+            assert len(feats) == g.num_vertices()
+            g.vp.features = g.new_vp("vector<int32_t>")
+            for v, x in feats.items():
+                g.vp.features[int(v)] = x
+        yield alt, g