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 / distribution.sparql
Created November 18, 2015 14:04
Get the geographic distribution of RRC 322.1a
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
@ewg118
ewg118 / inverse_image_count.sparql
Created December 10, 2015 14:26
Count of OCRE types without photographs
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 osgeo: <http://data.ordnancesurvey.co.uk/ontology/geometry/>
PREFIX rdac: <http://www.rdaregistry.info/Elements/c/>
@ewg118
ewg118 / PAS_Augustus.sparql
Created December 10, 2015 17:38
Get coins of Augustus from the Portable Antiquities Scheme SPARQL endpoint, with denomination, mint, and obverse/reverse type descriptions and legends
PREFIX crm: <http://erlangen-crm.org/current/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dcterms: <http://purl.org/dc/terms>
prefix nm: <http://nomisma.org/id/>
prefix nmo: <http://nomisma.org/ontology#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?mint ?authority ?denomination ?obvType ?obvLegend ?revType ?revLegend WHERE {
?s nmo:hasAuthority nm:augustus ;
nmo:hasMint ?mint ;
@ewg118
ewg118 / getty.sparql
Last active December 14, 2015 17:38
Get a concordance between Nomisma.org and Gettty URIs from the Nomisma SPARQL endpoint
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 osgeo: <http://data.ordnancesurvey.co.uk/ontology/geometry/>
PREFIX rdac: <http://www.rdaregistry.info/Elements/c/>
@ewg118
ewg118 / mapping.csv
Last active December 15, 2015 20:45
CollectiveAccess entity relationship mapping
Rule type ID Parent ID Element Source Options Notes
Mapping persname authority persname ca_entities.preferred_labels { "context" : "ca_entities","restrictToTypes" : [ "individual" ],"omitIfEmpty" : "ca_entities.preferred_labels" }
Mapping persname_role persname @xlink:role ca_entities.relationship_type_id { "context" : "ca_entities" }
@ewg118
ewg118 / material_mapping.csv
Last active December 17, 2015 16:25
CollectiveAccess material mapping for preferred label + idno
Rule type ID Parent ID Element Source Options Notes
Mapping material typeDesc material ca_objects.material { "convertCodesToDisplayText" : 1,"repeat_element_for_multiple_values": 1,"context" : "ca_objects.material" }
Mapping material_href material @xlink:href ca_objects.material { "convertCodesToIdno" : 1 }
@ewg118
ewg118 / matches.csv
Last active January 6, 2016 13:47
Coins from the Portable Antiquities Scheme that can be attributed accurately to OCRE (4 or more of the same ID)
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 7 columns, instead of 1. in line 5.
object,id,certainty,obverseDescription,obverseInscription,reverseDescription,reverseInscription
https://finds.org.uk/database/artefacts/record/id/195,ric.1(2).tib.30,6.8,"Laureate head, r.","TI CAESAR DIVI - AVG F AVGVSTVS","Livia or Pax (?) seated r., holding branch","PONTIF MAXIM"
https://finds.org.uk/database/artefacts/record/id/107533,ric.1(2).tib.26,7.8,"Laureate head right","TI CAESAR DIVI F AVGVSTVS","Pax seated right with branch and sceptre","[PONTIF] MAXIM"
https://finds.org.uk/database/artefacts/record/id/113094,ric.1(2).tib.30,7.2,"Laureate bust facing right","[TI CAESAR DIVI] AVG F AVGVSTVS (right up, left down)","Pax seated right on a chair holding branch in left hand and long sceptre in right. The chair legs are ornamented. There is a single line below.","PONTIF MAXIM (right up, left down)"
https://finds.org.uk/database/artefacts/record/id/130748,ric.1(2).gai.58,6.4,"Head left, wearing rostral crown.","M AGRIPPA L F COS II[I]","Neptune standing left, holding [dolphin] and [trident].","S C"
https
@ewg118
ewg118 / test-date.xhtml
Created February 17, 2016 14:59
Testing the xs:date type in the XForms engine to identify problem with date picker
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
<head>
<title>Academia Migrate</title>
<link rel="stylesheet" href="/fr/style/bootstrap/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="/fr/style/form-runner-bootstrap-override.css" type="text/css" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
@ewg118
ewg118 / ric_concepts.sparql
Last active May 18, 2016 19:16
Get all Nomisma concepts associated with RIC coin types
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bio: <http://purl.org/vocab/bio/0.1/>
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#>
@ewg118
ewg118 / coins_by_ruler.sparql
Created June 24, 2016 16:56
Get coins of a particular ruler in the BM SPARQL endpoint
PREFIX bmo: <http://collection.britishmuseum.org/id/ontology/>
PREFIX crm: <http://erlangen-crm.org/current/>
PREFIX ecrm: <http://erlangen-crm.org/current/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?s WHERE {
?s ecrm:P108i_was_produced_by ?prod .