public class Literal extends Object
Constructor and Description |
---|
Literal(String value)
Create a plain literal (i.e an untyped literal) without a language tag
(the language is null).
|
Literal(String value,
DataType dataType)
Create a typed literal.
|
Literal(String value,
Locale language)
Deprecated.
Use the constructor Literal(String value, String languagetag)
instead
|
Literal(String value,
String languagetag)
Create a plain literal associated with a language tag.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
DataType |
getDataType()
Gets the datatype of the literal.
|
Locale |
getLanguage()
Deprecated.
Use the method getLanguageTag() instead.
|
String |
getLanguageTag()
The language tag of the literal as a two-character lowercase language code
or null if no language tag
is associated.
|
String |
getValue()
Returns the value (lexical form) associated with this instance of literal.
|
int |
hashCode() |
String |
toString()
This method always returns the string representation of the
literal value in the same way as getValue().
|
String |
toTurtle()
The representation of the literal in Turtle language
(see http://www.w3.org/TeamSubmission/turtle/)
Note that datatype URIs for typed literals
will always be represented as full URIs
and not use the xsd namespace.
|
public Literal(String value)
@Deprecated public Literal(String value, Locale language)
value
- language
- public Literal(String value, String languagetag)
value
- languagetag
- public Literal(String value, DataType dataType) throws InvalidValueException
value
- dataType
- InvalidValueException
public DataType getDataType()
public String getValue()
@Deprecated public Locale getLanguage()
public String getLanguageTag()
public String toString()
public String toTurtle()
Copyright © 2024 GATE. All rights reserved.