Martin,

It's roll of dice. SPARQL comparison of RDF literals of different types
is not specified, the exception is comparison of RDF literals of
different numeric types.

I intend to improve it, well, some day, but I should warn that it will
be in some distant future. Please cast values to some common type.

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com


On Tue, 2011-06-21 at 17:39 +0200, Martin Gerlach wrote:
> Hi,
> 
> is there any documentation on which date/time types can be safely used
> in comparisons?
> 
> I noticed that xsd:gYear and xsd:date do not work:
> 
> SELECT 
> ('2007'^^xsd:gYear < '2007-01-01'^^xsd:date)
> ('2007'^^xsd:gYear <= '2007-01-01'^^xsd:date)
> ('2007'^^xsd:gYear > '2007-01-01'^^xsd:date)
> ('2007'^^xsd:gYear >= '2007-01-01'^^xsd:date) 
> ('2006'^^xsd:gYear < '2007-01-01'^^xsd:date)
> ('2006'^^xsd:gYear <= '2007-01-01'^^xsd:date)
> ('2006'^^xsd:gYear > '2007-01-01'^^xsd:date)
> ('2006'^^xsd:gYear >= '2007-01-01'^^xsd:date) 
> ('2008'^^xsd:gYear < '2007-01-01'^^xsd:date)
> ('2008'^^xsd:gYear <= '2007-01-01'^^xsd:date)
> ('2008'^^xsd:gYear > '2007-01-01'^^xsd:date)
> ('2008'^^xsd:gYear >= '2007-01-01'^^xsd:date) 
> WHERE{
> }
> 
> shows that all comparisons using < or > yield 0, whereas all
> comparisons using <= or >= yield 1 regardless of the actual literal
> values. (Same if the lhs has xsd:date and the rhs xsd:gYear)
> 
> Thanks,
> Martin
> 
> -- 
> 
> ______________________________________________________________________
> 
> Martin Gerlach
> Senior Softwareentwickler
> Research
> 
> Neofonie GmbH
> Robert-Koch-Platz 4
> 10115 Berlin
> 
> T +49.30 24627 413
> F +49.30 24627 120
> [email protected]
> http://www.neofonie.de
> 
> Handelsregister
> Berlin-Charlottenburg: HRB 67460
> 
> Geschäftsführung
> Thomas Kitlitschko
> Dr. Mario Lenz
> 
> 
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________ Virtuoso-users mailing list 
> [email protected] 
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users



Reply via email to