Querying for Linked Items

By Miller Prosser, February 2014

The OCHRE data model can result in a web of linked items, from objects to texts to resources, including a wide variety of database items. While allowing for powerful organization, this approach requires a specific strategy for querying the data. In the following example, I demonstrate how to query for items that are linked to specific sub-sets of other items, specifically how to query for resources that are attached to texts and tablets in the Persepolis Fortification Archive Project (PFA). These principles can be extrapolated and applied to other projects where other database items are use.

In the following example, the data is organized in the project as follows.

PTM and BetterLight scans (RESOURCES) linked to tablets (OBJECTS)

PTM and BetterLight scans (RESOURCES) linked to texts (TEXTS) which are attached to tablets (OBJECTS)

PFA regularly photographs tablets then returns the tablets to storage. When the tablets are moved back to storage, the resources get reorganized in OCHRE. So, the question I want to answer with the query is this, “Which resources are linked to a sub-set of tablets that were recently moved to storage?”

Step One: Find the tablets that were moved to storage.

This query finds all objects that have as their most recent event ‘Moved to PTM Office for Storage.’

The results are saved as a set.

Step Two: Find the texts that are linked to the relocated tablets.

The saved set from Step One is linked here as a constraining set. The nature of the constraint is “Is link,” which means that the results of the query in step two are linked to an item in the set. Because I will be querying for texts, this query will now be restricted to texts that are linked to these tablets. The link can be either a loose link or a property link.

We save the results of this query as a set.

Step Three: Find the resources that are linked to the texts that are linked to the relocated tablets.

This query is scoped to only a few Resource hierarchies, i.e. those not yet reorganized. This query is constrained by the results of the query in Step Two, thus finding resources that are linked to texts that are linked to tablets that have been moved to storage.

It is important to note that when results are saved to a set, for now it is necessary to navigate to that set and refresh the contents. It is best to do this by double clicking the link in the “constrain” field. Otherwise, the query will not pick up the new information.

With the results of this query, PFA can use the checklist feature of the query results pane to move the resources from their temporary context to their final context. This is done by toggling the query results to checklist mode:

Now you can select from the results list, choose the new context in the hierarchy pane, and use the Insert button to perform a move of the selected items.

  1. Switch to Checklist mode

  2. Select the items to move

  3. Select the new context

  4. Click Insert button to move