A set of SPARQL examples that are used in different AMC resources
Find SnomedURIs stored as Literals
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT *
WHERE {
?subject skos:exactMatch ?oldLiteral .
FILTER(isLiteral(?oldLiteral)) # Ensure it's a literal
FILTER(STRSTARTS(?oldLiteral, "http://purl.bioontology.org/ontology/SNOMEDCT/")) # Match SNOMEDCT literals
BIND(IRI(?oldLiteral) AS ?correctURI) # Convert to a proper URI
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?correctURI"):::projected
v1("?oldLiteral"):::projected
v2("?subject"):::projected
f0[["starts-with(?oldLiteral,'http://purl.bioontology.org/ontology/SNOMEDCT/')"]]
f0 --> v1
f1[["isLiteral(?oldLiteral)"]]
f1 --> v1
v2 --"skos:exactMatch"--> v1
bind2[/"?oldLiteral"/]
v1 --o bind2
bind2 --as--o v3