Skip to content

Instantly share code, notes, and snippets.

Avatar

Ethan Gruber ewg118

  • American Numismatic Society
  • Charlottesville, Virginia
View GitHub Profile
@ewg118
ewg118 / gist:2dc16c250e77a0996e28
Created May 13, 2015
Get distinct findspots for silver imperial coinage
View gist:2dc16c250e77a0996e28
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#>
SELECT DISTINCT ?findspot ?lat ?long ?name WHERE {
?coinType nmo:hasMaterial nm:ar ;
@ewg118
ewg118 / gist:8ff575266b7dd1faf114
Created May 13, 2015
UNION list of gold and silver coins (limited to 100)
View gist:8ff575266b7dd1faf114
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT ?objects WHERE {
{ ?types nmo:hasMaterial nm:ar }
UNION { ?types nmo:hasMaterial nm:av }
?types dcterms:source nm:rrc .
?objects nmo:hasTypeSeriesItem ?types ;
a nmo:NumismaticObject
@ewg118
ewg118 / gist:0ce62502c1876844ca2a
Created May 13, 2015
Get findspots for denarii minted from 100 to 50 B.C.
View gist:0ce62502c1876844ca2a
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 xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?object ?type ?findspot ?lat ?long ?name ?closingDate WHERE {
@ewg118
ewg118 / rome_metadata_semicolons
Last active Aug 29, 2015
Get information about nm:rome with semicolons
View rome_metadata_semicolons
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX nm: <http://nomisma.org/id/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?label ?type ?field ?lat ?long WHERE {
nm:rome skos:prefLabel ?label ;
rdf:type ?type ;
dcterms:isPartOf ?field ;
@ewg118
ewg118 / gist:00be8e5671a795a147ed
Last active Aug 29, 2015
Get labels, order alphabetally
View gist:00be8e5671a795a147ed
PREFIX nm: <http://nomisma.org/id/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?label WHERE {
nm:rome skos:prefLabel ?label
} ORDER BY ASC(xsd:string(?label))
@ewg118
ewg118 / gist:f5e177c30fff5a282cb2
Created May 13, 2015
SPARQL filter: geographic distribution of Jupiter coins minter after A.D. 1
View gist:f5e177c30fff5a282cb2
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 skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
@ewg118
ewg118 / gist:8161a9e118f3b8803a97
Last active Aug 29, 2015
Filter by English label
View gist:8161a9e118f3b8803a97
PREFIX nm: <http://nomisma.org/id/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?label WHERE {
nm:rome skos:prefLabel ?label .
FILTER langMatches( lang(?label), "en" )
}
@ewg118
ewg118 / gist:55f16a2a96521d6e6768
Created May 13, 2015
Get weight and diameter (required) for objects of RRC 273/1
View gist:55f16a2a96521d6e6768
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX crro: <http://numismatics.org/crro/id/>
SELECT ?objects ?diameter ?weight WHERE {
?objects nmo:hasTypeSeriesItem crro:rrc-273.1 ;
nmo:hasWeight ?weight ;
nmo:hasDiameter ?diameter
}
@ewg118
ewg118 / gist:0bbf7e3c670f7394665f
Created May 13, 2015
Spatial SPARQL: hoards found within 50 km of Athens
View gist:0bbf7e3c670f7394665f
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX spatial: <http://jena.apache.org/spatial#>
SELECT DISTINCT ?hoard ?label ?lat ?long WHERE {
?loc spatial:nearby (37.974722 23.7225 50 'km') ;
geo:lat ?lat ;
@ewg118
ewg118 / gist:cb603f187f065acf1535
Created May 13, 2015
Get a count of all silver coins associated with RRC types
View gist:cb603f187f065acf1535
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT (count(?objects) as ?count) WHERE {
?types nmo:hasMaterial nm:ar ;
dcterms:source nm:rrc .
?objects nmo:hasTypeSeriesItem ?types ;
a nmo:NumismaticObject
}