public class NTriplesUtil extends Object
Constructor and Description |
---|
NTriplesUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
append(BNode bNode,
Appendable appendable) |
static void |
append(Literal lit,
Appendable appendable) |
static void |
append(Resource resource,
Appendable appendable) |
static void |
append(URI uri,
Appendable appendable) |
static void |
append(Value value,
Appendable appendable) |
static String |
escapeString(String label)
Escapes a Unicode string to an all-ASCII character sequence.
|
static void |
escapeString(String label,
Appendable appendable)
Escapes a Unicode string to an all-ASCII character sequence.
|
static boolean |
isLetter(int c)
Checks whether the supplied character is a letter according to the
N-Triples specification.
|
static boolean |
isLetterOrNumber(int c)
Checks whether the supplied character is a letter or number according to
the N-Triples specification.
|
static boolean |
isNumber(int c)
Checks whether the supplied character is a number according to the
N-Triples specification.
|
static BNode |
parseBNode(String nTriplesBNode,
ValueFactory valueFactory)
Parses an N-Triples bNode, creates an object for it using the supplied
ValueFactory and returns this object.
|
static Literal |
parseLiteral(String nTriplesLiteral,
ValueFactory valueFactory)
Parses an N-Triples literal, creates an object for it using the supplied
ValueFactory and returns this object.
|
static Resource |
parseResource(String nTriplesResource,
ValueFactory valueFactory)
Parses an N-Triples resource, creates an object for it using the supplied
ValueFactory and returns this object.
|
static URI |
parseURI(String nTriplesURI,
ValueFactory valueFactory)
Parses an N-Triples URI, creates an object for it using the supplied
ValueFactory and returns this object.
|
static Value |
parseValue(String nTriplesValue,
ValueFactory valueFactory)
Parses an N-Triples value, creates an object for it using the supplied
ValueFactory and returns this object.
|
static String |
toHexString(int decimal,
int stringLength)
Converts a decimal value to a hexadecimal string represention of the
specified length.
|
static String |
toNTriplesString(BNode bNode)
Creates an N-Triples string for the supplied bNode.
|
static String |
toNTriplesString(Literal lit)
Creates an N-Triples string for the supplied literal.
|
static String |
toNTriplesString(Resource resource)
Creates an N-Triples string for the supplied resource.
|
static String |
toNTriplesString(URI uri)
Creates an N-Triples string for the supplied URI.
|
static String |
toNTriplesString(Value value)
Creates an N-Triples string for the supplied value.
|
static String |
unescapeString(String s)
Unescapes an escaped Unicode string.
|
public static Value parseValue(String nTriplesValue, ValueFactory valueFactory) throws IllegalArgumentException
nTriplesValue
- The N-Triples value to parse.valueFactory
- The ValueFactory to use for creating the object.IllegalArgumentException
- If the supplied value could not be parsed correctly.public static Resource parseResource(String nTriplesResource, ValueFactory valueFactory) throws IllegalArgumentException
nTriplesResource
- The N-Triples resource to parse.valueFactory
- The ValueFactory to use for creating the object.IllegalArgumentException
- If the supplied resource could not be parsed correctly.public static URI parseURI(String nTriplesURI, ValueFactory valueFactory) throws IllegalArgumentException
nTriplesURI
- The N-Triples URI to parse.valueFactory
- The ValueFactory to use for creating the object.IllegalArgumentException
- If the supplied URI could not be parsed correctly.public static BNode parseBNode(String nTriplesBNode, ValueFactory valueFactory) throws IllegalArgumentException
nTriplesBNode
- The N-Triples bNode to parse.valueFactory
- The ValueFactory to use for creating the object.IllegalArgumentException
- If the supplied bNode could not be parsed correctly.public static Literal parseLiteral(String nTriplesLiteral, ValueFactory valueFactory) throws IllegalArgumentException
nTriplesLiteral
- The N-Triples literal to parse.valueFactory
- The ValueFactory to use for creating the object.IllegalArgumentException
- If the supplied literal could not be parsed correctly.public static String toNTriplesString(Value value)
public static void append(Value value, Appendable appendable) throws IOException
IOException
public static String toNTriplesString(Resource resource)
public static void append(Resource resource, Appendable appendable) throws IOException
IOException
public static String toNTriplesString(URI uri)
public static void append(URI uri, Appendable appendable) throws IOException
IOException
public static String toNTriplesString(BNode bNode)
public static void append(BNode bNode, Appendable appendable) throws IOException
IOException
public static String toNTriplesString(Literal lit)
public static void append(Literal lit, Appendable appendable) throws IOException
IOException
public static boolean isLetterOrNumber(int c)
isLetter(int)
,
isNumber(int)
public static boolean isLetter(int c)
public static boolean isNumber(int c)
public static String escapeString(String label)
public static void escapeString(String label, Appendable appendable) throws IOException
IOException
public static String unescapeString(String s)
s
- An escaped Unicode string.IllegalArgumentException
- If the supplied string is not a correctly escaped N-Triples
string.public static String toHexString(int decimal, int stringLength)
decimal
- A decimal value.stringLength
- The length of the resulting string.Copyright © 2001-2016 Aduna. All Rights Reserved.