Provenance SPARQLer

A platform for clarifying and commenting on SPARQL queries at the new Getty Provenance endpoint. This site is not affiliated with the Getty Research Institute.

Get All People (0007)

This query creates a basic dump of all people in GPI data

Introduction #

The GPI’s data is uniquely complex and therefore involves a uniquely large number of resources. This makes it hard to query: many queries fail unless they are suitably limited in scope. The following query generates a result that contains all people. As of 02-10-2026, this was equal to 200,034 distinct persons.

Similar approaches might be taken to other data models in the GPI’s data. This includes:

Type Description
E7_Activity “Activity”
E8_Acquisition “Provenance Activity”
E10_Transfer_of_Custody “Provenance Activity”
https://linked.art/ns/terms/RightAcquisition “Provenance Activity”
https://linked.art/ns/terms/Payment “Provenance Activity”
E53_Place “Place”
E21_Person “Person”
E74_Group “Group”
E22_Human-Made_Object “Physical Object”
E19_Physical_Object “Physical Object”
https://linked.art/ns/terms/Set “Set”
E33_Linguistic_Object “Textual Work”
E36_Visual_Item “Visual Work”

Queries #

A stripped down version of this query would look like this:

PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm:  <http://www.cidoc-crm.org/cidoc-crm/>

SELECT ?person ?label
WHERE {
  ?person rdf:type crm:E21_Person .

  OPTIONAL { ?person rdfs:label ?label }
}

This returns only URIs and labels for all persons. We might want more details, in which case, the following is more appropriate. The Commentary below focuses only on this second query.

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX crm:  <http://www.cidoc-crm.org/cidoc-crm/>

SELECT ?person ?name
       (GROUP_CONCAT(DISTINCT STR(?idVal);  SEPARATOR=" | ") AS ?identifiers)
       (GROUP_CONCAT(DISTINCT STR(?match);  SEPARATOR=" | ") AS ?externalMatches)
WHERE {
  ?person rdf:type crm:E21_Person .

  OPTIONAL { ?person rdfs:label ?name . }

  # P190 symbolic content only
  OPTIONAL {
    ?person crm:P1_is_identified_by ?id .
    ?id crm:P190_has_symbolic_content ?idVal .
  }

  # skos exactMatch only
  OPTIONAL { ?person skos:exactMatch ?match . }
}
GROUP BY ?person ?name

Commentary #

Notes #