Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get reverse dies paired with an obverse die, and then get the obverse dies paired with those reverse dies.
PREFIX dcterms: <>
PREFIX nm: <>
PREFIX nmo: <>
PREFIX rdf: <>
PREFIX skos: <>
PREFIX xsd: <>
SELECT DISTINCT ?die ?dieLabel ?altDie ?altDieLabel (count(?object) as ?count) WHERE {
BIND (<> as ?die)
GRAPH <> {
?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