- All Implemented Interfaces:
- com.hp.hpl.jena.sparql.function.Function
public class UrlDecode
extends com.hp.hpl.jena.sparql.function.FunctionBase1
The opposite of the Sparql standards' "encode_for_uri" (right now its my UrlEncode):
It takes a plain (string) literal, and url decodes it.
Any input of different type results in an exception.
Note:
The optimizer will transform
UrlEncode(?x) = const into
?x = UrlDecode(const)
Since a single string may have multiple
url encodings (every chacacter could be percent escaped), the implication is,
that the expression will evaluate true for all constants whose url-encoded
form equals x; as opposed to only the specific given constant.
I think, in practice this might be very convenient property, but if people dislike it,
I could add an uri-equals predicate, and only for this the optimization may be applied.
- Author:
- raven