Exploring Link → Direction ←

Subtitled: The Staff Interface may fool you

http://localhost:8080/agents/agent_corporate_entity/101

You cannot see the records linked to → an agent or subject through the API like you can in the staff interface

You can only see the agents/subjects linked from ← those records

This matters because if you're looking to use the API to create or change links between records you must change/create the link via the endpoint for the record from which the link originates

Pro-tip: The easiest test for this is in the staff interface itself, which is usually a mirror for the API. When you look at an agent record in AS, you also cannot add resources on that screen, you can only add agents to resources on a resource record.

http://localhost:8080/top_containers/1

So to reinforce the point:

You cannot see the records linked to → a top_container through the API like you can in the staff interface

You can only see the top containers linked from ← those records

Any discussion of linking and top containers is also a good moment to explore instances through the API. It's good to know that physical instance information in an AO lives in two places:

In Archival object records

The instance array, the instance type (mixed materials) and the child information (folder/item number) lives in the archival object. [:GET] /repositories/:repo_id/archival_objects/:id

And in Top container records

The top container type, indicator, and barcode live in the top container record. [:GET] /repositories/:repo_id/top_containers/:id

I want to demonstrate this using the very simple phase Box 1, Folder 4

One phrase, four pieces of information, two endpoints:

/repositories/:repo_id/archival_objects/:id

/repositories/:repo_id/top_containers/:id

So over the next few slides I am going to focus closely on the instances array in an archival object AND focus on a top container record.

And we're still exploring linking, so the other lesson here is that if you start on the top_container record, you will not find instance information, nor will you find a link to the AO to go fetch it.

Start from the archival object record, find the instance array, find the folder information and a link to the top container, then follow the link to the top container, grab the container info, and you will have completed your quest.

type_2 = AO_output['instances'][0]['sub_container']['type_2']

indicator_2 = AO_output['instances'][0]['sub_container']['indicator_2']

top_container_uri = AO_output['instances'][0]['sub_container']['top_container']['ref']

So those actions got us Folder and 4 and the info we need to go find the container.

Start from the archival object record, find the instance array, find the folder information and a link to the top container, then follow the link to the top container, grab the container info, and you will have completed your quest.

TC_output = requests.get(baseURL + top_container_uri, headers=headers).json()

TC_type = TC_output['type']

TC_indicator = TC_output['indicator']

To construct the box and folder number statement, you must start from the archival object record, find the instance array, find the folder information and a link to the top container, then follow the link to the top container, grab the container info, and you will have completed your quest.

AO_output = requests.get(baseURL + '/repositories/' + repository + '/archival_objects/6', headers=headers).json()

type_2 = AO_output['instances'][0]['sub_container']['type_2']

indicator_2 = AO_output['instances'][0]['sub_container']['indicator_2']

top_container_uri = AO_output['instances'][0]['sub_container']['top_container']['ref']

TC_output = requests.get(baseURL + top_container_uri, headers=headers).json()

TC_type = TC_output['type']

TC_indicator = TC_output['indicator']

Gotchas: