public class OUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
toResourceName(String text)
Converts a string to a form suitable for use as a resource name by the
Ontology.createOURIForName(java.lang.String) method. |
static String |
uriDecode(String uri)
Convert a URI reference (URI or URI fragment), in US-ASCII, with escaped
characters taken from UTF-8, to the corresponding Unicode string.
|
static String |
uriEncode(String uriRef)
Convert a Unicode string (which is assumed to represent a URI or URI
fragment) to an RFC 2396-compliant URI reference by first converting it to
bytes in UTF-8 and then encoding the resulting bytes as specified by the
RFC.
|
public static String toResourceName(String text)
Ontology.createOURIForName(java.lang.String)
method. This is not a reversible
encoding, but is intended to produce "readable" resource URIs in an
ontology from English source strings. The process is:
uriEncode(java.lang.String)
the result.public static String uriEncode(String uriRef)
uriRef
- The uri, in characters specified by RFC 2396 + '#'public static String uriDecode(String uri)
uri
- The uri, in characters specified by RFC 2396 + '#'.IllegalArgumentException
- If a % hex sequence is ill-formed.Copyright © 2024 GATE. All rights reserved.