Abstract
Wikipedia is a rich and invaluable source of information, serving as a central object of study for scientists across domains like linguistics, social behavior, and network theory. While a scientific treasure, the sheer size of Wikipedia dumps often hinders pre-processing, creating a significant barrier for researchers who may lack advanced data engineering skills. Official APIs, while accessible, are restricted by rate limits and provide only the current state of the network. This paper introduces an efficient data structure and toolset designed for the "mesoscopic" scale—subnetworks ranging from thousands to hundreds of thousands of pages. By leveraging graph database principles, the proposed system provides rapid, intuitive access to Wikipedia articles and categories, integrated with viewership statistics.
Introduction
The challenge of studying Wikipedia lies in its scale. Researchers typically face a choice between two extremes: the official API, which is easy to use but heavily rate-limited and unsuitable for historical reproducibility, and massive XML/SQL dumps that require hours of pre-processing. Existing static datasets, such as those in the SNAP archive, often lack temporal resolution or are significantly outdated.
To address this, Aspert et al. (2019) developed a hybrid database architecture that combines the "spatial" hyperlink structure of Wikipedia with "temporal" hourly viewership data. This framework is optimized for mesoscopic subgraphs, enabling researchers to perform complex queries on specific domains (e.g., all pages related to "Physics") without the overhead of processing the entire 14-million-node network.
Methodology and Data Architecture
The authors utilized the English Wikipedia SQL and Pagecounts dumps from August 2018 to construct a specialized database using two distinct paradigms:
- Graph Database (Neo4j): This component stores the structural relationships. Articles and categories are represented as nodes, while hyperlinks (
links_to) and category memberships (belongs_to) are directed edges. - NoSQL Database: Temporal viewership data is stored here. To manage data volume, a threshold was implemented where hourly statistics are only retained for pages receiving more than 100 visits per day.
A critical pre-processing step involved "flattening" redirects. In the standard Wikipedia structure, many links point to redirect pages rather than the final destination article. By resolving these redirects and linking directly to the target, the authors reduced the total node count from approximately 14 million to 7.4 million (comprising 5.7M articles and 1.7M categories) without losing structural integrity.
Key Insights and Performance
The integration of graph structure and viewership data enables unique analytical capabilities, such as spatio-temporal anomaly detection. By observing simultaneous traffic spikes across a cluster of interconnected pages, researchers can identify collective human attention shifts in response to real-world events.
The system also highlights the "leaky" nature of Wikipedia's taxonomy. For instance, while the "Physics" category appears specific, a graph traversal to a depth of 7 reveals over 2 million pages—nearly a third of the English Wikipedia. This underscores the necessity of efficient graph traversal tools to filter and refine subcategories.
In performance benchmarks, the graph-structured approach significantly outperformed traditional methods. Querying a depth-2 subgraph of the "Physics" category took less than 5 seconds in the Neo4j-based system, compared to 5 minutes using Apache Spark on raw data. While relational databases (PostgreSQL) were efficient at retrieving nodes, they struggled with edge retrieval, often taking 10–40 times longer than the graph database for the same queries.
Conclusion and Future Work
The proposed dataset and toolset provide a high-performance solution for researchers needing localized, reproducible Wikipedia data. By "freezing" the state of the graph in monthly updates, the system solves the "moving target" problem inherent in the live API.
Future developments aim to expand the dataset to include multi-language support, linking articles across different language editions of Wikipedia. Additionally, the authors plan to incorporate further metadata layers, such as full article text and edit histories, to support sentiment analysis and studies of collaborative behavior.
Summary updated