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)
Deprecated.
|
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 codePoint)
Check if the supplied code point represents a valid language tag character.
|
static boolean |
isLanguageStartChar(int codePoint)
Check if the supplied code point represents a valid language tag start character.
|
static boolean |
isLocalEscapedChar(int codePoint)
Check if the supplied code point represents a valid local escaped character.
|
static boolean |
isNameChar(int codePoint)
Check if the supplied code point represents a valid name character.
|
static boolean |
isNameEndChar(int codePoint)
Check if the supplied code point represents a valid name end character.
|
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)
Checks if the supplied prefix string is a valid Turtle namespace prefix.
|
static boolean |
isPrefixChar(int codePoint)
Check if the supplied code point represents a valid prefix character.
|
static boolean |
isPrefixStartChar(int codePoint)
Check if the supplied code point represents a valid prefixed name start character.
|
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
if 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 isPrefixStartChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid prefixed name start char, false
otherwise.public static boolean isBLANK_NODE_LABEL_StartChar(int codePoint)
codePoint
- a Unicode code point.true
if 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
if 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
if the supplied code point represents a valid blank node label end char,
false
otherwise.public static boolean isNameStartChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid name start char, false
otherwise.public static boolean isNameChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid name char, false
otherwise.public static boolean isNameEndChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid name end char, false
otherwise.public static boolean isLocalEscapedChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid local escaped char, false
otherwise.public static boolean isPrefixChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid prefix char, false
otherwise.public static boolean isLanguageStartChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid language tag start char,
false
otherwise.public static boolean isLanguageChar(int codePoint)
codePoint
- a Unicode code point.true
if the supplied code point represents a valid language tag char, false
otherwise.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
- a prefix string.public static boolean isPLX_START(String name)
public static boolean isPERCENT(String name)
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)
s
- public static String encodeLongString(String s)
s
- @Deprecated public static String encodeURIString(String s)
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 © 2015-2020 Eclipse Foundation. All Rights Reserved.