History of stackexchange_answers
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/stackexchange_answers/__init__.py b/entries/stackexchange_answers/__init__.py
index 1ee2c4f..903c52d 100644
--- a/entries/stackexchange_answers/__init__.py
+++ b/entries/stackexchange_answers/__init__.py
@@ -40,7 +40,7 @@ url = ['https://www.cs.cornell.edu/~arb/data/mathoverflow-answers/',
'https://www.cs.cornell.edu/~arb/data/cat-edge-geometry-questions/']
citation = [('N. Veldt, A. R. Benson, J. Kleinberg, "Minimizing Localized Ratio Cut Objectives in Hypergraphs." Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 1708-1718 (2020)', 'https://doi.org/10.1145/3394486.3403222'),
('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')]
-icon_hash = None
+date_added = '2026-10-25'
upstream_license = ("Creative Commons Attribution-ShareAlike (CC BY-SA; version 3.0 or 4.0, depending on the date of each post)",
"https://stackoverflow.com/help/licensing")
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/stackexchange_answers/__init__.py b/entries/stackexchange_answers/__init__.py
index d7b279f..1ee2c4f 100644
--- a/entries/stackexchange_answers/__init__.py
+++ b/entries/stackexchange_answers/__init__.py
@@ -29,8 +29,10 @@ The source pages do not state when the `mathoverflow` and `stackoverflow` data w
The networks have the following properties:
-- `mathoverflow`, `stackoverflow`: `is_question`, whether the node is a question (otherwise a user); `tags`, the list of tags of each question (empty for users).
-- `algebra`, `geometry`: `is_group`, whether the node is a group of users who answered questions with a given tag in a given month (otherwise a user); `tag`, the question tag of the group (empty for users)."""
+- (Node) `is_question` (`mathoverflow`, `stackoverflow`): whether the node is a question (otherwise a user).
+- (Node) `tags` (`mathoverflow`, `stackoverflow`): the list of tags of each question (empty for users).
+- (Node) `is_group` (`algebra`, `geometry`): whether the node is a group of users who answered questions with a given tag in a given month (otherwise a user).
+- (Node) `tag` (`algebra`, `geometry`): the question tag of the group (empty for users)."""
tags = ['Social', 'Online', 'Informational', 'Unweighted', 'Metadata']
url = ['https://www.cs.cornell.edu/~arb/data/mathoverflow-answers/',
'https://www.cs.cornell.edu/~arb/data/stackoverflow-answers/',
[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/stackexchange_answers/__init__.py b/entries/stackexchange_answers/__init__.py
index 2e8749e..d7b279f 100644
--- a/entries/stackexchange_answers/__init__.py
+++ b/entries/stackexchange_answers/__init__.py
@@ -67,7 +67,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] New entry: stackexchange_answers 12a37f2
diff --git a/entries/stackexchange_answers/__init__.py b/entries/stackexchange_answers/__init__.py
new file mode 100644
index 0000000..2e8749e
--- /dev/null
+++ b/entries/stackexchange_answers/__init__.py
@@ -0,0 +1,106 @@
+#! /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 = "Stack Exchange question answering (2020)"
+description = """Bipartite networks of users of question-and-answer sites of the Stack Exchange network and the questions they answered, assembled by A. R. Benson and collaborators from Stack Exchange data. Users and questions are anonymized and given only as integer indices.
+
+- `mathoverflow`: users of MathOverflow (mathoverflow.net, a site for research-level mathematics), each connected to every question they answered. Questions carry the tags assigned to them on the site.
+- `stackoverflow`: the same construction for Stack Overflow (stackoverflow.com, a site for programming questions).
+- `algebra`, `geometry`: users of MathOverflow who answered questions whose tags match the patterns "\\*algebra\\*" (e.g. `lie-algebras`, `ac.commutative-algebra`) or "\\*geometry\\*" (e.g. `ag.algebraic-geometry`, `complex-geometry`), respectively, obtained from the MathOverflow data dumps. The answers were split into calendar months, and for each month and each matching tag there is a group node connected to all users who answered a question with that tag during that month. The same tag can therefore give rise to many groups (one per month in which it received answers), and identical sets of users can appear in several groups. The answers span the years 2009 to 2019, but the month of each group is not given in the source data. Users who belong to no group were removed.
+
+The source pages do not state when the `mathoverflow` and `stackoverflow` data were collected; the data were released in 2020.
+
+The networks have the following properties:
+
+- `mathoverflow`, `stackoverflow`: `is_question`, whether the node is a question (otherwise a user); `tags`, the list of tags of each question (empty for users).
+- `algebra`, `geometry`: `is_group`, whether the node is a group of users who answered questions with a given tag in a given month (otherwise a user); `tag`, the question tag of the group (empty for users)."""
+tags = ['Social', 'Online', 'Informational', 'Unweighted', 'Metadata']
+url = ['https://www.cs.cornell.edu/~arb/data/mathoverflow-answers/',
+ 'https://www.cs.cornell.edu/~arb/data/stackoverflow-answers/',
+ 'https://www.cs.cornell.edu/~arb/data/cat-edge-algebra-questions/',
+ 'https://www.cs.cornell.edu/~arb/data/cat-edge-geometry-questions/']
+citation = [('N. Veldt, A. R. Benson, J. Kleinberg, "Minimizing Localized Ratio Cut Objectives in Hypergraphs." Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 1708-1718 (2020)', 'https://doi.org/10.1145/3394486.3403222'),
+ ('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')]
+icon_hash = None
+upstream_license = ("Creative Commons Attribution-ShareAlike (CC BY-SA; version 3.0 or 4.0, depending on the date of each post)",
+ "https://stackoverflow.com/help/licensing")
+upstream_prefix = 'gdrive://'
+files = [(('1gQFLENs6gHzB_chAcxpBa6Q56k5X9k6a:zip:mathoverflow-answers/hyperedges-mathoverflow-answers.txt',
+ '1gQFLENs6gHzB_chAcxpBa6Q56k5X9k6a:zip:mathoverflow-answers/node-labels-mathoverflow-answers.txt',
+ '1gQFLENs6gHzB_chAcxpBa6Q56k5X9k6a:zip:mathoverflow-answers/label-names-mathoverflow-answers.txt'),
+ 'mathoverflow', None),
+ (('1CQpYlCoENcTXflwvFiKE-PrDS9f0yFKO:zip:stackoverflow-answers/hyperedges-stackoverflow-answers.txt',
+ '1CQpYlCoENcTXflwvFiKE-PrDS9f0yFKO:zip:stackoverflow-answers/node-labels-stackoverflow-answers.txt',
+ '1CQpYlCoENcTXflwvFiKE-PrDS9f0yFKO:zip:stackoverflow-answers/label-names-stackoverflow-answers.txt'),
+ 'stackoverflow', None),
+ (('1AuoFCdVIxz_MkSf6oO43OHAmD2shXBIC:zip:cat-edge-algebra-questions/hyperedges.txt',
+ '1AuoFCdVIxz_MkSf6oO43OHAmD2shXBIC:zip:cat-edge-algebra-questions/hyperedge-labels.txt',
+ '1AuoFCdVIxz_MkSf6oO43OHAmD2shXBIC:zip:cat-edge-algebra-questions/hyperedge-label-identities.txt'),
+ 'algebra', None),
+ (('1Bg1tUC5YA7Z0a4B-qLqXORxCVcNRfEbC:zip:cat-edge-geometry-questions/hyperedges.txt',
+ '1Bg1tUC5YA7Z0a4B-qLqXORxCVcNRfEbC:zip:cat-edge-geometry-questions/hyperedge-labels.txt',
+ '1Bg1tUC5YA7Z0a4B-qLqXORxCVcNRfEbC:zip:cat-edge-geometry-questions/hyperedge-label-identities.txt'),
+ 'geometry', 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]
+ if alt in ["mathoverflow", "stackoverflow"]:
+ # One line per user: the (1-based) questions it answered
+ users, questions, n_users = read_hyperedges(fs[0], sep=",")
+ del fs[0]
+ # Line i: comma-separated (1-based) tag indices of question i
+ qtags = [line.strip() for line in fs[0]]
+ tnames = [line.rstrip("\r\n") for line in fs[1]]
+ n_q = max(len(qtags), int(questions.max()) + 1)
+ g = bipartite_graph(questions, users, n_q, n_users,
+ "is_question")
+ del users, questions
+ g.vp.tags = g.new_vp("vector<string>")
+ for i, ts in enumerate(qtags):
+ if ts != "":
+ g.vp.tags[g.vertex(n_users + i)] = \
+ [tnames[int(t) - 1] for t in ts.split(",")]
+ else:
+ # One line per group: its (1-based) users, space-separated
+ groups, members, n = read_hyperedges(fs[0], sep=" ")
+ cat = read_ints(fs[1])
+ cnames = [line.rstrip("\r\n") for line in fs[2]]
+ # 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.tag = g.new_vp("string")
+ for i, c in enumerate(cat):
+ g.vp.tag[g.vertex(len(used) + i)] = cnames[c - 1]
+ yield alt, g