Skip to content

Instantly share code, notes, and snippets.

View ewg118's full-sized avatar

Ethan Gruber ewg118

  • American Numismatic Society
  • Charlottesville, Virginia
View GitHub Profile
@ewg118
ewg118 / ric-bronze-294.sparql
Created September 17, 2026 15:22
Bronze RIC coins after 294, grouped by legend and type
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
@ewg118
ewg118 / uva-linkedart.ttl
Created September 9, 2026 14:08
Example of UVA Linked Art TTL
<https://search.lib.virginia.edu/sources/images/items/u1002440> a crm:E22_Human-Made_Object ;
rdfs:label "Santo Domingo, past and present: with a glance at Hayti" ;
crm:P108i_was_produced_by [ a crm:E12_Production ;
crm:P14_carried_out_by <http://id.loc.gov/authorities/names/n89612395> ;
crm:P4_has_time-span [ a crm:E52_Time-Span ;
rdfs:label "1873" ;
crm:P82a_begin_of_the_begin "1873-01-01T00:00:00+00:00"^^xsd:dateTime ;
crm:P82b_end_of_the_end "1873-12-31T23:59:59+00:00"^^xsd:dateTime ] ;
crm:P7_took_place_at <https://sws.geonames.org/5128581/> ] ;
crm:P129_is_about [ a crm:E55_Type ;
@ewg118
ewg118 / rembrandt-snac.json
Last active September 8, 2026 13:16
A Linked Art JSON-LD representation of Rembrandt, transformed from SNAC JSON data.
{
"@context": "https://linked.art/ns/v1/linked-art.json",
"id": "http://n2t.net/ark:/99166/w65x29wt",
"type": "Person",
"_label": "Rembrandt Harmenszoon van Rijn, 1606-1669",
"identified_by": [
{
"type": "Name",
"content": "Rembrandt Harmenszoon van Rijn, 1606-1669",
"classified_as": [
@ewg118
ewg118 / la_display.sparql
Created July 10, 2026 18:39
Basic Linked Art display query
PREFIX la: <https://linked.art/ns/terms/>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?label ?place ?placeLabel ?coords ?creator ?creatorLabel ?type ?typeLabel ?manifest WHERE {
BIND (<https://search.lib.virginia.edu/sources/images/items/u11179> as ?object)
?object rdfs:label ?label .
OPTIONAL {?object crm:P108i_was_produced_by/crm:P7_took_place_at ?place .
?place rdfs:label ?placeLabel .
OPTIONAL {?place crm:P168_place_is_defined_by ?coords }}
OPTIONAL {
@ewg118
ewg118 / virginia_production.sparql
Last active July 9, 2026 12:50
UVA items created in Virginia, with WKT coordinates and IIIF manifest
PREFIX la: <https://linked.art/ns/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
SELECT ?object ?title ?place ?placeLabel ?wkt ?manifest WHERE {
?object a crm:E22_Human-Made_Object ;
rdfs:label ?title ;
crm:P108i_was_produced_by/crm:P7_took_place_at ?place ;
crm:P129i_is_subject_of/la:digitally_carried_by/la:access_point ?manifest.
?place crm:P89_falls_within* <https://sws.geonames.org/6254928/> ; #Virginia
rdfs:label ?placeLabel .
@ewg118
ewg118 / virginia.sparql
Created July 7, 2026 20:26
Get all UVA Library special collections objects created in or are about Virginia
PREFIX la: <https://linked.art/ns/terms/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX la: <https://linked.art/ns/terms/>
SELECT DISTINCT ?object ?label ?place ?placeLabel WHERE {
BIND (<https://sws.geonames.org/6254928/> as ?entity)
{?entity ^crm:P89_falls_within* ?place }
@ewg118
ewg118 / printers.sparql
Created July 7, 2026 15:03
The names of printers associated with UVA Library Special Collections objects
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
SELECT DISTINCT ?object ?label ?entityLabel WHERE {
?object a crm:E22_Human-Made_Object ;
rdfs:label ?label ;
{?object crm:P108i_was_produced_by ?prod}
UNION {?object crm:P108i_was_produced_by/crm:P9_consists_of ?prod}
@ewg118
ewg118 / dateRange.sparql
Created July 2, 2026 20:49
Querying CIDOC-CRM for date range from dateTime encoded dates
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
SELECT ?object ?year WHERE {
?object a crm:E22_Man-Made_Object ;
crm:P108i_was_produced_by/crm:P4_has_time-span ?timespan .
?timespan crm:P82a_begin_of_the_begin ?date
BIND (year(xsd:dateTime(?date)) as ?year)
@ewg118
ewg118 / uva-lib:602113.json
Created June 18, 2026 17:00
Linked Art JSON-LD of uva-lib:602113 derived from MARC (includes LCSH)
{
"@context": "https://linked.art/ns/v1/linked-art.json",
"id": "https://search.lib.virginia.edu/sources/images/items/uva-lib:602113",
"type": "HumanMadeObject",
"_label": "Novvelles inventions povr bien bastir et a petits fraiz, trovvees n'Agveres",
"identified_by": [
{
"type": "Name",
"content": "Novvelles inventions povr bien bastir et a petits fraiz, trovvees n'Agveres",
"classified_as": [
@ewg118
ewg118 / uva-lib:612978.json
Created June 18, 2026 16:48
Linked Art JSON-LD representation of an object that began as MARC
{
"@context": "https://linked.art/ns/v1/linked-art.json",
"id": "https://search.lib.virginia.edu/sources/images/items/uva-lib:612978",
"type": "HumanMadeObject",
"_label": "triumphes Petrarcque",
"identified_by": [
{
"type": "Name",
"content": "triumphes Petrarcque",
"classified_as": [