|
From: Rob V. <rv...@do...> - 2014-07-28 12:44:29
|
Tom The expected behaviour is that only dates that follow the XSD format (see http://www.w3.org/TR/xmlschema11-2/#date) should be supported. So for your example it should be "2014-04-20". Similarly for full date times only the XSD format (see http://www.w3.org/TR/xmlschema11-2/#dateTime) should be supported Likely we need to be much stricter about how we use DateTime.Parse/TryParse and DateTimeOffset.Parse/TryParse in the code base. I have a feeling we aren't supplying any culture information to those calls and so are allowing any date format that is valid in the current culture. Please go ahead and commit whatever changes are necessary to resolve this Rob On 25/07/2014 11:52, "Tomasz Pluskiewicz" <tom...@gm...> wrote: >Hi Rob > >We've just encountered an interesting case with parsing dates in >SPARQL queries. Initially I though it was dotNetRDF's fault, but in >the end it turned out I failed to notice we used invalid date format >and it worked while in Polish locale but failed on a German machine. > >What it reveals however is that dotNetRDF is forgiving in terms of ate >formatting. Our query used a date like "04/20/2014"^^xsd:date and >compared it to some dates in the graph. The comparison works in Polish >and English locale yielding expected results. Is the processor trying >to fall back to local settings if the date isn't a valid xsd format? > >If so it causes a weird state where invalid query can actually produce >false-positive results. Hence I think that we should be more strict >about date format. Or maybe it is a behaviour that SPARQL defines? > >Thanks, >Tom > >-------------------------------------------------------------------------- >---- >Want fast and easy access to all the code in your enterprise? Index and >search up to 200,000 lines of code with a free copy of Black Duck >Code Sight - the same software that powers the world's largest code >search on Ohloh, the Black Duck Open Hub! Try it now. >http://p.sf.net/sfu/bds >_______________________________________________ >dotNetRDF-develop mailing list >dot...@li... >https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop |