Wikidata:WikiProject Heritage institutions/Tools & tasks

From Wikidata
Jump to navigation Jump to search

 

Home

 

Data Structure

 

Typology

 

Data Sources

 

Use Cases

 

Tools & Tasks

 

Statistics

 

Current Tasks[edit]

Getting access to and building an inventory of data sources[edit]

  • List databases containing data about heritage institutions in the Data Sources section. In case the databases are not publicly accessible, contact the data holder in order to encourage them to release the data to the public (under a CC-0 Waiver or equivalent).

Preparation tasks in view of data ingestion[edit]

  • Describe the databases listed on the Data Sources page on Wikidata, identify unique identifiers in the source data set and prepare their ingestion into Wikidata (see the Data Sources section for instructions).
  • Map the data structure in the source data set to the data structure on Wikidata (see the Data Sources section for instructions).
  • Make sure that the relevant thesauri needed for data ingestion, such as the typology of heritage institutions used as well as the municipalities and territorial subdivision of the given country exist on Wikidata; if not, complement them (see the Data Sources section for instructions).
  • Clean up existing Wikidata items so that they conform to the data modeling guidelines laid out in the Data Structure section (instructions will follow - in the meanwhile, please refer to the case reports referenced here).

Data ingestion[edit]

  • Ingest data from an existing database (instructions will follow - in the meanwhile, please refer to the case reports and guidelines referenced here).
  • Tidy up data after batch ingestion from a database (tackle double entries, add “part of”, “has part” relationships, add information about “inception” and/or “dissolution” of institutions where required) (instructions will follow - in the meanwhile, please refer to the case reports and guidelines referenced here).
  • Complement data that has already been ingested, e.g. by adding translations, urls, etc. (see the guidelines on how to edit Wikidata data in spreadsheet mode).

Development of the data model[edit]

  • Help improving the ontologies and multilingual thesauri needed for the ingestion and proper representation of the data (see the Data Structure section and the Typology section for to do lists).

Wikidataification of infobox templates on Wikipedia[edit]

  • Complement the infobox overview tables by adding information about missing language versions (see the Data Structure section for a to do list).
  • If you are familiar with the creation of templates on Wikipedia: please spread the word about this project in the various Wikipedias and help modify the templates so that they directly fetch data from Wikidata (see the Data Structure section for a to do list).

Wikidataification of lists on Wikipedia[edit]

Instructions are missing; please provide them if you can. Start with maintenance lists on project pages, driving the creation of new articles.

Track data quality and completeness[edit]

Instructions are missing; please provide them if you can.

Sample Queries[edit]

All archives, museums, libraries and heritage institutions in Switzerland and Fürstentum Liechtenstein[edit]

SELECT ?item
       ?glamID
	   ?Label_en
       ?Description_en
       (group_concat(distinct ?Alias_en;separator="; ") as ?Aliases_en)    #Concatenate the values in order not to get several rows per item.
       ?Label_de
       ?Description_de
       (group_concat(distinct ?Alias_de;separator="; ") as ?Aliases_de)
       (replace(group_concat(distinct ?Type;separator="; "), "http://www.wikidata.org/entity/", "") as ?Types)  #Strip the path in order to get only the Q-number.
       (group_concat(distinct ?TypeLabel_en;separator="; ") as ?TypeLabels_en)
       (replace(group_concat(distinct ?Municipality;separator="; "), "http://www.wikidata.org/entity/", "") as ?Municipalities)   
       (group_concat(distinct ?MunicipalityLabel_de;separator="; ") as ?MunicipalityLabels_de)
       (replace(group_concat(distinct ?Canton;separator="; "), "http://www.wikidata.org/entity/", "") as ?Cantons)
       (group_concat(distinct ?CantonLabel_de;separator="; ") as ?CantonLabels_de)
  WHERE {
  {?item wdt:P31 ?museum . ?museum wdt:P279* wd:Q33506 } 
    UNION {?item wdt:P31 ?archive . ?archive wdt:P279* wd:Q166118 } 
    UNION {?item wdt:P31 ?library . ?library wdt:P279* wd:Q7075 } 
    UNION {?item wdt:P31 ?memory . ?memory wdt:P279* wd:Q1497649 } . 
  {?item wdt:P131/wdt:P17 wd:Q39 }
    UNION {?item wdt:P131/wdt:P17 wd:Q347 } .  
  OPTIONAL { ?item wdt:P3066 ?glamID. }
  OPTIONAL { ?item rdfs:label ?Label_en . FILTER (lang(?Label_en) = "en") }
  OPTIONAL { ?item rdfs:label ?Label_de . FILTER (lang(?Label_de) = "de") } 
  OPTIONAL { ?item skos:altLabel ?Alias_en . FILTER (lang(?Alias_en) = "en") }
  OPTIONAL { ?item skos:altLabel ?Alias_de . FILTER (lang(?Alias_de) = "de") } 
  OPTIONAL { ?item schema:description ?Description_en . FILTER (lang(?Description_en) = "en") }
  OPTIONAL { ?item schema:description ?Description_de . FILTER (lang(?Description_de) = "de") } 
  OPTIONAL { ?item wdt:P31 ?Type. }
  OPTIONAL { ?item wdt:P31/rdfs:label ?TypeLabel_en . FILTER (lang(?TypeLabel_en) = "en") }  
  OPTIONAL { ?item wdt:P131 ?Municipality . FILTER EXISTS {?Municipality wdt:P31 wd:Q70208} }  
  OPTIONAL { ?item wdt:P131/rdfs:label ?MunicipalityLabel_de . FILTER EXISTS {?MunicipalityLabel_de ^rdfs:label/wdt:P31 wd:Q70208} . FILTER (lang(?MunicipalityLabel_de) = "de") }
  OPTIONAL { ?item wdt:P131 ?Canton . FILTER EXISTS {?Canton wdt:P31 wd:Q23058} }
  OPTIONAL { ?item wdt:P131/rdfs:label ?CantonLabel_de . FILTER EXISTS {?CantonLabel_de ^rdfs:label/wdt:P31 wd:Q23058} . FILTER (lang(?CantonLabel_de) = "de") }  
  OPTIONAL { ?item wdt:P17 ?Country. }
  OPTIONAL { ?item wdt:P17/rdfs:label ?CountryLabel_de . FILTER (lang(?CountryLabel_de) = "de") }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }    
}
group by ?item                          #List all the variables for which the values are not concatenated!
         ?glamID
         ?Label_en ?Description_en 
         ?Label_de ?Description_de
Try it!

Collection sizes[edit]

The following query uses these:

  • Properties: part of (P361)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, country (P17)  View with Reasonator View with SQID, collection or exhibition size (P1436)  View with Reasonator View with SQID, applies to part (P518)  View with Reasonator View with SQID
    SELECT ?collection ?collectionLabel ?partofLabel ?countryLabel ?size ?partLabel WHERE {
    ?collection p:P1436 ?s.
      ?s ps:P1436 ?size
      OPTIONAL {?s pq:P518 ?part} # Applies to part
      OPTIONAL {?collection wdt:P361 ?partof . # Get the organisation the collection is part of
                MINUS{ ?partof wdt:P31 wd:Q13406463 } } # but not Wikimedia list articles
      OPTIONAL {?collection wdt:P17 ?country}
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
      FILTER (?size > 100)
    } ORDER BY DESC(?size)
    

Sample Queries for museums[edit]

Global map of museums[edit]

#defaultView:Map{"hide": "?coords"}
SELECT DISTINCT ?museum ?museumLabel (SAMPLE(?coords) AS ?coords) #(SAMPLE(?image) AS ?image)
?url ?layer WHERE {
?museum wdt:P31 ?type .?type wdt:P279? wd:Q33506. ?museum wdt:P625 ?coords
#OPTIONAL {?museum wdt:P18 ?image}
OPTIONAL {?museum wdt:P856 ?url}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?museum rdfs:label ?museumLabel. ?type rdfs:label ?layer }
} GROUP BY ?museum ?museumLabel ?url ?layer
ORDER BY UCASE(?layer)
Try it!

Image grid of the most notable museums[edit]

#defaultView:ImageGrid
SELECT DISTINCT ?museum ?museumLabel (SAMPLE(?image) AS ?image) ?sitelinks (SAMPLE(?web) AS ?web) WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506 . # museums or subtypes
?museum wikibase:sitelinks ?sitelinks
OPTIONAL {?museum wdt:P18 ?img}
OPTIONAL {?museum wdt:P856 ?web}
BIND (IF(BOUND(?img), ?img, <http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg>) AS ?image)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?museum ?museumLabel ?sitelinks
ORDER BY DESC(?sitelinks)
LIMIT 1000
Try it!

Bubble chart of number of museums in each country[edit]

#defaultView:BubbleChart
SELECT ?countryLabel (COUNT(DISTINCT ?museum) AS ?count) WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506 .
?museum wdt:P17 ?country .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?countryLabel
Try it!

Social media accounts of museums[edit]

SELECT DISTINCT ?museum ?museumLabel
(URI(CONCAT("https://twitter.com/",?twit)) AS ?twitter)
(URI(CONCAT("https://www.instagram.com/",?insta)) AS ?instagram)
(URI(CONCAT("https://www.facebook.com/",?fb)) AS ?facebook) WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506. # museum (or subtype)
MINUS {?museum wdt:P576 []} # Remove defunct
OPTIONAL {?museum wdt:P2002 ?twit}
OPTIONAL {?museum wdt:P2003 ?insta}
OPTIONAL {?museum wdt:P2013 ?fb}
FILTER (BOUND(?twit)|| BOUND(?insta) || BOUND(?fb))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?museumLabel
Try it!

Oldest institution in each country that acts as a museum[edit]

SELECT DISTINCT ?countryLabel ?museum ?museumLabel (YEAR(?earliest) as ?year) WHERE {
{ SELECT ?country (MIN(?inception) as ?earliest) WHERE {
    ?museum wdt:P31/wdt:P279? wd:Q33506 ; wdt:P131?/wdt:P17 ?country; wdt:P571 ?inception
    } GROUP BY ?country }
?museum wdt:P31/wdt:P279? wd:Q33506 ; wdt:P131?/wdt:P17 ?country; wdt:P571 ?earliest.
MINUS {?country wdt:P576 []} # Exclude abolished countries like the Austrian Empire
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?countryLabel
Try it!

Museums for which we lack an official website[edit]

SELECT DISTINCT ?museum ?museumLabel ?countryLabel WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506. # museum (or subtype)
MINUS {?museum wdt:P576 []} # Remove defunct
MINUS {?museum wdt:P856 []} # No official URL
OPTIONAL {?museum wdt:P17 ?country}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?countryLabel ?museumLabel
Try it!

Museums lacking an image in Wikicommons[edit]

ordered by decreasing notability

SELECT DISTINCT ?museum ?museumLabel ?countryLabel (URI(CONCAT("https://commons.wikimedia.org/wiki/Category:",?commonscat)) AS ?commons) ?sitelinks WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506. # museum (or subtype)
MINUS {?museum wdt:P576 []} # Remove defunct
MINUS {?museum wdt:P18 []} # No image
OPTIONAL {?museum wdt:P17 ?country}
OPTIONAL {?museum wdt:P373 ?commonscat}
?museum wikibase:sitelinks ?sitelinks
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY DESC(?sitelinks) ?museumLabel
Try it!

[edit]

SELECT ?museum ?museumLabel ?countryLabel ?commonscat WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?museum (wdt:P31/(wdt:P279*)) wd:Q33506.
  FILTER(NOT EXISTS { ?museum wdt:P154 ?logo. })
  OPTIONAL { ?museum wdt:P17 ?country. }
  OPTIONAL { ?museum wdt:P373 ?commonscat}
}
Try it!

Museums lacking coordinate location[edit]

SELECT ?museum ?museumLabel ?coordinate_location ?country ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?museum (wdt:P31/(wdt:P279*)) wd:Q33506.
  FILTER(NOT EXISTS { ?museum wdt:P625 ?coordinate_location. })
  OPTIONAL { ?museum wdt:P17 ?country. }
}
Try it!

Museums without country (P17) but with coordinate location (P625), located in the administrative territorial entity (P131) and inception (P571)[edit]

SELECT ?museum ?museumLabel ?inception ?located_in_the_administrative_territorial_entity ?coordinate_location WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?museum (wdt:P31/(wdt:P279*)) wd:Q33506.
  FILTER(NOT EXISTS { ?museum wdt:P17 ?country. })
  OPTIONAL { ?museum wdt:P571 ?inception. }
  OPTIONAL { ?museum wdt:P131 ?located_in_the_administrative_territorial_entity. }
  OPTIONAL { ?museum wdt:P625 ?coordinate_location. }
}
Try it!

Museums with heritage designation heritage designation (P1435)[edit]

SELECT ?museum ?museumLabel ?heritage_designation ?heritage_designationLabel ?instance_of ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?museum (wdt:P31/(wdt:P279*)) wd:Q7075.
  OPTIONAL { ?museum wdt:P1435 ?heritage_designation.
           ?heritage_designation wdt:P31 ?instance_of}
  OPTIONAL { ?museum wdt:P17 ?country. }
}
Try it!

Sample Queries for libraries[edit]

Global map of libraries[edit]

#defaultView:Map{"hide": "?coords"}
SELECT DISTINCT ?library ?libraryLabel (SAMPLE(?coords) AS ?coords)
   (SAMPLE(?image) AS ?image) ?website ?layer WHERE {
?library wdt:P31 ?type .?type wdt:P279* wd:Q7075 . ?library wdt:P625 ?coords
OPTIONAL {?library wdt:P18 ?image}
OPTIONAL {?library wdt:P856 ?website}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?library rdfs:label ?libraryLabel. ?type rdfs:label ?layer }
} GROUP BY ?library ?libraryLabel ?website ?layer
ORDER BY UCASE(?layer)
Try it!

Image gallery of the most notable libraries[edit]

#defaultView:ImageGrid
SELECT DISTINCT ?library ?libraryLabel (SAMPLE(?image) AS ?image) ?sitelinks WHERE {
?library wdt:P31/wdt:P279* wd:Q7075 . # libraries or subtypes
MINUS {?library wdt:P31/wdt:P279* wd:Q212805} # but not digital libraries
?library wikibase:sitelinks ?sitelinks.
OPTIONAL {?library wdt:P18 ?img}
BIND (IF(BOUND(?img), ?img, <http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg>) AS ?image)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?library ?libraryLabel ?sitelinks
ORDER BY DESC(?sitelinks)
LIMIT 1000
Try it!

Bubble chart of number of libraries in each country[edit]

#defaultView:BubbleChart
SELECT ?countryLabel (COUNT(DISTINCT ?library) AS ?count) WHERE {
?library wdt:P31/wdt:P279* wd:Q7075 .
?library wdt:P17 ?country .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?countryLabel
Try it!

Social media accounts of libraries[edit]

SELECT DISTINCT ?library ?libraryLabel
(URI(CONCAT("https://twitter.com/",?twit)) AS ?twitter)
(URI(CONCAT("https://www.instagram.com/",?insta)) AS ?instagram)
(URI(CONCAT("https://www.facebook.com/",?fb)) AS ?facebook) WHERE {
?library wdt:P31/wdt:P279* wd:Q7075. # library (or subtype)
MINUS {?library wdt:P576 []} # Remove defunct
MINUS {?library wdt:P31/wdt:P279* wd:Q212805} # Remove digital libraries
OPTIONAL {?library wdt:P2002 ?twit}
OPTIONAL {?library wdt:P2003 ?insta}
OPTIONAL {?library wdt:P2013 ?fb}
FILTER (BOUND(?twit)|| BOUND(?insta) || BOUND(?fb))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?libraryLabel
Try it!

Oldest institution in each country that acts as a library[edit]

SELECT DISTINCT ?countryLabel ?library ?libraryLabel (YEAR(?earliest) as ?year) WHERE {
{ SELECT ?country (MIN(?inception) as ?earliest) WHERE {
    ?library wdt:P31/wdt:P279? wd:Q7075 ; wdt:P131?/wdt:P17 ?country; wdt:P571 ?inception
    } GROUP BY ?country }
?library wdt:P31/wdt:P279? wd:Q7075 ; wdt:P131?/wdt:P17 ?country; wdt:P571 ?earliest.
MINUS {?country wdt:P576 []} # Exclude abolished countries like the Austrian Empire
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?countryLabel
Try it!

Libraries for which we lack an official website[edit]

SELECT DISTINCT ?library ?libraryLabel ?countryLabel WHERE {
?library wdt:P31/wdt:P279* wd:Q7075. # library (or subtype)
MINUS {?library wdt:P576 []} # Remove defunct
MINUS {?library wdt:P31/wdt:P279* wd:Q212805} # Remove digital libraries
MINUS {?library wdt:P856 []} # No official URL
OPTIONAL {?library wdt:P17 ?country}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?countryLabel ?libraryLabel
Try it!

Libraries lacking an image in Wikicommons[edit]

Ordered by decreasing notability

SELECT DISTINCT ?library ?libraryLabel ?countryLabel (URI(CONCAT("https://commons.wikimedia.org/wiki/Category:",?commonscat)) AS ?commons) ?sitelinks WHERE {
?library wdt:P31/wdt:P279* wd:Q7075. # library (or subtype)
MINUS {?library wdt:P576 []} # Remove defunct
MINUS {?library wdt:P18 []} # No image
MINUS {?library wdt:P31/wdt:P279* wd:Q212805} # Remove digital libraries
?library wikibase:sitelinks ?sitelinks
OPTIONAL {?library wdt:P17 ?country}
OPTIONAL {?library wdt:P373 ?commonscat}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY DESC(?sitelinks) ?libraryLabel
Try it!

Properties had by libraries (apart from instance of (P31))[edit]

SELECT ?prop ?propLabel (COUNT(?library) AS ?count) WHERE {
?library wdt:P31/wdt:P279? wd:Q7075 ; # libraries or 1st-level subtypes
?p [].
?prop wikibase:directClaim ?p FILTER (?prop != wd:P31)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?prop ?propLabel
ORDER BY DESC(?count)
Try it!

Libraries with heritage designation (P1435)[edit]

SELECT ?library ?libraryLabel ?heritage_designation ?heritage_designationLabel ?instance_of ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?library (wdt:P31/(wdt:P279*)) wd:Q7075.
  OPTIONAL { ?library wdt:P1435 ?heritage_designation.
           ?heritage_designation wdt:P31 ?instance_of}
  OPTIONAL { ?library wdt:P17 ?country. }
}
Try it!

Sample Queries for archives[edit]

Global map of archives[edit]

#defaultView:Map{"hide": "?coords"}
SELECT DISTINCT ?archive ?archiveLabel (SAMPLE(?coords) AS ?coords) (SAMPLE(?image) AS ?image) ?website ?layer WHERE {
  ?archive wdt:P31 ?type.
  ?type (wdt:P279*) wd:Q166118.
  ?archive wdt:P625 ?coords.
  OPTIONAL { ?archive wdt:P18 ?image. }
  OPTIONAL { ?archive wdt:P856 ?website. }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?archive rdfs:label ?archiveLabel.
    ?type rdfs:label ?layer.
  }
}
GROUP BY ?archive ?archiveLabel ?website ?layer
ORDER BY (UCASE(?layer))
Try it!

Properties had by archives (apart from instance of (P31))[edit]

SELECT ?prop ?propLabel (COUNT(?archive) AS ?count) WHERE {
?archive wdt:P31/wdt:P279? wd:Q166118 ; # archives or 1st-level subtypes
?p [].
?prop wikibase:directClaim ?p FILTER (?prop != wd:P31)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?prop ?propLabel
ORDER BY DESC(?count)
Try it!

Bubble chart of number of archives in each country[edit]

#defaultView:BubbleChart
SELECT ?countryLabel (COUNT(DISTINCT ?archive) AS ?count) WHERE {
?archive wdt:P31/wdt:P279* wd:Q166118 .
?archive wdt:P17 ?country .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?countryLabel
Try it!

Archives with heritage designation (P1435)[edit]

SELECT ?archive ?archiveLabel ?heritage_designation ?heritage_designationLabel ?instance_of ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?archive (wdt:P31/(wdt:P279*)) wd:Q166118.
  OPTIONAL { ?archive wdt:P1435 ?heritage_designation.
           ?heritage_designation wdt:P31 ?instance_of}
  OPTIONAL { ?archive wdt:P17 ?country. }
}
Try it!

Sample Queries for other institutions[edit]

Map of botanical gardens, botanical museums, and herbaria[edit]

Needs improving to capture sub-types

#defaultView:Map{"hide": "?coords"}
SELECT DISTINCT ?museum ?museumLabel (SAMPLE(?coords) AS ?coords) (SAMPLE(?image) AS ?image) ?url ?layer WHERE {
  VALUES ?type {wd:Q181916 wd:Q167346 wd:Q26959050 wd:Q272231}
?museum wdt:P31 ?type ; wdt:P625 ?coords
OPTIONAL {?museum wdt:P18 ?image}
OPTIONAL {?museum wdt:P856 ?url}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?museum rdfs:label ?museumLabel. ?type rdfs:label ?layer }
} GROUP BY ?museum ?museumLabel ?url ?layer
ORDER BY UCASE(?layer)
Try it!

Sample Queries for countries[edit]

Brazil[edit]

Brazilian Museums with missing references[edit]

SELECT ?item ?itemLabel ?property ?propertyLabel ?statement
WITH {
  SELECT DISTINCT ?item WHERE {
    ?item wdt:P31/wdt:P279* wd:Q33506;
          wdt:P17 wd:Q155.
  }
} AS %items
WITH {
  SELECT ?item ?itemLabel WHERE {
    INCLUDE %items.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,pt,pt-br,es". }
  }
} AS %itemLabels
WITH {
  SELECT ?item ?property ?statement WHERE {
    INCLUDE %items.
    ?property wikibase:claim ?p.
    ?item ?p ?statement.
    MINUS {
      # TODO check what counts as good reference
      ?statement prov:wasDerivedFrom [
        pr:P248|pr:P854 ?goodReference
      ].
    }
    # TODO expand list of properties that don’t need good references:
    FILTER(?p NOT IN (p:P373,  #commons category
                      p:P856,  #official website
                      p:P18,   #image
                      p:P227,   #identifier with weblink
                      p:P214,   #identifier with weblink
                      p:P269,   #identifier with weblink
                      p:P2427,  #identifier with weblink
                      p:P213,   #identifier with weblink
                      p:P4678,  #identifier with weblink
                      p:P3153,  #identifier with weblink
                      p:P902    #identifier with weblink
                      ))  
  }
} AS %statements
WITH {
  SELECT DISTINCT ?property WHERE {
    INCLUDE %statements.
  }
} AS %properties
WITH {
  SELECT ?property ?propertyLabel WHERE {
    INCLUDE %properties.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,pt,pt-br,es". }
  }
} AS %propertyLabels
WHERE {
  INCLUDE %statements.
  INCLUDE %itemLabels.
  INCLUDE %propertyLabels.
} ORDER BY ?item
Try it!

Museums in Brazil lacking coordinate location (P625)[edit]

SELECT ?museum ?museumLabel ?coordinate_location ?country ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,pt,pt-br". }
  ?museum (wdt:P31/(wdt:P279*)) wd:Q33506.
  FILTER(NOT EXISTS { ?museum wdt:P625 ?coordinate_location. })
  OPTIONAL { ?museum wdt:P17 ?country. }
  {?museum wdt:P17 wd:Q155.}
}
Try it!

Museums in Brazil without architect (P84)[edit]

SELECT ?museum ?museumLabel ?director_manager ?director_managerLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,pt,pt-br". }
  ?museum (wdt:P31/(wdt:P279*)) wd:Q33506.
  FILTER(NOT EXISTS { ?museum wdt:P84 ?architect. })
  OPTIONAL { ?museum wdt:P17 ?country. }
  ?museum wdt:P17 wd:Q155.
  OPTIONAL { ?museum wdt:P1037 ?director_manager. }
}
Try it!

Switzerland[edit]

Museums in Switzerland lacking coordinate location (P625)[edit]

SELECT ?museum ?museumLabel ?coordinate_location ?country ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
  ?museum (wdt:P31/(wdt:P279*)) wd:Q33506.
  FILTER(NOT EXISTS { ?museum wdt:P625 ?coordinate_location. })
  OPTIONAL { ?museum wdt:P17 ?country. }
  {?museum wdt:P17 wd:Q39.}
}
Try it!

Item Counts[edit]

Statistics (number of items)
Date memory institutions museums archives libraries
2018-08-23 2201 37486 3611 16678
2019-01-02 2268 41166 4081 19673
2019-02-27 2284 43221 4124 25994
2020-06-04 2613 56931 12481 78336

Items of the class "memory institution" and its subclasses[edit]

SELECT DISTINCT ?item ?itemLabel
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q1497649.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Items of the class "museum" and its subclasses[edit]

SELECT DISTINCT ?item ?itemLabel
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q33506.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Items of the class "archive" and its subclasses[edit]

SELECT DISTINCT ?item ?itemLabel
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q166118.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Items of the class "library" and its subclasses[edit]

SELECT DISTINCT ?item ?itemLabel
WHERE 
{
  ?item wdt:P31/wdt:P279* wd:Q7075.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Tools[edit]

This section is still empty. If you want to help building it up, start listing relevant tools with a short explanation (possibly, a template on the level of WikiProject Cultural heritage should be created that can be included in various WikiProjects). See also the tools section of the case report about the ingestion of data about Swiss heritage institutions.

Maintenance lists[edit]

This section is intended for Wikidata maintenance lists, e.g. for the following-up on constraint violations, etc.

Feel free to create and add maintenance lists related to heritage institutions.