Skip to content

Instantly share code, notes, and snippets.

@ewg118
Last active October 1, 2024 19:11
Show Gist options
  • Save ewg118/72d5244c5ec2bf7bcb592b4485e0dac1 to your computer and use it in GitHub Desktop.
Save ewg118/72d5244c5ec2bf7bcb592b4485e0dac1 to your computer and use it in GitHub Desktop.
Constructing type from Corpus Nummorum endpoint
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX voidr: <http://rdfs.org/ns/void#/>
PREFIX void: <http://rdfs.org/ns/void#>
CONSTRUCT { ?s a nmo:TypeSeriesItem ;
skos:prefLabel ?label ;
skos:definition ?label ;
dcterms:source ?source ;
nmo:hasMaterial ?mat ;
nmo:hasDenomination ?den ;
nmo:hasMint ?mint ;
nmo:hasRegion ?region ;
nmo:hasIssuer ?issuer ;
nmo:hasAuthority ?authority ;
nmo:hasStartDate ?start ;
nmo:hasEndDate ?end ;
nmo:hasObverse ?obv ;
nmo:hasReverse ?rev ;
void:inDataset <https://www.corpus-nummorum.eu/> .
?obv nmo:hasLegend ?obvLegend ;
dcterms:description ?obvType ;
nmo:hasControlmark ?obvSymbol .
?rev nmo:hasLegend ?revLegend ;
dcterms:description ?revType;
nmo:hasControlmark ?revSymbol}
WHERE {
SELECT * WHERE {
?s a nmo:TypeSeriesItem ;
skos:prefLabel ?label ;
voidr:inDataset ?source .
OPTIONAL { ?s nmo:hasMaterial ?mat }
OPTIONAL { ?s nmo:hasDenomination ?den }
OPTIONAL { ?s nmo:hasMint ?mint }
OPTIONAL { ?s nmo:hasRegion ?region }
OPTIONAL { ?s nmo:hasIssuer ?issuer }
OPTIONAL { ?s nmo:hasAuthority ?authority }
OPTIONAL { ?s nmo:hasStartDate ?start }
OPTIONAL { ?s nmo:hasEndDate ?end }
OPTIONAL {?s nmo:hasObverse ?obv
OPTIONAL {?obv nmo:hasLegend ?obvLegend }
OPTIONAL {?obv dcterms:description ?obvType}
OPTIONAL {?obv nmo:hasControlmark/foaf:thumbnail ?obvSVG}
BIND(URI(REPLACE(REPLACE(str(?obvSVG), "storage/Monograms/cn_controlmark_", "api/monograms/", "i"), ".svg", "", "i")) AS ?obvSymbol)}
OPTIONAL {?s nmo:hasReverse ?rev
OPTIONAL {?rev nmo:hasLegend ?revLegend }
OPTIONAL {?rev dcterms:description ?revType}
OPTIONAL {?rev nmo:hasControlmark/foaf:thumbnail ?revSVG}
BIND(URI(REPLACE(REPLACE(str(?revSVG), "storage/Monograms/cn_controlmark_", "api/monograms/", "i"), ".svg", "", "i")) AS ?revSymbol)}
}} LIMIT 100
@ewg118
Copy link
Author

ewg118 commented Oct 1, 2024

Added query and replacement for controlmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment