I have triples like this, where the object is an anyURI
-typed string representation of a CURIe. I would like to construct the triples with the object as a true CURIe or IRI.
@prefix source: <https://example.org/source> .
@prefix external: <https://example.org/external> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
source:sample1 source:external_identifiers "external:0110680"^^xsd:anyURI .
IRI(?o)
returns nothing.IRI(str(?o))
returns<external:0110680>
- but I want
<https://example.org/external/0110680>
- but I want
- This question mentions
tarql:expandPrefixedName
, but when I try that (with the prefix or just as bareexpandPrefixedName
) I get the following error message inarq
or GraphDB. I assume that's because thetarql
functions aren't available in those tools?
MALFORMED QUERY: Lexical error at line 12, column 28. Encountered: '40' (40), after prefix "expandPrefixedName"
I would prefer to do this in SPARQL, but would also try a Python solution using something like rdflib.