Class AbstractLiteral.TemporalAccessorLiteral
- java.lang.Object
-
- org.eclipse.rdf4j.model.base.AbstractLiteral
-
- org.eclipse.rdf4j.model.base.AbstractLiteral.TemporalAccessorLiteral
-
- Enclosing class:
- AbstractLiteral
static class AbstractLiteral.TemporalAccessorLiteral extends AbstractLiteral
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.rdf4j.model.base.AbstractLiteral
AbstractLiteral.BooleanLiteral, AbstractLiteral.CalendarLiteral, AbstractLiteral.DecimalLiteral, AbstractLiteral.IntegerLiteral, AbstractLiteral.NumberLiteral, AbstractLiteral.TaggedLiteral, AbstractLiteral.TemporalAccessorLiteral, AbstractLiteral.TemporalAmountLiteral, AbstractLiteral.TypedLiteral
-
-
Field Summary
Fields Modifier and Type Field Description private static java.time.format.DateTimeFormatterDASH_FORMATTERprivate CoreDatatype.XSDdatatypeprivate static java.util.Map<java.lang.Integer,CoreDatatype.XSD>DATATYPESprivate static java.time.format.DateTimeFormatterDATETIME_FORMATTERprivate static java.time.temporal.ChronoField[]FIELDSprivate static java.util.Map<CoreDatatype.XSD,java.time.format.DateTimeFormatter>FORMATTERSprivate java.lang.Stringlabelprivate static java.time.format.DateTimeFormatterLOCAL_DATE_FORMATTERprivate static java.time.format.DateTimeFormatterLOCAL_TIME_FORMATTERprivate static java.time.format.DateTimeFormatterOFFSET_DATE_FORMATTERprivate static java.time.format.DateTimeFormatterOFFSET_TIME_FORMATTERprivate static longserialVersionUIDprivate java.time.temporal.TemporalAccessorvalue
-
Constructor Summary
Constructors Constructor Description TemporalAccessorLiteral(java.time.temporal.TemporalAccessor value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.util.Map<java.lang.Integer,CoreDatatype.XSD>datatypes()private static java.time.format.DateTimeFormatterformatter(java.lang.String label)private static java.util.Map<CoreDatatype.XSD,java.time.format.DateTimeFormatter>formatters()CoreDatatypegetCoreDatatype()CoreDatatype is an interface for natively supported datatypes in RDF4J.IRIgetDatatype()Gets the datatype for this literal.java.lang.StringgetLabel()Gets the label (the lexical value) of this literal.java.util.Optional<java.lang.String>getLanguage()Gets the language tag for this literal, normalized to lower case.private static intkey(java.time.temporal.ChronoField... fields)private static intkey(java.time.temporal.TemporalAccessor value)private static intkey(java.util.function.Predicate<java.time.temporal.ChronoField> include, java.time.temporal.ChronoField... fields)(package private) static java.time.temporal.TemporalAccessorparseTemporalAccessor(java.lang.String label)java.time.temporal.TemporalAccessortemporalAccessorValue()Retrieves thetemporal accessorvalue of this literal.-
Methods inherited from class org.eclipse.rdf4j.model.base.AbstractLiteral
booleanValue, byteValue, calendarValue, decimalValue, doubleValue, equals, floatValue, hashCode, integerValue, intValue, longValue, reserved, reserved, shortValue, stringValue, temporalAmountValue, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.model.Value
isBNode, isIRI, isResource, isTriple
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
FIELDS
private static final java.time.temporal.ChronoField[] FIELDS
-
LOCAL_TIME_FORMATTER
private static final java.time.format.DateTimeFormatter LOCAL_TIME_FORMATTER
-
OFFSET_TIME_FORMATTER
private static final java.time.format.DateTimeFormatter OFFSET_TIME_FORMATTER
-
LOCAL_DATE_FORMATTER
private static final java.time.format.DateTimeFormatter LOCAL_DATE_FORMATTER
-
OFFSET_DATE_FORMATTER
private static final java.time.format.DateTimeFormatter OFFSET_DATE_FORMATTER
-
DATETIME_FORMATTER
private static final java.time.format.DateTimeFormatter DATETIME_FORMATTER
-
DASH_FORMATTER
private static final java.time.format.DateTimeFormatter DASH_FORMATTER
-
DATATYPES
private static final java.util.Map<java.lang.Integer,CoreDatatype.XSD> DATATYPES
-
FORMATTERS
private static final java.util.Map<CoreDatatype.XSD,java.time.format.DateTimeFormatter> FORMATTERS
-
value
private final java.time.temporal.TemporalAccessor value
-
label
private final java.lang.String label
-
datatype
private final CoreDatatype.XSD datatype
-
-
Method Detail
-
parseTemporalAccessor
static java.time.temporal.TemporalAccessor parseTemporalAccessor(java.lang.String label) throws java.time.DateTimeException- Throws:
java.time.DateTimeException
-
datatypes
private static java.util.Map<java.lang.Integer,CoreDatatype.XSD> datatypes()
-
formatters
private static java.util.Map<CoreDatatype.XSD,java.time.format.DateTimeFormatter> formatters()
-
formatter
private static java.time.format.DateTimeFormatter formatter(java.lang.String label)
-
key
private static int key(java.time.temporal.TemporalAccessor value)
-
key
private static int key(java.time.temporal.ChronoField... fields)
-
key
private static int key(java.util.function.Predicate<java.time.temporal.ChronoField> include, java.time.temporal.ChronoField... fields)
-
getLabel
public java.lang.String getLabel()
Description copied from interface:LiteralGets the label (the lexical value) of this literal.- Returns:
- The literal's label.
-
getLanguage
public java.util.Optional<java.lang.String> getLanguage()
Description copied from interface:LiteralGets the language tag for this literal, normalized to lower case.- Returns:
- The language tag for this literal, or
Optional.empty()if it doesn't have one.
-
getDatatype
public IRI getDatatype()
Description copied from interface:LiteralGets the datatype for this literal.If
Literal.getLanguage()returns a non-empty value than this must returnrdf:langString. If no datatype was assigned to this literal by the creator, then this method must returnxsd:string.- Returns:
- The datatype for this literal.
-
temporalAccessorValue
public java.time.temporal.TemporalAccessor temporalAccessorValue()
Description copied from interface:LiteralRetrieves thetemporal accessorvalue of this literal.A temporal accessor representation can be given for literals whose label conforms to the syntax of the following XML Schema 1.1 date/time datatypes:
Temporal accessor representations may be converted to specific
java.timevalues likeOffsetDateTimeusing target static factory methods, for instanceOffsetDateTime.from(literal.temporalAccessorValue()).Note however that
java.timedoesn't include dedicated classes for some legal XML Schema date/time values, like offset dates (for instance,2020-11-16+01:00) andxsd:gDay(for instance,---16).- Specified by:
temporalAccessorValuein interfaceLiteral- Overrides:
temporalAccessorValuein classAbstractLiteral- Returns:
- the temporal accessor value of this literal
- See Also:
- The Java™ Tutorials – Trail: Date Time
-
getCoreDatatype
public CoreDatatype getCoreDatatype()
Description copied from interface:LiteralCoreDatatype is an interface for natively supported datatypes in RDF4J. This includes, among others, the XML Schema datatypes and rdf:langString. CoreDatatypes are implemented as enums and more performant and convenient to work with than IRI-based datatypes. The constant {@link CoreDatatype#NONE)} is used to represent a datatype that is not one of the supported core datatypes.- Returns:
- The CoreDatatype or {@link CoreDatatype#NONE)} if the datatype matches none of the core datatypes. This method will not return null.
-
-