Skip to content

Instantly share code, notes, and snippets.

Avatar

Ethan Gruber ewg118

  • American Numismatic Society
  • Charlottesville, Virginia
View GitHub Profile
@ewg118
ewg118 / certain-uncertain-mints.sparql
Last active Jun 11, 2021
Get a count of mints with and without geographic coordinates for Seleucid Monograms
View certain-uncertain-mints.sparql
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 / distinct-mints-for-monogram.sparql
Created Jun 10, 2021
Get distinct number of mints associated with each monogram in SCO
View distinct-mints-for-monogram.sparql
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 / uncertain-mint-monograms.sparql
Created Jun 9, 2021
Symbols from Ecbatana that also appear on types with uncertain mints
View uncertain-mint-monograms.sparql
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 / monogram-relations.sparql
Last active Jun 9, 2021
Get monograms related to Price Monogram 829
View monogram-relations.sparql
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 / denomination-counts.sparql
Created Jun 1, 2021
Count of denominations issued starting with Valens/Valentinian.
View denomination-counts.sparql
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 / kerameikos-template.xml
Last active May 28, 2021
Kerameikos template for OpenRefine, to export into Linked Art compliant CIDOC-CRM
View kerameikos-template.xml
<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
Get Kerameikos.org object metadata
View getObject.sparql
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 Apr 26, 2021
Gilles' SPARQL query
View denarii.sparql
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
OpenRefine RDF export template with findspot, for the DNB
View dnb-rdf-template.rdf
<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.txt
Created Apr 2, 2021
OpenRefine Nomisma RDF template with IIIF services (Getty example)
View rdf-template.txt
<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