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.

Getting from auction events to individual lots (0003)

Getting from auction events to individual lots (0003)

This query helps the user navigate the Provenance model from auction events to lots. This is trickier than you might think, and requires some backwards and forward querying.

Introduction

The challenge of getting from an auction-event to a lot is several-fold.

  1. There is a level between the auction-event and the lot (i.e., the auction-of-lot).
  2. The directionality is not two-way, and it is not even consistently up or down the hierarchy. What do I mean by that? Look at this diagram below. Much depends on the one-way, divergent relationship between the three objects. A proper hierarchy would clearly connect either auction-events to auction-of-lot to lot, or vice versa. However, GPI does not do that. Rather, auction-of-lot connect UP to auction-event (but not vice versa), and auction-of-lot connects DOWN to lot (but not vice versa). In this graph relationship, counter-intuitively, the auction-of-lot is the central node. So the user needs to take this into account, and focus on the auction-of-lot as the connective tissue connecting all three.
  3. The auction-event and auction-of-lot are both events, but the lot is not—it is a set.
  4. The relevant CRM properties (that is, the relationship between these entities) are also different. In this case, the auction-of-lot forms part of (P9i_forms_part_of) the auction-event. On the other hand, the auction-of-lot “uses” a specified object (P16_used_specified_object)—that is, the lot.
image

🔴 = E7_Activity 🟦 = Set

With that in mind, let’s write a SPARQL query that takes us from one particular auction-event down to all of the associated lots.

Query

PREFIX la: <https://linked.art/ns/terms/>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?auction_of_lot ?lot ?lot_label ?auction_of_lot_time_label ?lot_creation ?lot_creation_timespan_begin ?lot_auction_combined WHERE {
  # Step One: Let's get from our chosen lot to the auction-of-lot and then the lot
  ?auction_of_lot crm:P9i_forms_part_of <https://data.getty.edu/provenance/b50ee872-a6f0-3cf4-9152-978833633541> .
  ?auction_of_lot crm:P16_used_specific_object ?lot .
  ?auction_of_lot a crm:E7_Activity .
  ?auction_of_lot crm:P4_has_time-span ?auction_of_lot_time .
  ?auction_of_lot_time rdfs:label ?auction_of_lot_time_label .
  ?lot a la:Set .
  ?lot rdfs:label ?lot_label .
  # Step Two: Let's fill in some details about these lots
  ?lot crm:P1_is_identified_by ?lot_id .
  ?lot_id a crm:E42_Identifier .
  ?lot_id crm:P190_has_symbolic_content ?lot_id_content .
  ?auction_of_lot rdfs:label ?auction_of_lot_label .
}

Commentary

This is still under construction. For clarity’s sake, commentary proceeds step-by-step (see the comment lines in the query, which start with #s) and line numbers are relative to that section. As we develop our Gists development toolkit, we may implement better ways to mark up lines in the code block.

Step One

  • Line 1: This query starts with one particular auction-event—that is, “Auction Event Br-A944 (1773-03-31 to 1773-04-03)”. There’s no particular reason for this: This can be replaced with any other auction-event. We have to proceed backwards to get from this to the auction-of-lot (see Figure 1 for this relationship). This means putting the auction-event into the Object position of the first line of the query. That relationship is specified by the CRM property P9i_forms_part_of.
  • Line 2: Thereafter, we switch directions and go from the auction-of-lots to the associated sets—i.e., the lots. This relationship can also be seen in Figure 1. As we noted above, auction-of-lot is the hinge on which auction-event and lot connect. In this case, the connection goes from auction-of-lot to lot through P16_used_specific_object.
  • Line 4: We do some work to draw the timespan out of the auction-of-lot. One reason to do this is because the auction-event can contain a timespan that spans multiple days (reflecting the real length of big auctions, which do sometimes simply take a long time to complete). But auction-of-lots and lots should have single-day timespans.⚀

Notes

⚀: Right now, we have some problems with the lot level timespans (they have taken on the auction-event timespans’ begin-of-begin programmatically—but that isn’t always accurate for the lot). This will be fixed. For now, as the query is written, we get dates for lots from auction-of-lot. (05-30-2025)