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 / monogram-mint.sparql
Created September 30, 2024 20:25
Nomisma query for monograms by mint
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 / monogram-link.sparql
Created September 27, 2024 20:36
SPARQL query to match monogram relationships in Nomisma
@ewg118
ewg118 / gist:3ae246ce69268618934da9c7143a6cd4
Last active August 21, 2024 14:11
ANS CSV RDF export
<nmo:NumismaticObject rdf:about="{{cells['URI'].value}}">
<dcterms:title xml:lang="en">{{cells["Title"].value}}</dcterms:title>
<dcterms:identifier>{{cells["IDN"].value}}</dcterms:identifier>
<nmo:hasCollection rdf:resource="http://nomisma.org/id/ans"/>
<nmo:hasTypeSeriesItem rdf:resource="{{cells["Coin Type URI"].value}}"/>
{{forNonBlank(cells["Weight (in g)"], c, '<nmo:hasWeight rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">' + c.value + '</nmo:hasWeight>', "")}}
{{forNonBlank(cells["Diameter (in mm)"], 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>
@ewg118
ewg118 / wikidata-places.sparql
Created September 22, 2023 17:36
Wikdata Geonames and label place query
SELECT ?place ?placeLabel ?geonames ?country ?countryLabel ?region ?regionLabel WHERE {
BIND (<http://www.wikidata.org/entity/Q1930> as ?place)
OPTIONAL { ?place wdt:P1566 ?geonames }
OPTIONAL {?place wdt:P17 ?country }
OPTIONAL {?place wdt:P131+ ?region .
{?region wdt:P31 wd:Q35657}
UNION {?region wdt:P31 wd:Q11828004}}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
@ewg118
ewg118 / corpus-nummorum-coins.sparql
Created July 12, 2023 18:11
Corpus Nummorus query of coins related to types
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 / corpus-nummorum-types.sparql
Last active October 1, 2024 19:11
Constructing type from Corpus Nummorum endpoint
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 / zeus.sparql
Created June 16, 2023 17:59
Obverse depictions of Zeus via Manto link
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 / getty-ric.sparql
Last active August 13, 2023 01:31
Getty SPARQL query for RIC (Mattingly) coins
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 ?homepage ?weight ?diameter ?found ?ref WHERE {
@ewg118
ewg118 / pella-coins.sparql
Created September 28, 2022 13:26
Coins connected to PELLA with images and weights
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 / singleton_monograms.sparql
Created August 10, 2022 15:57
Monograms that appear only on a single type, with some optional authority/mint context
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#>