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

Reply via email to