We hit this exact problem a while ago... Basically if no timezone is specified then it takes the max and min possible timezone difference, i.e. +14 hours and -14 hours, and for anything that falls within this block of time no comparison can be made.
The best solution is just to add the timezone information. However retrospectively adding timezone information is a challenge in it's own right! The lesson for us is to always use timezones. Rob Rob On Tue, Apr 8, 2014 at 10:21 AM, Andy Seaborne <[email protected]> wrote: > On 08/04/14 01:38, Holger Knublauch wrote: > >> Hi all, >> >> we noticed a change in behavior between the recent Jena versions. >> > > Between which versions? > > > >> SELECT * >> WHERE { >> BIND("2014-04-08T00:00:00"^^xsd:dateTime AS ?time0) . >> BIND("2014-04-08T00:00:00+10:00"^^xsd:dateTime AS ?time1) . >> BIND(xsd:date(?time0) AS ?date0) . >> BIND(xsd:date(?time1) AS ?date1) . >> BIND(?date0 > ?date1 AS ?compare) >> } >> >> With Jena 2.11 ?compare is unbound, indicating that it is impossible to >> compare times or dates that have a different time zone. >> > > "2014-04-08T00:00:00"^^xsd:dateTime does not have a timezone. > > No timezone is not the same as different timezone. > > > Is this the expected behavior? Shouldn't it in theory figure out the >> time zones itself (e.g. by aligning all to a universal time zone) >> instead of failing? >> > > See the XSD F&O spec for comparing dateTimes with and without timezones. > > 14 is a magic number. > > > What would be a work-around to do this "manually" for data that is >> stored in mixed time zones? >> > > Be careful. > > The problem is that the data publisher and the query engine (and indeed > the client asking the query) may be in different timezones so defaulting a > timezone does not make sense on the web. > > There is nothing special about Z. > > Andy > > PS Please use the [email protected] mailing list, not the incubator > one. > > >> Thanks >> Holger >> >> > -- Rob Walpole Email [email protected] Tel. +44 (0)7969 869881 Skype: RobertWalpolehttp://www.linkedin.com/in/robwalpole
