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 / kerameikos-template.xml
Last active May 28, 2021 21:00
Kerameikos template for OpenRefine, to export into Linked Art compliant CIDOC-CRM
<crm:E22_Man-Made_Object rdf:about="{{cells['URL'].value}}">
<crm:P1_is_identified_by>
<crm:E33_E41_Linguistic_Appellation>
<crm:P190_has_symbolic_content>{{cells['Title'].value}}</crm:P190_has_symbolic_content>
<crm:P2_has_type rdf:resource="http://vocab.getty.edu/aat/300404670"/>
</crm:E33_E41_Linguistic_Appellation>
</crm:P1_is_identified_by>
<crm:P1_is_identified_by>
<crm:E42_Identifier>
<crm:P190_has_symbolic_content>{{cells['Acc. no.'].value}}</crm:P190_has_symbolic_content>
@ewg118
ewg118 / getObject.sparql
Created May 5, 2021 15:46
Get Kerameikos.org object metadata
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX crmgeo: <http://www.ics.forth.gr/isl/CRMgeo/>
PREFIX crmsci: <http://www.ics.forth.gr/isl/CRMsci/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX kid: <http://kerameikos.org/id/>
PREFIX kon: <http://kerameikos.org/ontology#>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@ewg118
ewg118 / denarii.sparql
Created April 26, 2021 16:09
Gilles' SPARQL query
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?authority ?authorityLabel (count(?coin) as ?count) WHERE {
?type nmo:hasDenomination nm:denarius ;
nmo:hasAuthority ?authority ;
@ewg118
ewg118 / dnb-rdf-template.rdf
Last active May 26, 2021 14:42
OpenRefine RDF export template with findspot, for the DNB
<nmo:NumismaticObject rdf:about="{{cells['URI'].value}}">
<dcterms:title xml:lang="en">DNB {{cells["Inventory number"].value}}</dcterms:title>
<dcterms:identifier>{{cells["Inventory number"].value}}</dcterms:identifier>
<nmo:hasCollection rdf:resource="http://nomisma.org/id/nnc-dnb"/>
<nmo:hasTypeSeriesItem rdf:resource="{{cells["Type URI"].value}}"/>
{{forNonBlank(cells["weight"], c, '<nmo:hasWeight rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">' + c.value + '</nmo:hasWeight>', "")}}
{{forNonBlank(cells["diameter"], c, '<nmo:hasDiameter rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">' + c.value + '</nmo:hasDiameter>', "")}}
{{forNonBlank(cells["axis"], c, '<nmo:hasAxis rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">' + c.value + '</nmo:hasAxis>', "")}}
<nmo:hasObverse>
<rdf:Description>
@ewg118
ewg118 / rdf-template.rdf
Last active September 24, 2021 14:02
OpenRefine Nomisma RDF template with IIIF services (Getty example)
<nmo:NumismaticObject rdf:about="{{cells['URI'].value}}">
<dcterms:title xml:lang="en">{{cells["name"].value}}</dcterms:title>
<dcterms:identifier>{{cells["accession"].value}}</dcterms:identifier>
<nmo:hasCollection rdf:resource="http://nomisma.org/id/getty_museum"/>
<nmo:hasTypeSeriesItem rdf:resource="{{cells["Type URI"].value}}"/>
{{forNonBlank(cells["weight"], c, '<nmo:hasWeight rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">' + c.value + '</nmo:hasWeight>', "")}}
{{forNonBlank(cells["Obverse IIIF Service"], c, '<nmo:hasObverse>\n\t\t<rdf:Description>\n\t\t\t<foaf:thumbnail rdf:resource="' + c.value + '/full/,120/0/native.jpg"/>\n\t\t\t<foaf:depiction rdf:resource="' + c.value + '/full/600,/0/native.jpg"/>\n\t\t</rdf:Description>\n\t</nmo:hasObverse>', "")}}
{{forNonBlank(cells["Reverse IIIF Service"], c, '<nmo:hasReverse>\n\t\t<rdf:Description>\n\t\t\t<foaf:thumbnail rdf:resource="' + c.value + '/full/,120/0/native.jpg"/>\n\t\t\t<foaf:d
@ewg118
ewg118 / getty-rrc.sparql
Created April 1, 2021 18:47
Republican coins with RRC numbers in the Getty
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 getty: <https://data.getty.edu/>
prefix getty-media: <https://media.getty.edu/>
PREFIX aat: <http://vocab.getty.edu/aat/>
PREFIX la:<https://linked.art/ns/terms/>
PREFIX crmsci: <http://www.ics.forth.gr/isl/CRMsci/>
SELECT ?coin ?accession ?name ?dor ?weight ?diameter ?found ?ref WHERE {
@ewg118
ewg118 / roman_coins_findspot.sparql
Created March 2, 2021 18:47
Roman coins with a findspot
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX dcterms: <http://purl.org/dc/terms/>
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 / LRSP.geojson
Last active December 31, 2020 20:10
Lost River State Park
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ewg118
ewg118 / double_portraits.sparql
Created December 12, 2020 00:10
Double portraits
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX dcterms: <http://purl.org/dc/terms/>
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 / islamic_mints.sparql
Created December 7, 2020 21:50
Islamic mints in Nomisma
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX dcterms: <http://purl.org/dc/terms/>
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#>