Skip to content

Instantly share code, notes, and snippets.

Avatar

Ethan Gruber ewg118

  • American Numismatic Society
  • Charlottesville, Virginia
View GitHub Profile
@ewg118
ewg118 / esty_frequency.sparql
Created Jun 30, 2022
Esty: count number of dies by their frequency for RRC 336/1c
View esty_frequency.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 ?frequency (count(?die) as ?dieCount) WHERE {
{
SELECT DISTINCT ?die (count(?object) as ?frequency) WHERE {
@ewg118
ewg118 / esty_d1.sparql
Created Jun 30, 2022
Esty: Get dies with only one occurrence d1 for coin type
View esty_d1.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 (count(?die) as ?dieCount) WHERE {
{
SELECT DISTINCT ?die (count(?object) as ?count) WHERE {
@ewg118
ewg118 / esty_d.sparql
Created Jun 30, 2022
Esty: Get unique obverse dies d for coin type
View esty_d.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 (count(DISTINCT ?die) as ?count) WHERE {
?object nmo:hasTypeSeriesItem <http://numismatics.org/crro/id/rrc-336.1c> .
GRAPH <http://nomisma.org/editor/rschaefer> {
@ewg118
ewg118 / esty_n.sparql
Created Jun 30, 2022
Esty: Get sample size n of coins for type
View esty_n.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 (count(?object) as ?count) WHERE {
?object nmo:hasTypeSeriesItem <http://numismatics.org/crro/id/rrc-336.1c> .
GRAPH <http://nomisma.org/editor/rschaefer> {
@ewg118
ewg118 / silver-gold.sparql
Created Apr 13, 2022
Silver and gold coin coins after 337 CE
View silver-gold.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 / kbr.rdf
Created Nov 30, 2021
Royal Library of Belgium OpenRefine template for Nomisma
View kbr.rdf
<nmo:NumismaticObject rdf:about="{{cells['Permalink'].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/kbr"/>
<nmo:hasTypeSeriesItem rdf:resource="{{cells["RRC"].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["Orientation"], c, '<nmo:hasAxis rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">' + c.value + '</nmo:hasAxis>', "")}}
<nmo:hasObverse>
<rdf:Description>
@ewg118
ewg118 / odessus_monograms.sparql
Created Oct 25, 2021
Monograms associated with Odessus
View odessus_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 / members.sparql
Created Oct 22, 2021
Get a list of member people and organization associated with a foaf:Organization in Nomisma
View members.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 / bm-coins.rdf
Last active Sep 24, 2021
British Museum coins OpenRefine template
View bm-coins.rdf
<nmo:NumismaticObject rdf:about="{{cells['URI'].value}}">
<dcterms:title xml:lang="en">British Museum: {{cells["Registration no"].value}}</dcterms:title>
<dcterms:identifier>{{cells["Registration no"].value}}</dcterms:identifier>
<nmo:hasCollection rdf:resource="http://nomisma.org/id/bm"/>
{{forNonBlank(cells["Type URI"], c, '<nmo:hasTypeSeriesItem rdf:resource="' + c.value + '"/>', "")}}
{{forNonBlank(cells["Hoard URI"], c, '<dcterms:isPartOf rdf:resource="' + c.value + '"/>', "")}}
{{forNonBlank(cells["Material"], c, '<nmo:hasMaterial rdf:resource="' + c.value + '"/>', "")}}
{{forNonBlank(cells["Mint"], c, '<nmo:hasMint rdf:resource="' + c.value + '"/>', "")}}
{{forNonBlank(cells["Denomination"], c, '<nmo:hasDenomination rdf:resource="' + c.value + '"/>', "")}}
{{forNonBlank(cells["Weight"], c, '<nmo:hasWeight rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">' + c.value + '</nmo:hasWeight>', "")}}
@ewg118
ewg118 / rrc-99-74.sparql
Created Sep 1, 2021
RRC types and coin count from 99-74 BCE
View rrc-99-74.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#>