logo Netzschleuder network catalog, repository, and centrifuge

History of ao3

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/ao3/__init__.py b/entries/ao3/__init__.py
index 33d5118..4e1a3d0 100644
--- a/entries/ao3/__init__.py
+++ b/entries/ao3/__init__.py
@@ -47,7 +47,7 @@ tags = ['Social', 'Online', 'Folksonomy', 'Bipartite', 'Unweighted', 'Metadata']
 url = ['https://archiveofourown.org/admin_posts/18804']
 citation = [('Organization for Transformative Works, "Selective data dump for fan statisticians." Archive of Our Own (2021)',
              'https://archiveofourown.org/admin_posts/18804')]
-icon_hash = None
+date_added = '2026-10-28'
 upstream_license = None
 upstream_prefix = 'https://media.archiveofourown.org/ao3/stats/2021/02/26'
 files = [(('20210226-stats.zip:works-20210226.csv',
[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/ao3/__init__.py b/entries/ao3/__init__.py
index 4ece839..33d5118 100644
--- a/entries/ao3/__init__.py
+++ b/entries/ao3/__init__.py
@@ -31,18 +31,18 @@ To protect the privacy of the authors, the names of the tags used fewer than fiv
 
 The network has the following properties:
 
-- `is_work`: whether the node is a work (otherwise it is a tag).
-- `time` (works): the creation date of the work, as Unix time.
-- `language` (works): the language of the work, as a code (e.g. `en`, `zh`).
-- `restricted` (works): whether the work is visible only to registered users.
-- `complete` (works): whether the work is complete.
-- `word_count` (works): the number of words of the work (-1 if not given).
-- `tag_id` (tags): the identifier of the tag on AO3 (-1 for works).
-- `name` (tags): the name of the tag (`Redacted` if it was used fewer than five times).
-- `type` (tags): the type of the tag: `Rating`, `ArchiveWarning`, `Category`, `Fandom`, `Character`, `Relationship`, `Freeform`, `Media` or `UnsortedTag` (tags not yet sorted by the wranglers).
-- `canonical` (tags): whether the tag is canonical.
-- `cached_count` (tags): the approximate number of uses of the tag, as given by AO3.
-- `merger_id` (tags): the identifier of the canonical tag of which the tag is a synonym (-1 if none)."""
+- (Node) `is_work`: whether the node is a work (otherwise it is a tag).
+- (Node) `time` (works): the creation date of the work, as Unix time.
+- (Node) `language` (works): the language of the work, as a code (e.g. `en`, `zh`).
+- (Node) `restricted` (works): whether the work is visible only to registered users.
+- (Node) `complete` (works): whether the work is complete.
+- (Node) `word_count` (works): the number of words of the work (-1 if not given).
+- (Node) `tag_id` (tags): the identifier of the tag on AO3 (-1 for works).
+- (Node) `name` (tags): the name of the tag (`Redacted` if it was used fewer than five times).
+- (Node) `type` (tags): the type of the tag: `Rating`, `ArchiveWarning`, `Category`, `Fandom`, `Character`, `Relationship`, `Freeform`, `Media` or `UnsortedTag` (tags not yet sorted by the wranglers).
+- (Node) `canonical` (tags): whether the tag is canonical.
+- (Node) `cached_count` (tags): the approximate number of uses of the tag, as given by AO3.
+- (Node) `merger_id` (tags): the identifier of the canonical tag of which the tag is a synonym (-1 if none)."""
 tags = ['Social', 'Online', 'Folksonomy', 'Bipartite', 'Unweighted', 'Metadata']
 url = ['https://archiveofourown.org/admin_posts/18804']
 citation = [('Organization for Transformative Works, "Selective data dump for fan statisticians." Archive of Our Own (2021)',
[entries] New entry: ao3 by Tiago de Paula Peixoto e98e5cf
diff --git a/entries/ao3/__init__.py b/entries/ao3/__init__.py
new file mode 100644
index 0000000..4ece839
--- /dev/null
+++ b/entries/ao3/__init__.py
@@ -0,0 +1,174 @@
+#! /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/>.
+
+import pyarrow
+import pyarrow.csv
+import pyarrow.compute as pc
+
+from .. import *
+
+title = "Archive of Our Own fan fiction works and tags (2021)"
+description = r"""A bipartite network of the works of fan fiction published on the Archive of Our Own (AO3), the fan works repository of the Organization for Transformative Works (OTW), and the tags attached to them, from the one-time data dump released by the OTW on 26 February 2021 "for fan statisticians". It covers all the works on AO3 at the time, from 2008 to February 2021, except those hidden by the site (e.g. drafts and works hidden by its administrators).
+
+An edge connects a work to each of its tags. AO3 tags describe the works along several dimensions, each a tag type: the rating (e.g. `General Audiences`, `Explicit`), the archive warnings, the categories of relationships (e.g. `F/M`, `M/M`, `Gen`), the fandoms (the source works, e.g. `Harry Potter - J. K. Rowling`), the characters, the relationships between characters (e.g. `Draco Malfoy/Harry Potter`), and free-form tags (e.g. `Fluff`, `Alternate Universe`). Tags are written freely by the authors, and the volunteer "tag wranglers" of AO3 mark one tag of each set of synonyms as canonical, and the others as synonyms of it (merged into it); the works are linked to the tags as written by their authors, and the canonical tag of a tag is given by the property `merger_id`.
+
+To protect the privacy of the authors, the names of the tags used fewer than five times were redacted by the OTW (their name is `Redacted`, about 12.8 million of the 14.5 million tags). The works carry no identifiers, titles or authors, and are numbered in the order of the dump (roughly by decreasing creation date). Only the tags used by some work are nodes of the network (tags that are only canonical versions of other tags, without works of their own, are left out; they are still identified by `merger_id`). 8,139 tags used by works are missing from the tag file of the dump; their name and type are empty, `canonical` is false, and `cached_count` and `merger_id` are -1. Three empty items in the tag lists of the works are left out.
+
+The network has the following properties:
+
+- `is_work`: whether the node is a work (otherwise it is a tag).
+- `time` (works): the creation date of the work, as Unix time.
+- `language` (works): the language of the work, as a code (e.g. `en`, `zh`).
+- `restricted` (works): whether the work is visible only to registered users.
+- `complete` (works): whether the work is complete.
+- `word_count` (works): the number of words of the work (-1 if not given).
+- `tag_id` (tags): the identifier of the tag on AO3 (-1 for works).
+- `name` (tags): the name of the tag (`Redacted` if it was used fewer than five times).
+- `type` (tags): the type of the tag: `Rating`, `ArchiveWarning`, `Category`, `Fandom`, `Character`, `Relationship`, `Freeform`, `Media` or `UnsortedTag` (tags not yet sorted by the wranglers).
+- `canonical` (tags): whether the tag is canonical.
+- `cached_count` (tags): the approximate number of uses of the tag, as given by AO3.
+- `merger_id` (tags): the identifier of the canonical tag of which the tag is a synonym (-1 if none)."""
+tags = ['Social', 'Online', 'Folksonomy', 'Bipartite', 'Unweighted', 'Metadata']
+url = ['https://archiveofourown.org/admin_posts/18804']
+citation = [('Organization for Transformative Works, "Selective data dump for fan statisticians." Archive of Our Own (2021)',
+             'https://archiveofourown.org/admin_posts/18804')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'https://media.archiveofourown.org/ao3/stats/2021/02/26'
+files = [(('20210226-stats.zip:works-20210226.csv',
+           '20210226-stats.zip:tags-20210226.csv'), None, None)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+# For checks only: if set, only (about) this many works are read
+_check_rows = None
+
+@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
+        # Works: "creation date,language,restricted,complete,word_count,tags",
+        # with a trailing comma in the header only; the tags are ids joined
+        # by "+"
+        cols = ["date", "language", "restricted", "complete", "word_count",
+                "tags"]
+        date, lang, restr, compl, words, src, tgt = [], [], [], [], [], [], []
+        W = 0
+        with open_upstream_file(name, fnames[0], "rb") as f:
+            reader = pyarrow.csv.open_csv(
+                f,
+                read_options=pyarrow.csv.ReadOptions(column_names=cols,
+                                                     skip_rows=1,
+                                                     block_size=1 << 26),
+                convert_options=pyarrow.csv.ConvertOptions(
+                    column_types={"date": pyarrow.string(),
+                                  "language": pyarrow.string(),
+                                  "restricted": pyarrow.bool_(),
+                                  "complete": pyarrow.bool_(),
+                                  "word_count": pyarrow.float64(),
+                                  "tags": pyarrow.string()}))
+            for batch in reader:
+                if _check_rows is not None and W >= _check_rows:
+                    break
+                date.append(pc.strptime(batch.column("date"), format="%Y-%m-%d",
+                                        unit="s").cast(pyarrow.int64()).to_numpy())
+                lang.extend(batch.column("language").to_pylist())
+                restr.append(batch.column("restricted").to_numpy(zero_copy_only=False))
+                compl.append(batch.column("complete").to_numpy(zero_copy_only=False))
+                words.append(pc.fill_null(batch.column("word_count"), -1)
+                             .to_numpy(zero_copy_only=False).astype("int64"))
+                t = pc.split_pattern(batch.column("tags"), "+")
+                # (a few lists have empty items, e.g. "10++21", skipped)
+                ft = pc.list_flatten(t)
+                ok = pc.not_equal(ft, "")
+                src.append((W + pc.list_parent_indices(t).filter(ok).to_numpy()).astype("int32"))
+                tgt.append(ft.filter(ok).cast(pyarrow.int32()).to_numpy())
+                W += batch.num_rows
+                del t, batch
+        src = numpy.concatenate(src)
+        tgt = numpy.concatenate(tgt)
+
+        # Tags: "id,type,name,canonical,cached_count,merger_id"; only those
+        # used by some work
+        with open_upstream_file(name, fnames[1], "rb") as f:
+            tags = pyarrow.csv.read_csv(
+                f, convert_options=pyarrow.csv.ConvertOptions(
+                    column_types={"id": pyarrow.int64(), "name": pyarrow.string(),
+                                  "type": pyarrow.string(),
+                                  "merger_id": pyarrow.int64()},
+                    strings_can_be_null=False))
+        used = numpy.zeros(max(tgt.max(), pc.max(tags["id"]).as_py()) + 1, dtype="bool")
+        used[tgt] = True
+        tag_ids = numpy.flatnonzero(used).astype("int64")
+        del used
+        T = len(tag_ids)
+        tgt = W + numpy.searchsorted(tag_ids, tgt)
+
+        g = Graph(directed=False)
+        g.add_vertex(W + T)
+        g.add_edge_list(numpy.column_stack((src, tgt)))
+        del src, tgt
+
+        g.vp.is_work = g.new_vp("bool")
+        g.vp.is_work.a[:W] = 1
+        g.vp.time = g.new_vp("int64_t")
+        g.vp.time.a[:] = -1
+        g.vp.time.a[:W] = numpy.concatenate(date)
+        del date
+        g.vp.language = g.new_vp("string", vals=lang + [""] * T)
+        del lang
+        g.vp.restricted = g.new_vp("bool")
+        g.vp.restricted.a[:W] = numpy.concatenate(restr)
+        g.vp.complete = g.new_vp("bool")
+        g.vp.complete.a[:W] = numpy.concatenate(compl)
+        g.vp.word_count = g.new_vp("int64_t")
+        g.vp.word_count.a[:] = -1
+        g.vp.word_count.a[:W] = numpy.concatenate(words)
+        del restr, compl, words
+
+        g.vp.tag_id = g.new_vp("int64_t")
+        g.vp.tag_id.a[:] = -1
+        g.vp.tag_id.a[W:] = tag_ids
+        tid = tags["id"].to_numpy()
+        m = numpy.isin(tid, tag_ids)
+        tags = tags.filter(pyarrow.array(m))
+        idx = W + numpy.searchsorted(tag_ids, tags["id"].to_numpy())
+        missing = T - len(idx)
+        if missing:
+            print(f"{missing} tags used by works are not in the tag file")
+        for c in ["name", "type"]:
+            vals = [""] * (W + T)
+            for i, x in zip(idx.tolist(), tags[c].to_pylist()):
+                vals[i] = x
+            g.vp[c] = g.new_vp("string", vals=vals)
+            del vals
+        g.vp.canonical = g.new_vp("bool")
+        g.vp.canonical.a[idx] = tags["canonical"].to_numpy(zero_copy_only=False)
+        g.vp.cached_count = g.new_vp("int64_t")
+        g.vp.cached_count.a[:] = -1
+        g.vp.cached_count.a[idx] = tags["cached_count"].to_numpy()
+        g.vp.merger_id = g.new_vp("int64_t")
+        g.vp.merger_id.a[:] = -1
+        g.vp.merger_id.a[idx] = pc.fill_null(tags["merger_id"], -1).to_numpy()
+        yield alt, g