简体   繁体   中英

Escape string for conversion to URI in SPARQL

Is there a simple way to escape a string in SPARQL when it is to be converted to a URI?

For instance, a string with "1 < 2" could be converted to "1%20%3C%202" .

I suppose a long series of calls to the REPLACE function could do it, following the pattern BIND(REPLACE(?string, '<', '%3C') AS ?escaped) ?

There is a function ENCODE_FOR_URI :

ENCODE_FOR_URI("1 < 2") => "1%20%3C%202"

Specification: https://www.w3.org/TR/sparql11-query/#func-encode

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM