Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get a count of mints with and without geographic coordinates for Seleucid Monograms
PREFIX crm: <>
PREFIX dcmitype: <>
PREFIX dcterms: <>
PREFIX foaf: <>
PREFIX geo: <>
PREFIX nm: <>
PREFIX nmo: <>
PREFIX org: <>
PREFIX rdf: <>
PREFIX rdfs: <>
PREFIX skos: <>
PREFIX xsd: <>
SELECT DISTINCT ?symbol (count(DISTINCT ?mint) as ?certainCount) (count(DISTINCT ?uncertainMint) as ?uncertainCount) WHERE {
?type a nmo:TypeSeriesItem ;
dcterms:source nm:seleucid_coins ;
nmo:hasObverse/nmo:hasControlmark|nmo:hasReverse/nmo:hasControlmark ?symbol .
?symbol a nmo:Monogram .
{?type nmo:hasMint ?mint .
?mint a nmo:Mint ; geo:location ?loc}
UNION {?type nmo:hasMint ?uncertainMint .
?uncertainMint a nmo:Mint .
FILTER NOT EXISTS{?uncertainMint geo:location ?uncertainLoc}
FILTER NOT EXISTS{?uncertainMint skos:broader ?broader . ?broader a nmo:Mint}}
} GROUP BY ?symbol HAVING (?certainCount = 1 && ?uncertainCount = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment