public class TurtleUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static char[] |
LOCAL_ESCAPED_CHARS |
| Constructor and Description |
|---|
TurtleUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
decodeString(String s)
Decodes an encoded Turtle string.
|
static String |
encodeLongString(String s)
Encodes the supplied string for inclusion as a long string in a Turtle
document.
|
static String |
encodeString(String s)
Encodes the supplied string for inclusion as a 'normal' string in a Turtle
document.
|
static String |
encodeURIString(String s)
Encodes the supplied string for inclusion as a (relative) URI in a Turtle
document.
|
static int |
findURISplitIndex(String uri)
Tries to find an index where the supplied URI can be split into a
namespace and a local name that comply with the serialization constraints
of the Turtle format.
|
static boolean |
isBLANK_NODE_LABEL_Char(int codePoint)
Check if the supplied code point represents a valid blank node label
character.
|
static boolean |
isBLANK_NODE_LABEL_EndChar(int codePoint)
Check if the supplied code point represents a valid blank node label end
character.
|
static boolean |
isBLANK_NODE_LABEL_StartChar(int codePoint)
Check if the supplied code point represents a valid start character for a
blank node label.
|
static boolean |
isLanguageChar(int c) |
static boolean |
isLanguageStartChar(int c) |
static boolean |
isLocalEscapedChar(int c) |
static boolean |
isNameChar(int c) |
static boolean |
isNameEndChar(int c) |
static boolean |
isNameStartChar(int codePoint)
Check if the supplied code point represents a valid name start character.
|
static boolean |
isPERCENT(String name) |
static boolean |
isPLX_INTERNAL(String name) |
static boolean |
isPLX_START(String name) |
static boolean |
isPN_CHARS_BASE(int codePoint)
Check if the supplied code point represents a valid prefixed name base
character.
|
static boolean |
isPN_CHARS_U(int codePoint)
Check if the supplied code point represents either a valid prefixed name
base character or an underscore.
|
static boolean |
isPN_CHARS(int codePoint)
Check if the supplied code point represents a valid prefixed name
character.
|
static boolean |
isPN_LOCAL_ESC(String name) |
static boolean |
isPN_LOCAL(String name) |
static boolean |
isPN_PREFIX(String prefix)
From Turtle Spec:
|
static boolean |
isPrefixChar(int c) |
static boolean |
isPrefixStartChar(int c) |
static boolean |
isWhitespace(int codePoint)
Check if the supplied code point represents a whitespace character
|
public static int findURISplitIndex(String uri)
uri - The URI to split.public static boolean isWhitespace(int codePoint)
codePoint - a Unicode code pointtrue iff the supplied code point represents a
whitespace character, false otherwise.public static boolean isPN_CHARS_BASE(int codePoint)
From Turtle Spec:
http://www.w3.org/TR/turtle/#grammar-production-PN_CHARS_BASE
[163s] PN_CHARS_BASE ::= [A-Z] | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
public static boolean isPN_CHARS_U(int codePoint)
From Turtle Spec:
http://www.w3.org/TR/turtle/#grammar-production-PN_CHARS_U
[164s] PN_CHARS_U ::= PN_CHARS_BASE | '_'
public static boolean isPN_CHARS(int codePoint)
From Turtle Spec:
http://www.w3.org/TR/turtle/#grammar-production-PN_CHARS
[166s] PN_CHARS ::= PN_CHARS_U | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]
public static boolean isBLANK_NODE_LABEL_StartChar(int codePoint)
codePoint - a Unicode code point.true iff the supplied code point represents a valid
blank node label start char, false otherwise.public static boolean isBLANK_NODE_LABEL_Char(int codePoint)
codePoint - a Unicode code point.true iff the supplied code point represents a valid
blank node label char, false otherwise.public static boolean isBLANK_NODE_LABEL_EndChar(int codePoint)
codePoint - a Unicode code point.true iff the supplied code point represents a valid
blank node label end char, false otherwise.public static boolean isPrefixStartChar(int c)
public static boolean isNameStartChar(int codePoint)
codePoint - a Unicode code point.true iff the supplied code point represents a valid
name start char, false otherwise.public static boolean isNameChar(int c)
public static boolean isNameEndChar(int c)
public static boolean isLocalEscapedChar(int c)
public static boolean isPrefixChar(int c)
public static boolean isLanguageStartChar(int c)
public static boolean isLanguageChar(int c)
public static boolean isPN_PREFIX(String prefix)
http://www.w3.org/TR/turtle/#grammar-production-PN_PREFIX
[167s] PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)?
prefix - public static boolean isPLX_START(String name)
public static boolean isPERCENT(String name)
substring - public static boolean isPLX_INTERNAL(String name)
public static boolean isPN_LOCAL_ESC(String name)
public static boolean isPN_LOCAL(String name)
public static String encodeString(String s)
public static String encodeLongString(String s)
public static String encodeURIString(String s)
public static String decodeString(String s)
s - An encoded Turtle string.IllegalArgumentException - If the supplied string is not a correctly encoded Turtle
string.Copyright © 2001-2015 Aduna. All Rights Reserved.