public class R2RMLIRISafeEncoder extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.collect.ImmutableMap<String,String> |
TABLE
This table is used for IRI safe encoding according to
|
| Constructor and Description |
|---|
R2RMLIRISafeEncoder() |
| Modifier and Type | Method and Description |
|---|---|
static String |
decode(String encodedURI)
Given a string representing a URI, this method will return a new String
in which all percent encoded characters (e.g., %20) will
be restored to their original characters (e.g., ' ').
|
static String |
encode(String pe) |
public static final com.google.common.collect.ImmutableMap<String,String> TABLE
The IRI-safe version of a string is obtained by applying the following transformation to any character that is not in the iunreserved production in [RFC3987]:
RFC 3987 2.2. ABNF for IRI References and IRIs
iunreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" / ucschar
ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF
/ %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD
/ %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD
/ %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD
/ %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD
/ %xD0000-DFFFD / %xE1000-EFFFD
We only implement the encoding for the range of basic latin ( - ) for performance reason. Other symbols outside of `iunreserved` are mostly control symbols. NB: it is important to place "%" to be beginning if we implement the encoding by a sequence of replacements.
public static String decode(String encodedURI)
Copyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.