Skip to content

Instantly share code, notes, and snippets.

@ewg118
Last active December 2, 2020 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewg118/7a3c5d60220cafd41a70ba5a443fd86a to your computer and use it in GitHub Desktop.
Save ewg118/7a3c5d60220cafd41a70ba5a443fd86a to your computer and use it in GitHub Desktop.
Get reverse dies paired with an obverse die, and then get the obverse dies paired with those reverse dies.
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 DISTINCT ?die ?dieLabel ?altDie ?altDieLabel (count(?object) as ?count) WHERE {
BIND (<http://numismatics.org/rrdp/id/rrc-15.1.o.1> as ?die)
GRAPH <http://nomisma.org/editor/rschaefer> {
?object nmo:hasObverse/nmo:hasDie/rdf:value ?die
{
SELECT ?object ?altDie WHERE {
?object nmo:hasReverse/nmo:hasDie/rdf:value ?altDie
}
}
}
?die skos:prefLabel ?dieLabel FILTER langMatches(lang(?dieLabel), "en").
?altDie skos:prefLabel ?altDieLabel FILTER langMatches(lang(?altDieLabel), "en").
} GROUP BY ?die ?dieLabel ?altDie ?altDieLabel ORDER BY ?dieLabel ?altDieLabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment