A set of SPARQL examples that are used in different AMC resources
Find URIs 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
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[["isLiteral(?oldLiteral)"]]
f0 --> v1
v2 --"skos:exactMatch"--> v1
bind1[/"?oldLiteral"/]
v1 --o bind1
bind1 --as--o v3