title: Operating with datetime types in jess rules
body: <p>I am processing ontologies with JessTab. I need to operate with XMLSchema DateTime values e.g. compare dates. </p>
  
  <pre><code>(defrule checIntervalStatus 
  (declare (salience 40))
  (object (is-a http://www.w3.org/2006/time#Instant) 
          (OBJECT ?ie)
          (http://www.w3.org/2006/time#inXSDDateTime ?iet)
  )
  (object (is-a http://www.w3.org/2006/time#Instant) 
          (OBJECT ?ib)
          (http://www.w3.org/2006/time#inXSDDateTime ?ibt)
  )
  (object (is-a http://www.w3.org/2006/time#Interval) 
          (OBJECT ?oi)
          (http://www.w3.org/2006/time#hasBeginning ?ib)
          (http://www.w3.org/2006/time#hasEnd ?ie)
  )
  =&gt;
  (if (&lt; ?ibt (slot-get http://.../sample.owl#q11767 http://www.w3.org/2006/time#inXSDDateTime))  
  then    
  (printout t "The interval " (instance-name ?oi) " has start time " ?ibt " and end time " ?iet crlf)
  )
  )
  </code></pre>
  
  <p>The following exception appears:</p>
  
  <pre><code>Jess reported an error in routine Value.javaObjectValue
  while executing (&lt;  ?ibt (slot-get http://.../sample.owl#q11767  http://www.w3.org/2006/time#inXSDDateTime))
  while executing (if (&lt; ?ibt  (slot-get http://.../sample.owl#q11767 
  http://www.w3.org/2006/time#inXSDDateTime))
  then (printout t "The interval "  (instance-name ?oi) " has start time " ?ibt " and end time " ?iet crlf))
  while executing defrule MAIN::checkIntervalStatus
  while executing (run).
    Message: '"~@http://www.w3.org/2001/XMLSchema#dateTime 2015-04-08T02:54:45.217"' is a list, not  a Java object.
   Program text: ( run )
   at  line 20.
  </code></pre>
  
  <p>I tried to parse the XMLSchema datetime into Java Datetime through:
  (new Date (slot-get <a href="http://.../sample.owl#q11767" rel="nofollow">http://.../sample.owl#q11767</a> <a href="http://www.w3.org/2006/time#inXSDDateTime" rel="nofollow">http://www.w3.org/2006/time#inXSDDateTime</a>)) 
  but got another exception:</p>
  
  <blockquote>
    <p>Message: Constructor not found: (new Date (slot-get
    <a href="http://.../sample.owl#q11767" rel="nofollow">http://.../sample.owl#q11767</a>
    <a href="http://www.w3.org/2006/time#inXSDDateTime" rel="nofollow">http://www.w3.org/2006/time#inXSDDateTime</a>)).   Program text: ( run ) 
    at line 22.
    Nested exception is: java.util.Date</p>
  </blockquote>