What is really in the 1,634 rows of the museum registry
The dataset Museums Open - Italy 2026 Q2 is a CSV with 1,634 rows and 10 columns, derived from OpenStreetMap and Wikidata and distributed under the ODbL 1.0 licence. The figure "1,634 museums" that you read in the title, however, is the number of rows, not of museums: I measured 33 museums that appear twice, once for each source, so the distinct museums are at least 1,601 if you count by Wikidata identifier. And the 89.4% of rows with a Wikidata identifier, which presents itself as a matching result, has a different explanation: more than three rows out of four come from Wikidata itself. This article shows you how to find that out on your own, with two scripts on the file.
The registry serves three purposes: counting museums by area, linking them to other sources through the Wikidata identifier, and seeing where volunteer mapping is densest. It is not an official registry, it contains no opening hours, costs or accessibility information, and it has no official key from the Ministero della Cultura (the Italian Ministry of Culture). Use it for what it is: an open list, useful and with measurable flaws.
Sources and licences: why ODbL and what to do with the Ministry's data
The rows come from two sources. The first is OpenStreetMap, under the ODbL 1.0 licence: anyone redistributing a derived database must credit the
contributors and keep the same licence. The second is Wikidata, whose structured data is CC0, that is, without obligations. Since one
of the two is share-alike, the derived file is ODbL: the LICENSE file in the dataset folder says so and the
comment in the spec that produces it declares it.
There is also an institutional source. The Ministero della Cultura publishes its data as linked open data on dati.cultura.gov.it, and declares that, unless otherwise specified, the site's content is CC-BY 4.0. This dataset does not use it: there is no match with the Ministry's catalogue, so no row carries an official code. If you need an institutional identifier, you will have to link the two sources yourself, for example by name and position.
How the file is built: a selection, not a match
Before reading the numbers, read the query. The spec that generates the file selects the rows of the places table with category
"museum" or "gallery" and country "IT", and groups them with DISTINCT ON (name, city, source_id). The key includes the
source: the same museum in OpenStreetMap and in Wikidata has two different sources, so it survives twice. A comment in the spec says so
plainly: the two rows are kept "for traceability" and the reader must deduplicate on their own by Wikidata identifier.
The places from OpenStreetMap are those with the tourism tag equal to museum or gallery. Those from
Wikidata are the entities that are an instance of "museum" (Q33506) or of one of its subclasses, through P31/P279*. A subclass
includes things other than what you call a museum in everyday language, and indeed abbeys and churches also appear in the file. The
spec contains no matching by distance or by name similarity: the union of the two sources is simply the presence of both
series of rows in the same list.
Why 89.4% is not a match percentage
The first script uses in-memory sqlite3 for a check that is awkward in a spreadsheet: the share of rows with an
identifier, computed separately for each source. It loads the CSV into a temporary table, writing nothing to disk, and
groups by the source_id column. The sum SUM(wikidata_qid <> '') counts the rows with an identifier,
because in SQLite a true comparison is worth 1 and a false one is worth 0.
import csv
import sqlite3
con = sqlite3.connect(":memory:")
con.execute("""CREATE TABLE museums (city TEXT, name TEXT, source_id TEXT, wikidata_qid TEXT,
wikipedia_url TEXT, website TEXT)""")
with open("data.csv", encoding="utf-8", newline="") as f:
for r in csv.DictReader(f):
con.execute("INSERT INTO museums VALUES (?,?,?,?,?,?)",
(r["city"], r["name"], r["source_id"], r["wikidata_qid"],
r["wikipedia_url"], r["website"]))
total = con.execute("SELECT COUNT(*) FROM museums").fetchone()[0]
with_qid = con.execute("SELECT COUNT(*) FROM museums WHERE wikidata_qid <> ''").fetchone()[0]
print(f"rows: {total} with QID: {with_qid} ({with_qid / total:.1%})")
print("\nby source of the row (rows, of which with QID):")
for source, n, q in con.execute("""SELECT source_id, COUNT(*), SUM(wikidata_qid <> '')
FROM museums GROUP BY source_id ORDER BY 2 DESC"""):
print(f" {source:15} {n:5} {q:5} ({q / n:.1%})")
# Output:
# rows: 1634 with QID: 1461 (89.4%)
#
# by source of the row (rows, of which with QID):
# wikidata_sparql 1284 1284 (100.0%)
# overpass_osm 350 177 (50.6%)
The 1,284 rows that come from Wikidata have an identifier by definition: they are looked up in Wikidata. The 350 rows that come from OpenStreetMap have one in only 50.6% of cases. The overall 89.4% is the average of these two populations, and it depends on the ratio between them, not on the quality of a match. If someone tells you "Wikidata coverage of Italian museums is 89%" starting from this file, the correct answer is that for museums mapped in OpenStreetMap coverage is about half.
Duplicates, city labels and concentration
The second script checks three things: duplicates by identifier, the shape of the city column and the share of the top
four cities. For duplicates it uses a GROUP BY ... HAVING COUNT(*) > 1 on the identifier and then counts the distinct museums
with a UNION ALL, which keeps all rows without an identifier and a single row for each identifier.
import csv
import sqlite3
from collections import Counter
con = sqlite3.connect(":memory:")
con.execute("CREATE TABLE museums (city TEXT, name TEXT, source_id TEXT, wikidata_qid TEXT)")
with open("data.csv", encoding="utf-8", newline="") as f:
for r in csv.DictReader(f):
con.execute("INSERT INTO museums VALUES (?,?,?,?)",
(r["city"], r["name"], r["source_id"], r["wikidata_qid"]))
dupes = con.execute("""SELECT wikidata_qid, COUNT(*) FROM museums
WHERE wikidata_qid <> '' GROUP BY wikidata_qid HAVING COUNT(*) > 1""").fetchall()
rows_involved = sum(n for _, n in dupes)
print("QIDs present in more than one row:", len(dupes), "- rows involved:", rows_involved)
sources = con.execute("""SELECT group_concat(DISTINCT source_id) FROM museums
WHERE wikidata_qid IN (SELECT wikidata_qid FROM museums WHERE wikidata_qid <> ''
GROUP BY wikidata_qid HAVING COUNT(*) > 1)""").fetchone()[0]
print("sources of the duplicate rows:", sources)
deduplicated = con.execute("""SELECT COUNT(*) FROM (SELECT 1 FROM museums WHERE wikidata_qid = ''
UNION ALL SELECT 1 FROM museums WHERE wikidata_qid <> '' GROUP BY wikidata_qid)""").fetchone()[0]
print("museums after deduplication by QID:", deduplicated)
print("\ntop cities by rows:")
tot = con.execute("SELECT COUNT(*) FROM museums").fetchone()[0]
for city, n in con.execute("SELECT city, COUNT(*) FROM museums GROUP BY city ORDER BY 2 DESC LIMIT 6"):
print(f" {city:14} {n:4} {n / tot:.2%}")
top_four = con.execute("""SELECT SUM(n) FROM (SELECT COUNT(*) n FROM museums
WHERE city IN ('Roma','Milano','Firenze','Bologna') GROUP BY city)""").fetchone()[0]
print(f"Roma + Milano + Firenze + Bologna: {top_four} rows ({top_four / tot:.1%})")
labels = con.execute("SELECT COUNT(DISTINCT city) FROM museums").fetchone()[0]
single = sum(1 for n in Counter(c for (c,) in con.execute("SELECT city FROM museums")).values() if n == 1)
print("distinct city labels:", labels, "- with a single row:", single)
print("rows with empty city:", con.execute("SELECT COUNT(*) FROM museums WHERE city = ''").fetchone()[0])
print("rows with city = 'Roma Capitale':", con.execute("SELECT COUNT(*) FROM museums WHERE city = 'Roma Capitale'").fetchone()[0])
# Output:
# QIDs present in more than one row: 33 - rows involved: 66
# sources of the duplicate rows: overpass_osm,wikidata_sparql
# museums after deduplication by QID: 1601
#
# top cities by rows:
# Roma 218 13.34%
# Milano 139 8.51%
# Firenze 77 4.71%
# Bologna 71 4.35%
# Napoli 27 1.65%
# Torino 21 1.29%
# Roma + Milano + Firenze + Bologna: 505 rows (30.9%)
# distinct city labels: 682 - with a single row: 502
# rows with empty city: 1
# rows with city = 'Roma Capitale': 10
Four facts follow from the output. First: 33 identifiers occur in two rows, the OpenStreetMap one and the Wikidata one, so after
deduplication 1,601 museums remain. Second: Roma, Milano, Firenze and Bologna together account for 505 rows, 30.9%, and the concentration
is real but also depends on the quality of volunteer mapping. Third: there are 682 distinct city labels, of which 502 have a single
row. Fourth: the city column is not normalised. "Roma Capitale" appears in 10 separate rows, and one row has an empty city.
Anyone counting museums per municipality without cleaning the column gets Roma wrong by ten.
| # | City label | Rows | Share of the 1,634 rows |
|---|---|---|---|
| 1 | Roma | 218 | 13.34% |
| 2 | Milano | 139 | 8.51% |
| 3 | Firenze | 77 | 4.71% |
| 4 | Bologna | 71 | 4.35% |
| 5 | Napoli | 27 | 1.65% |
| 6 | Torino | 21 | 1.29% |
| 7 | Siena | 16 | 0.98% |
| 8 | Genova | 15 | 0.92% |
| 9 | Parma | 13 | 0.80% |
| 10 | Ferrara | 13 | 0.80% |
The table shows the ten most frequent labels as they stand in the file. Roma has 218 rows under the label "Roma"; another 10 sit under "Roma Capitale", a separate label that does not appear in this table but indicates the same city. The labels below tenth place are almost all smaller towns: this long tail is what makes the dataset useful for research on widespread culture, provided you do not treat a row as a certain museum.
How to reuse it without getting hurt
If you want a count of museums, deduplicate by identifier and keep the rows without an identifier as a separate case: that is the path
of the second script. If you want to link other sources, use the wikidata_qid column as a join key with Wikipedia,
Wikimedia Commons or Europeana, which use those identifiers. If you want a map, the GeoJSON contains the coordinates, which in the CSV
are in WGS84 decimal degrees.
A sanity check before publishing a number: the rows from Wikidata include places of worship classified as a subclass of museum, and a search for words such as "chiesa" (church) or "abbazia" (abbey) in the name finds a few dozen out of 1,634. They are not an error in the file, they are the effect of how Wikidata organises its classes. If your use requires excluding them, filter by class in your own SPARQL, not by name.
Limits you must report next to the numbers
- The file contains both the OpenStreetMap row and the Wikidata row of the same museum: 33 duplicates measured.
- The
citycolumn is a free label: 682 distinct values, with "Roma" and "Roma Capitale" kept separate. - Opening hours, costs and accessibility are missing: the file only has name, coordinates, website, source and Wikidata and Wikipedia references.
- Open-air archaeological sites are not selected by the OpenStreetMap part, which filters on the museum tag.
- Coverage depends on volunteers: in historic centres it is high, in the suburbs and for corporate museums it is lower.
The first two items affect any count and can be fixed with a few lines of code. The other three are content limits: you cannot fix them with code, you have to declare them. A statement such as "Italy has 1,634 museums" is wrong in two ways at once, because it counts duplicates and because it treats volunteer mapping as a census.
Download and cite
The data.csv file weighs 279,456 bytes (measured with ls -l) and has 1,635 rows, header included. The available
formats and the DCAT record are under the path /open-data/museums-open-italy/v1.0.0/ of the site.
- data.csv: the file used in the scripts.
- data.json: the same rows in JSON.
- data.geojson: the points, to open in QGIS.
- METHODOLOGY.md: the short description of the method.
- metadata.jsonld: the DCAT-AP record.
The CSV is enough for a spreadsheet and for the scripts above; the GeoJSON is for maps. For citation there is a Zenodo DOI
(concept 10.5281/zenodo.20804745, version 10.5281/zenodo.20804746, both opened on 2026-11-13). The
dataset page, /en/open-data/museums-open-italy, has the ready-made citation blocks.
The sister dataset on the 20 regional capitals shows a different use of the same starting data, where the museum count becomes a per-capita rate. And if you are interested in comparison between countries, go to Quality of Life in the 7 EU capitals. If you instead need a case with several registries and different licences to combine, read the article on the geographical indications registry.
Frequently asked questions
How many museums are really in the dataset?
The file has 1,634 rows. Deduplicating by Wikidata identifier leaves 1,601 museums, because 33 identifiers appear twice (one row from OpenStreetMap and one from Wikidata). Rows without an identifier cannot be deduplicated with this method.
Can I use the dataset in a commercial app?
Yes, the ODbL 1.0 licence allows commercial use. You must credit "© OpenStreetMap contributors" and the dataset, and if you redistribute a derived database you must keep it under ODbL. The dataset is not CC-BY.
Does the dataset include opening hours and ticket prices?
No. There are ten columns: city, country, Wikidata presence, coordinates, name, source, website, Wikidata identifier and Wikipedia address. Hours and costs change constantly and should be asked of the museum's own source.
How do you deduplicate museums present in both sources?
You group the rows by the wikidata_qid column and keep one per group, keeping the rows with an empty column aside. It is the query of the second script, which gives 1,601 museums.
What you can do now
You know what the number 1,634 really counts and how to get the deduplicated one. You can explain why the share with a Wikidata identifier is 89.4% overall but 50.6% for the OpenStreetMap rows, and you can repeat the check with two SQL queries on a CSV file. You know which licence you are facing, what it asks and where to look for the institutional source. And you know which limits to write next to a result.
Sources
- OpenStreetMap: copyright and licence - the ODbL licence and the attribution obligation, consulted on 2026-11-13
- Open Database License (ODbL) 1.0, full text - share-alike for derived databases, consulted on 2026-11-13
- Wikidata: Licensing - the CC0 dedication of the structured data, consulted on 2026-11-13
- Wikidata, item Q33506 (museum) - the class used in the project's SPARQL query, consulted on 2026-11-13
- dati.cultura.gov.it, the linked open data of the Ministero della Cultura - the institutional source and the CC-BY 4.0 licence declared as the default, consulted on 2026-11-13
- Zenodo, record of v1.0.0 of the dataset (DOI 10.5281/zenodo.20804746) - the version DOI and the declared licence, consulted on 2026-11-13
The two listings were run with Python 3 from the standard library (modules csv and sqlite3, in-memory database only) on the data.csv in the frontend/public/open-data/museums-open-italy/v1.0.0/ folder of the repository; the outputs are identical across two consecutive runs. The spec code is ml-service/app/publishing/dataset_specs/museums_open_italy.py, the SPARQL query is ml-service/app/ingestion/sources/queries/italian_museums.sparql.

Commenti
Caricamento commenti...
Sign in to comment