Class CastFunction

    • Constructor Detail

      • CastFunction

        public CastFunction()
    • Method Detail

      • evaluate

        public org.eclipse.rdf4j.model.Literal evaluate​(org.eclipse.rdf4j.model.ValueFactory valueFactory,
                                                        org.eclipse.rdf4j.model.Value... args)
                                                 throws ValueExprEvaluationException
        Description copied from interface: Function
        Evaluate the function over the supplied input arguments, using the supplied ValueFactory to produce the result.
        Specified by:
        evaluate in interface Function
        Parameters:
        valueFactory - a ValueFactory to use for producing the function result.
        args - the function input arguments.
        Returns:
        the function result value.
        Throws:
        ValueExprEvaluationException
      • convert

        protected abstract org.eclipse.rdf4j.model.Literal convert​(org.eclipse.rdf4j.model.ValueFactory vf,
                                                                   org.eclipse.rdf4j.model.Value v)
                                                            throws ValueExprEvaluationException
        Convert the supplied value to a literal of the function output datatype.
        Parameters:
        vf - the valueFactory to use
        v - a value that is not a string-typed literal, and not a literal of the same datatype as the function output datatype.
        Returns:
        a literal value of the function output datatype
        Throws:
        ValueExprEvaluationException - if an error occurs in conversion.
      • getXsdDatatype

        @Deprecated(since="5.0.0",
                    forRemoval=true)
        protected org.eclipse.rdf4j.model.IRI getXsdDatatype()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Get the specific XML Schema datatype which this function returns.
        Returns:
        an XML Schema datatype IRI
      • getCoreXsdDatatype

        protected abstract org.eclipse.rdf4j.model.base.CoreDatatype.XSD getCoreXsdDatatype()
      • getXsdName

        protected String getXsdName()
        Returns a prefixed name representation of the specific datatype that this function returns
        Returns:
        a prefixed name, e.g. 'xsd:integer'.
      • isValidForDatatype

        protected abstract boolean isValidForDatatype​(String lexicalValue)
        Verifies that the supplied lexical value is valid for the datatype.
        Parameters:
        lexicalValue - a lexical value
        Returns:
        true if the lexical value is valid for the datatype, false otherwise.