Holy Wells in Ireland and the UK — dedications by gender

This notebook queries Wikidata for holy wells in Ireland and the United Kingdom, joins each well to the saint it is dedicated to, and splits the result by the patron saint’s gender. Two maps side by side make the geography visible; two bar charts show which individual saints dominate each group.

It is a companion to the overview notebook wikidata-holy-wells-map-live.qmd (marker map + density grid), and takes one further step: instead of treating all wells as equivalent points, we ask whom each well commemorates and let that shape the picture.

Note

On first load, your browser downloads the Python runtime (Pyodide, ~10 MB). Please allow a moment for it to initialise.

About this notebook

Why this dataset?

Dedications are the most information-dense single property of a holy well: a well is more than a point on a map, it is a point named for someone. Several features make this slice teachable:

  • A second hop into Wikidata — the query joins the well (Q1371047) to the saint (?namedAfter) to the saint’s gender (P21). That second hop is where the knowledge graph earns its keep; a flat list of wells would not tell you this, but Wikidata already knows each saint’s biographical data.
  • Sharp, visible asymmetry — the Irish sacred landscape is heavily female-dedicated (Mary, Brigid, Íte), and the surprise of which saints dominate on a map is a quick hook for discussing sample bias, gendered historiography, and the limits of the dataset.
  • Two countries, very uneven coverage — Ireland has hundreds of modelled wells, the UK has a handful. This is itself a finding about data completeness rather than about holy wells in the world.

Data-context notes

  • The query returns one row per well–patron pair. Wells with multiple patrons produce multiple rows. The grouping step below keeps each well once, attaching the list of patrons.
  • P21 (sex or gender) on a saint can be either Q6581072 (female) or Q6581097 (male); these are the two values filtered by the VALUES ?gender { ... } clause. Other values exist in Wikidata for living people but are not relevant here.
  • A handful of wells have patrons of both genders (e.g. a joint dedication). These appear on both maps.
  • The UK sample is small enough that a single well (St Winifred’s Well in Holywell, Wales) is a visible outlier on the female map.

Tooling notes

Same stack as the overview notebook: pyodide.http.pyfetch for the SPARQL call, Leaflet via a single HTML output per map, and matplotlib for the bar charts. The side-by-side layout is a plain CSS display:flex wrapper around two independent map containers — no extra JavaScript for synchronisation, so each map can be zoomed and panned independently.

Step 1 — Define the SPARQL query

The query walks two edges of the graph: ?item → ?namedAfter via P138 (named after), and ?namedAfter → ?gender via P21 (sex or gender). The two VALUES clauses filter countries (Ireland, UK) and genders (female, male) — both are whitelists rather than FILTER expressions, which Wikidata’s query planner handles more efficiently.

Step 2 — Load the data

Each row is a (well, patron, gender) triple — so wells with multiple patrons appear multiple times. We build a long DataFrame first (one row per pair, which is what the bar charts want), then derive a wide per-well view (one row per well, patrons and genders as lists) which is what the maps want.

Step 3 — Visualise

Step 3a — Two maps side by side: female and male patrons

Two Leaflet maps sharing the same viewport, each fed a filtered subset of the wells. A well with patrons of both genders appears on both maps (once per gender). Click any marker for the well’s name, its patrons, and a link to its Wikidata item.

The maps are rendered in a CSS flex container — on a wide screen they sit next to each other, on a narrow one (phone) they stack.

Step 3b — Female patrons, one layer per saint

Same data as the left map above, but now each saint gets her own toggleable layer with a distinct colour — the colour swatch sits directly in the layer-control label, so the panel itself acts as the legend. This mirrors the Wikidata Query Service map view, which uses the ?layer variable to drive categorical colouring, and lets you isolate individual dedications to see their geography on their own.

Step 3c — Male patrons, one layer per saint

Same construction as 3b, on the male subset. Patrick is typically the most common, but the long tail of locally venerated saints (Lachtain, Kieran, Declan, …) shows the finer-grained character of a sacred landscape that blends national and very local figures.

Step 3d — Top patrons per gender

The maps show where; the bar charts show who. One bar chart per gender, Top-15 patrons each, wells counted once per patron per well. Mary and Brigid dominate the female side by a wide margin — their visual weight on the map is not just about geography but about how often they are the reason a well exists at all.

Step 4 — Explore

The two DataFrames — long_df (one row per well–patron pair) and wide_df (one row per well) — stay in scope. Two quick starting points:

Gender ratio overall

A specific saint on the map

Change SAINT below to any patron name that appears in the bar chart (exact label, case-sensitive). The cell then prints all wells dedicated to that saint with their coordinates and country.


Part of an Open Educational Resource series on knowledge graphs and linked open data, produced in the context of NFDI4Objects. Data: Wikidata WikiProject HolyWells, CC0. Tiles: OpenStreetMap contributors.