public class SesameValueBackend extends Object implements NodeBackend<org.openrdf.model.Value>
Constructor and Description |
---|
SesameValueBackend() |
Modifier and Type | Method and Description |
---|---|
Boolean |
booleanValue(org.openrdf.model.Value node)
Return the boolean value of a literal node.
|
org.openrdf.model.Literal |
createLiteral(String content)
Create a literal node with the content passed as argument
|
org.openrdf.model.Literal |
createLiteral(String content,
Locale language,
URI type)
Create a literal node with the content passed as argument
|
org.openrdf.model.URI |
createURI(String uri)
Create a URI mode with the URI passed as argument
|
Date |
dateTimeValue(org.openrdf.model.Value node)
TODO
|
Date |
dateValue(org.openrdf.model.Value node)
TODO
|
protected String |
debugType(org.openrdf.model.Value value)
Prints the type (URI,bNode,literal) by inspecting the parsed
Value
to improve error messages and other loggings. |
BigDecimal |
decimalValue(org.openrdf.model.Value node)
Return the decimal number of a literal node.
|
Double |
doubleValue(org.openrdf.model.Value node)
Return the double value of a literal node.
|
Float |
floatValue(org.openrdf.model.Value node)
Return the float value of a literal node.
|
Locale |
getLiteralLanguage(org.openrdf.model.Value n)
Return the language of the literal node passed as argument.
|
URI |
getLiteralType(org.openrdf.model.Value n)
Return the URI of the type of the literal node passed as argument.
|
BigInteger |
integerValue(org.openrdf.model.Value node)
Return the arbitrary length integer value of a literal node.
|
Integer |
intValue(org.openrdf.model.Value node)
Return the 32bit integer value of a literal node.
|
boolean |
isBlank(org.openrdf.model.Value n)
Test whether the node passed as argument is a blank node
|
boolean |
isLiteral(org.openrdf.model.Value n)
Test whether the node passed as argument is a literal
|
boolean |
isURI(org.openrdf.model.Value n)
Test whether the node passed as argument is a URI
|
Long |
longValue(org.openrdf.model.Value node)
Return the long value of a literal node.
|
String |
stringValue(org.openrdf.model.Value value)
Return the string value of a node.
|
Date |
timeValue(org.openrdf.model.Value node)
TODO
|
public boolean isLiteral(org.openrdf.model.Value n)
isLiteral
in interface NodeBackend<org.openrdf.model.Value>
n
- the node to checkpublic boolean isURI(org.openrdf.model.Value n)
isURI
in interface NodeBackend<org.openrdf.model.Value>
n
- the node to checkpublic boolean isBlank(org.openrdf.model.Value n)
isBlank
in interface NodeBackend<org.openrdf.model.Value>
n
- the node to checkpublic Locale getLiteralLanguage(org.openrdf.model.Value n)
getLiteralLanguage
in interface NodeBackend<org.openrdf.model.Value>
n
- the literal node for which to return the languageIllegalArgumentException
- in case the node is no literalpublic URI getLiteralType(org.openrdf.model.Value n)
getLiteralType
in interface NodeBackend<org.openrdf.model.Value>
n
- the literal node for which to return the typerIllegalArgumentException
- in case the node is no literalpublic String stringValue(org.openrdf.model.Value value)
stringValue
in interface NodeBackend<org.openrdf.model.Value>
value
- public BigDecimal decimalValue(org.openrdf.model.Value node)
NodeBackend
decimalValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the xsd:decimal valuepublic BigInteger integerValue(org.openrdf.model.Value node)
NodeBackend
integerValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the xsd:integer
valuepublic Boolean booleanValue(org.openrdf.model.Value node)
NodeBackend
Boolean.parseBoolean(String)
booleanValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the boolean valuepublic Date dateTimeValue(org.openrdf.model.Value node)
NodeBackend
dateTimeValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the dateTime valuepublic Date dateValue(org.openrdf.model.Value node)
NodeBackend
dateValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the date valuepublic Date timeValue(org.openrdf.model.Value node)
NodeBackend
timeValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the time valuepublic Long longValue(org.openrdf.model.Value node)
NodeBackend
longValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the long valuepublic Double doubleValue(org.openrdf.model.Value node)
NodeBackend
doubleValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the double valuepublic Float floatValue(org.openrdf.model.Value node)
NodeBackend
floatValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the float valuepublic Integer intValue(org.openrdf.model.Value node)
NodeBackend
Note that this is restricted to 32bit singed integer values as defined by
xsd:int and Integer
. For bigger nuber one might want to use
xsd:integer represented by BigInteger
.
intValue
in interface NodeBackend<org.openrdf.model.Value>
node
- the literal node for which to return the Integer (xsd:int) valueprotected String debugType(org.openrdf.model.Value value)
Value
to improve error messages and other loggings. In case of literals
also the literal type
is printedvalue
- the value or null
public org.openrdf.model.Literal createLiteral(String content)
NodeBackend
createLiteral
in interface NodeBackend<org.openrdf.model.Value>
content
- string content to represent inside the literalpublic org.openrdf.model.Literal createLiteral(String content, Locale language, URI type)
NodeBackend
createLiteral
in interface NodeBackend<org.openrdf.model.Value>
content
- string content to represent inside the literalpublic org.openrdf.model.URI createURI(String uri)
NodeBackend
createURI
in interface NodeBackend<org.openrdf.model.Value>
uri
- URI of the resource to createCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.