public class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isLangString(Literal lit)
Return true if the literal has a language tag.
|
static boolean |
isLangString(Node n)
A Node is a language string if it has a language tag.
|
static boolean |
isSimpleString(Literal lit)
Return true if the literal is a simple string.
|
static boolean |
isSimpleString(Node n)
A Node is a simple string if:
(RDF 1.0) No datatype and no language tag.
|
static boolean |
notNameChar(char ch)
answer true iff this is not a legal NCName character, ie, is
a possible split-point start.
|
static String |
replace(String s,
String oldString,
String newString) |
static int |
splitNamespaceXML(String uri)
Given an absolute URI, determine the split point between the namespace
part and the localname part.
|
static String |
substituteEntitiesInElementContent(String s)
Answer
s modified to replace <, >, and & by
their corresponding entity references. |
static String |
substituteEntitiesInEntityValue(String s) |
static String |
substituteStandardEntities(String s) |
public static int splitNamespaceXML(String uri)
This operation follows XML QName rules which are more complicated than needed for Turtle and TriG. For example, QName can't start with a digit.
uri
- SplitIRI
public static boolean notNameChar(char ch)
public static String substituteEntitiesInElementContent(String s)
s
modified to replace <, >, and & by
their corresponding entity references.
Implementation note: as a (possibly misguided) performance hack, the obvious cascade of replaceAll calls is replaced by an explicit loop that looks for all three special characters at once.
public static boolean isSimpleString(Node n)
public static boolean isLangString(Node n)
public static boolean isSimpleString(Literal lit)
RDF 1.0 => it is a plain literal, with no language tag
RDF 1.1 => it has datatype xsd:string
public static boolean isLangString(Literal lit)
Licenced under the Apache License, Version 2.0