Created
September 27, 2024 20:36
-
-
Save ewg118/ba80b61181176cdd91fc5bb0f7b84af2 to your computer and use it in GitHub Desktop.
SPARQL query to match monogram relationships in Nomisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/> | |
PREFIX dcterms: <http://purl.org/dc/terms/> | |
PREFIX dcmitype: <http://purl.org/dc/dcmitype/> | |
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#> | |
SELECT ?symbol ?symbolLabel ?altSymbol ?altSymbolLabel ?image ?altImage (count(?altSymbol) as ?count) WHERE { | |
BIND (<http://nomisma.org/symbol/monogram.01830> as ?symbol) | |
{?side nmo:hasControlmark ?symbol} | |
UNION {?side nmo:hasControlmark ?match . | |
?match ^skos:exactMatch ?symbol} | |
?type nmo:hasObverse|nmo:hasReverse ?side . | |
{?side nmo:hasControlmark ?altSymbol} | |
UNION {?side nmo:hasControlmark ?altMatch . | |
?altMatch ^skos:exactMatch ?altSymbol } | |
FILTER (?altSymbol != ?symbol && contains(str(?altSymbol), "http://nomisma.org/symbol")) | |
?symbol skos:prefLabel ?symbolLabel . | |
?symbol crm:P165i_is_incorporated_in ?image . | |
?altSymbol skos:prefLabel ?altSymbolLabel . | |
?altSymbol crm:P165i_is_incorporated_in ?altImage . | |
} GROUP BY ?symbol ?symbolLabel ?altSymbol ?altSymbolLabel ?image ?altImage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment