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 / rome_labels
Last active Aug 29, 2015
Query labels for nm:rome
View rome_labels
SELECT ?label WHERE {
<http://nomisma.org/id/rome> <http://www.w3.org/2004/02/skos/core#prefLabel> ?label
}
@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 .
@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: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:5e94523486541f3d89e2
Last active Aug 29, 2015
Get a list of mints
View gist:5e94523486541f3d89e2
PREFIX nmo: <http://nomisma.org/ontology#>
SELECT ?mints WHERE {
?mints a nmo:Mint
}
@ewg118
ewg118 / gist:7eb155ed89f04219af0f
Last active Aug 29, 2015
Visualizing Greek coin production
View gist:7eb155ed89f04219af0f
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#>
SELECT ?label ?lat ?long WHERE {
?mints a nmo:Mint ;
skos:prefLabel ?label ;
dcterms:isPartOf nm:greek_numismatics ;
You can’t perform that action at this time.