java.lang.Object
org.apache.jena.sparql.function.FunctionBase
fr.mines_stetienne.ci.sparql_generate.function.library.FUN_dateTime
All Implemented Interfaces:
org.apache.jena.sparql.function.Function

public final class FUN_dateTime extends org.apache.jena.sparql.function.FunctionBase
Binding function fun:dateTime converts a given datetime or a UNIX timestamp in milliseconds to an xsd:dateTime.

See Live example

  • args contains the supplied arguments such that
    • the first argument is either a datetime (String) or a UNIX timestamp in milliseconds (String or integer);
    • the second argument is optional. If provided contains the parsing format string in the ISO 8601 format according to universal time;
    • if there is no second argument, the first argument must be a UNIX timestamp in milliseconds (String or integer);
  • Result is a xsd:dateTime.
Examples:
 
 fun:dateTime(1453508109000) => "2016-01-23T01:15:09Z"^^http://www.w3.org/2001/XMLSchema#dateTime
 fun:dateTime("1453508109000") => "2016-01-23T01:15:09Z"^^http://www.w3.org/2001/XMLSchema#dateTime
 fun:dateTime("04/09/2018","dd/MM/yyyy") => "2018-09-04T00:00:00Z"^^http://www.w3.org/2001/XMLSchema#dateTime
 fun:dateTime("2018-09-01T20:13:42Z", "ISO_DATE_TIME") => "2018-09-01T20:13:42Z"^^http://www.w3.org/2001/XMLSchema#dateTime
 fun:dateTime("2018-09-01", "ISO_DATE") => "2018-09-01T00:00:00Z"^^http://www.w3.org/2001/XMLSchema#dateTime
 
 
Since:
2018-09-05
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
    The SPARQL function URI.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkBuild​(String uri, org.apache.jena.sparql.expr.ExprList args)
     
    org.apache.jena.sparql.expr.NodeValue
    exec​(List<org.apache.jena.sparql.expr.NodeValue> args)
     

    Methods inherited from class org.apache.jena.sparql.function.FunctionBase

    build, evalArgs, exec

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.jena.sparql.function.Function

    build
  • Field Details

  • Constructor Details

    • FUN_dateTime

      public FUN_dateTime()
  • Method Details

    • exec

      public org.apache.jena.sparql.expr.NodeValue exec(List<org.apache.jena.sparql.expr.NodeValue> args)
      Specified by:
      exec in class org.apache.jena.sparql.function.FunctionBase
    • checkBuild

      public void checkBuild(String uri, org.apache.jena.sparql.expr.ExprList args)
      Specified by:
      checkBuild in class org.apache.jena.sparql.function.FunctionBase