Published
Edited
Apr 20, 2022
Insert cell
Insert cell
Insert cell
Insert cell
identified_by = helpers.normalizeFieldToArray(irises, "identified_by")
Insert cell
Insert cell
// get the title of the object
title = helpers.getValueByClassification(irises.identified_by,'http://vocab.getty.edu/aat/300417193');
Insert cell
Insert cell
// if we don't want just the text, but the enclosing object, we can ask for that too
titleClassification = helpers.getClassifiedAs(irises.identified_by, 'http://vocab.getty.edu/aat/300417193')[0]

Insert cell
// we can grab the value explicitly
helpers.getValueOrContent(titleClassification)
Insert cell
Insert cell
// what there's more than one thing that matches? Can we get all of them?
citations = helpers.getValuesByClassification(irises.referred_to_by,'http://vocab.getty.edu/aat/300311705');

Insert cell
JSON.stringify(citations, null, 2);
Insert cell
Insert cell
// what if there were multiple titles and you wanted to filter to the one that was the preferred term as well as the title, if you wanted to perform an OR between these params, you could use _resourcesByClassification_ which is highly configurable.
helpers.getValueByClassification(irises.identified_by,["http://vocab.getty.edu/aat/300404670",'http://vocab.getty.edu/aat/300417193']);
Insert cell
Insert cell
Insert cell
Insert cell
// let's grab the production, we can use normalizeFieldToArray to make sure we always have an array
produced = helpers.normalizeFieldToArray(irises,'produced_by')
Insert cell
// carried out by?
carried_out_by = helpers.normalizeFieldToArray(produced[0], 'carried_out_by')[0]
Insert cell
// but the artist statement might be different for this work... (get the name)
artistName = helpers.getValueByClassification(produced[0]['referred_to_by'],"https://data.getty.edu/museum/ontology/linked-data/tms/object/producer-description")
Insert cell
Insert cell
// if we wanted more information we could use the artist URL to get even more information
Insert cell
Insert cell
Insert cell
Insert cell
// add language support
french = helpers.getValueByClassification(oilPaint.identified_by,"http://vocab.getty.edu/term/POS/Noun", "http://vocab.getty.edu/language/fr")
Insert cell
Insert cell
thumbnail = helpers
.normalizeFieldToArray(irises, "representation")[0]
.id.replace("full/full", "full/500,")
Insert cell
Insert cell
// we can check if there are any visual items
visualItems = helpers.normalizeFieldToArray(irises,"shows")
Insert cell
// from here, we can grab the id
visualItems[0].id
Insert cell
### Exploring the Visual Item
Insert cell
Insert cell
Insert cell
// what if we want to get the Right's statement (electronic) ... it's nested, and only determinable by it being classified by
// https://data.getty.edu/local/thesaurus/rightsstatement-org-statement
subject_to = helpers.normalizeFieldToArray(media1, 'subject_to')[0]
Insert cell
// we need to use the getClassifiedAsWithClassification because we know what the nested value is, but the classification may be different if the image isn't open access
helpers.getClassifiedAsWithClassification(subject_to, "https://data.getty.edu/local/thesaurus/rightsstatement-org-statement")[0].id
Insert cell
Insert cell
// cool, what about the Attribution, which is tied to the rights statement. Here we want to get the grand-parent object instead of the parent classification
rights = helpers.getObjectsClassifiedAsWithClassification(subject_to, "https://data.getty.edu/local/thesaurus/rightsstatement-org-statement")
Insert cell
statement = helpers.getValueByClassification(rights[0].subject_of, "http://vocab.getty.edu/aat/300026687");
Insert cell
Insert cell
Insert cell
attributed_title = helpers.getAttributedBy(annunciation, "identified_by")[0].content
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
media1 = FileAttachment("091001da-caca-5c35-a1db-a01f6ccd69bf.json").json()
Insert cell
media2 = FileAttachment("7f6b7611-9124-54ea-9e43-6c16372414f7@2.json").json()
Insert cell
Insert cell
oilPaint = FileAttachment("300015050.json").json()
Insert cell
Insert cell
import {mermaid} from "@matthewkenny/mermaid-js"
Insert cell
helpers = import("https://cdn.skypack.dev/@thegetty/linkedart.js");
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more