Introduction
Wikipedia Path turns French Wikipedia into a graph of links, then finds the shortest chain of clicks from one article to another.
Every article is a node. Every link from one article to another is an edge. With this graph, you can answer questions like “how many clicks from Tour Eiffel to Pikachu?”:
$ WikipediaPath.GraphBuilder path "Tour Eiffel" "Pikachu"
Searched 99,483 pages in 30 ms.
2 clicks from 'Tour Eiffel' to 'Pikachu':
0. Tour Eiffel
1. Jeu vidéo
2. Pikachu
What is in the repository
| Path | Content |
|---|---|
WikipediaPath.GraphBuilder/ | Command-line tool: downloads the dumps, builds the graph, reads it |
WikipediaPath.GraphBuilder.Tests/ | xUnit tests |
docs/ | This book, and the WGRF file format specification |
flake.nix | Nix dev shell, package and local MariaDB scripts |
How it works, in short
downloadfetches the SQL dumps of French Wikipedia and a list of date and country pages from Wikidata.decompressunpacks the.gzfiles.provisionloads the SQL dumps into a local MariaDB database.buildreads the database and writes one binary file,graph.wgrf.info,exploreandpathread that file.
The graph file uses the WGRF format. It is a compact, memory-mapped layout built for fast breadth-first search. The specification describes it byte by byte.
Size of the data
Numbers from the frwiki dump of 2026-09-01:
| Item | Size |
|---|---|
| Articles (nodes) | 2,777,420 |
| Links (edges) | 235,141,317 |
| Searchable names (titles and redirects) | 4,619,033 |
Compressed dumps (.gz) | about 2.7 GB |
| Decompressed SQL | about 12.5 GB |
| MariaDB data directory | about 64 GB |
graph.wgrf | about 1.1 GB |
Limitations
- Only French Wikipedia (
frwiki) is tested. The--wikioption exists, but the date and country examples in the spec are French. - The clickstream covers one month and the dumps another, so some measured links are missing from the graph and their clicks are dropped.
- Wikidata categories come from a live query, so they can be newer than the dump.
License
Wikipedia Path is licensed under the GNU Affero General Public License v3.0 only
(AGPL-3.0-only). See the LICENSE file at the root of the repository.