Skip to content

Instantly share code, notes, and snippets.

Avatar

Ethan Gruber ewg118

  • American Numismatic Society
  • Charlottesville, Virginia
View GitHub Profile
@ewg118
ewg118 / nomisma-pleiades-json
Created Jul 11, 2014
SPARQL query of nomisma3 - get geoJSON for regions associated with Pleiades
View nomisma-pleiades-json
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX osgeo: <http://data.ordnancesurvey.co.uk/ontology/geometry/>
SELECT ?place ?pleiades ?geoJSON WHERE {
?place skos:relatedMatch ?pleiades .
?place geo:location ?loc .
?loc osgeo:asGeoJSON ?geoJSON
}
@ewg118
ewg118 / nomisma-images
Created Feb 24, 2015
Nomisma SPARQL images
View nomisma-images
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 skos: <http://www.w3.org/2004/02/skos/core#>
View gist:6b0b99d953ae1f4d8eaf
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<xsl:for-each select="descendant::*:fsDecl">
<xsl:variable name="id" select="@xml:id"/>
<xsl:value-of select="*:fsDescr"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="count(ancestor::*:TEI/descendant::*:fs[@type=$id])"/>
@ewg118
ewg118 / gist:c059341524d187c76185
Created May 13, 2015
Get average weight of RRC 273/1 coins
View gist:c059341524d187c76185
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX crro: <http://numismatics.org/crro/id/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT (AVG(xsd:decimal(?weight)) AS ?avgWeight) WHERE {
?objects nmo:hasTypeSeriesItem crro:rrc-273.1 ;
nmo:hasWeight ?weight
}
@ewg118
ewg118 / gist:c854c94c3ed8fd0af898
Created May 13, 2015
Display mints that issued silver Republican coinage, with count of types, grouped and order by mint name.
View gist:c854c94c3ed8fd0af898
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?label (count(?mint) as ?count) WHERE {
?types nmo:hasMaterial nm:ar ;
dcterms:source nm:rrc ;
nmo:hasMint ?mint .
?mint skos:prefLabel ?label .
@ewg118
ewg118 / gist:b7530d6f9156ea2b2f42
Created May 13, 2015
Get a list of all silver types in RRC
View gist:b7530d6f9156ea2b2f42
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT * WHERE {
?types nmo:hasMaterial nm:ar ;
dcterms:source nm:rrc
}
@ewg118
ewg118 / gist:e5be0d3b8c3f6c262432
Created May 13, 2015
Get a list of objects with the RRC 273/1 type
View gist:e5be0d3b8c3f6c262432
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX crro: <http://numismatics.org/crro/id/>
SELECT * WHERE {
?objects nmo:hasTypeSeriesItem crro:rrc-273.1 ;
a ?type
}
@ewg118
ewg118 / gist:9500a604b2117698caae
Created May 13, 2015
A list of Roman Republican silver coins (limited to 100)
View gist:9500a604b2117698caae
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 ;
dcterms:source nm:rrc .
?objects nmo:hasTypeSeriesItem ?types ;
a nmo:NumismaticObject
} LIMIT 100
@ewg118
ewg118 / gist:c1fb8ba5c5609d260205
Created May 13, 2015
Get all findspots for all hoards or coins associated with silver imperial types
View gist:c1fb8ba5c5609d260205
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 ?object ?type ?findspot ?lat ?long ?name WHERE {
?coinType nmo:hasMaterial nm:ar ;
@ewg118
ewg118 / gist:3c55da72510cae200f93
Last active Aug 29, 2015
Get information about nm:rome
View gist:3c55da72510cae200f93
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 .
nm:rome rdf:type ?type .
nm:rome dcterms:isPartOf ?field .
You can’t perform that action at this time.