title: SPARQL Problems filtering DateTimes
body: <p>I have some RDF data in a Virtuoso repository, and I am trying to filter results by xsd:dateTime. I have read many threads with similar issues ere and in other forums, but I cannot find the correct answer.</p>
  
  <p>Here is my data:</p>
  
  <p><a href="https://i.stack.imgur.com/3YjaB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3YjaB.png" alt="enter image description here"></a></p>
  
  <p>As can be seen, the <strong>?xsddt</strong> variable gets the xsd:dateTime value in a valid format (<a href="http://books.xmlschemata.org/relaxng/ch19-77049.html" rel="nofollow noreferrer">http://books.xmlschemata.org/relaxng/ch19-77049.html</a>). (I have also tried with other xsd.DateTime formats including time zones etc but it does not work).</p>
  
  <p>Here is the SPARQL query I am using:</p>
  
  <pre><code>PREFIX owl-time: &lt;http://www.w3.org/2006/time#&gt;
  PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; 
  select ?instant ?year ?xsddt
  FROM &lt;urn:calendarData&gt;
  WHERE {
    ?instant  owl-time:hasDateTimeDescription ?dtdesc.
    ?dtdesc owl-time:year ?year.
    ?dtdesc owl-time:inXSDDateTime ?xsddt.
   FILTER (?year = "2014" 
      &amp;&amp; ?xsddt &gt; "2014-02-01T00:00:00"^^xsd:dateTime)
  }
  </code></pre>
  
  <p><strong>?xsddt > "2014-02-01T00:00:00"^^xsd:dateTime</strong> is the part that is giving me problems.</p>
  
  <p>Any idea of how can I fix this problem and be able to filter results by dateTime??</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Data sample (sorry for the inconveniences):</p>
  
  <pre><code>&lt;rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:owl-time="http://www.w3.org/2006/time#"
  ...
    &lt;rdf:Description rdf:about="http://www.w3.org/2006/time#3/15/15_3"&gt;
      &lt;owl-time:hasDateTimeDescription rdf:parseType="Resource"&gt;
        &lt;owl-time:year&gt;2015&lt;/owl-time:year&gt;
        &lt;owl-time:month&gt;3&lt;/owl-time:month&gt;
        &lt;owl-time:dayOfYear&gt;74&lt;/owl-time:dayOfYear&gt;
        &lt;owl-time:week&gt;11&lt;/owl-time:week&gt;
        &lt;owl-time:dayOfWeek&gt;sunday&lt;/owl-time:dayOfWeek&gt;
        &lt;owl-time:day&gt;15&lt;/owl-time:day&gt;
        &lt;owl-time:unitType&gt;unitDay&lt;/owl-time:unitType&gt;
        &lt;owl-time:hour&gt;3&lt;/owl-time:hour&gt;
        &lt;owl-time:inXSDDateTime&gt;2015-03-15T03:00:00&lt;/owl-time:inXSDDateTime&gt;
  &lt;/owl-time:hasDateTimeDescription&gt;
  &lt;rdf:type&gt;http://www.w3.org/2006/time#Instant&lt;/rdf:type&gt;
  
  
   &lt;/rdf:Description&gt;
  </code></pre>