Skip to content

Instantly share code, notes, and snippets.

@wbsealy
Last active April 2, 2018 17:17
Show Gist options
  • Save wbsealy/398bf35dd1a1a54d10b994817d5c031c to your computer and use it in GitHub Desktop.
Save wbsealy/398bf35dd1a1a54d10b994817d5c031c to your computer and use it in GitHub Desktop.
Prov-O, GETTY SPARQL, and GETTY WEB SERVICES

The PROV Ontology

Getty Example of Prov

http://vocab.getty.edu/aat/rev/5000057716

Gregg's Sparql Query

Note: Gregg's method uses dcterms:modified

Getty Sparql Endpoint: http://vocab.getty.edu/sparql

select ?dv {
aat:300198841 dcterms:modified ?dv
filter not exists {aat:300198841 dcterms:modified ?dv2
filter (?dv2 > ?dv)}}

Getty Recently Modified Subject

http://vocab.getty.edu/queries#Recently_Modified_Subjects

3.11 Recently Modified Subjects

Recently modified subjects have dct:modified after their dct:created (there's no such guarantee for subjects created a long time ago). There's a dct:modified timestamp for every revision action (see Revision History Representation), and there are a lot of them (3.8M as of Mar 2016). So let's limit to AAT, and look for the last 100 revision actions. We use max() to select only the latest modification time for each subject.

select ?x ?lab (max(?mod) as ?mod1) {

  {select * {?x skos:inScheme aat:; dct:modified ?mod} order by desc(?mod) limit 100}

  ?x gvp:prefLabelGVP/xl:literalForm ?lab

} group by ?x ?lab

If you need to find all subjects changed since a certain date, use the following query. (Note: you need to copy it manually to the edit box put a more recent date, since we don't want it to get progressively slower with time.)

select ?x ?lab (max(?mod) as ?mod1) {

  ?x skos:inScheme aat:; dct:modified ?mod

  filter (?mod >= "2016-03-01T00:00:00"^^xsd:dateTime)

  ?x gvp:prefLabelGVP/xl:literalForm ?lab

} group by ?x ?lab

Getty Vocabulary Web Services

NOTE: The excerpt below comes from this document: http://www.getty.edu/research/tools/vocabularies/vocab_web_services.pdf

GetRevisionHistory

Returns information on edits made to vocabulary data based on a date range and input parameter that indicates which piece of revision history information is desired.

Input Notes: Parameters for revision history option include,

  1. – Overall subject record edits
  2. – Added, deleted, modified terms
  3. – Scope note edits
  4. – Moved records
  5. – New records
  6. – All edits and record types
  7. – Deleted records

English_only parameter (AAT only) allows users to request only English note edits. GET examples:

http://vocabsservices.getty.edu/AATService.asmx/AATGetRevisionHistory?startDate=1-AUG-2017&endDate=31-DEC-2017&param=2&english_only=N

http://vocabsservices.getty.edu/ULANService.asmx/ULANGetRevisionHistory?startDate=1-AUG-2017&endDate=31-DEC-2017&param=2

http://vocabsservices.getty.edu/TGNService.asmx/TGNGetRevisionHistory?startDate=1-AUG-2017&endDate=31-DEC-2017&param=2

Output schemas:

http://vocabsservices.getty.edu/Schemas/AAT/AATGetRevisionHistory.xsd http://vocabsservices.getty.edu/Schemas/ULAN/ULANGetRevisionHistory.xsd http://vocabsservices.getty.edu/Schemas/TGN/TGNGetRevisionHistory.xsd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment