Class AbstractLiteral.CalendarLiteral

    • Field Detail

      • DATATYPE_FACTORY

        private static final java.lang.ThreadLocal<javax.xml.datatype.DatatypeFactory> DATATYPE_FACTORY
      • DATATYPES

        private static final java.util.Map<javax.xml.namespace.QName,​CoreDatatype.XSD> DATATYPES
      • value

        private final javax.xml.datatype.XMLGregorianCalendar value
      • label

        private final java.lang.String label
    • Constructor Detail

      • CalendarLiteral

        CalendarLiteral​(java.util.GregorianCalendar calendar)
      • CalendarLiteral

        CalendarLiteral​(javax.xml.datatype.XMLGregorianCalendar calendar)
    • Method Detail

      • datatypes

        private static java.util.Map<javax.xml.namespace.QName,​CoreDatatype.XSD> datatypes()
      • parseCalendar

        private static javax.xml.datatype.XMLGregorianCalendar parseCalendar​(java.lang.String label)
      • getLabel

        public java.lang.String getLabel()
        Description copied from interface: Literal
        Gets 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: Literal
        Gets 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: Literal
        Gets the datatype for this literal.

        If Literal.getLanguage() returns a non-empty value than this must return rdf:langString. If no datatype was assigned to this literal by the creator, then this method must return xsd:string.

        Returns:
        The datatype for this literal.
      • calendarValue

        public javax.xml.datatype.XMLGregorianCalendar calendarValue()
        Description copied from interface: Literal
        Returns the XMLGregorianCalendar value of this literal. A calendar representation can be given for literals whose label conforms to the syntax of the following XML Schema datatypes: dateTime, time, date, gYearMonth, gMonthDay, gYear, gMonth or gDay.
        Specified by:
        calendarValue in interface Literal
        Overrides:
        calendarValue in class AbstractLiteral
        Returns:
        The calendar value of the literal.
      • getCoreDatatype

        public CoreDatatype getCoreDatatype()
        Description copied from interface: Literal
        CoreDatatype 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.