I'm seeing fractional portions compare incorrectly.
According to XML Schema 1.0 xsd:dayTimeDuration - Complete documentation and samples I think this should work.
select ((?d1 > ?d2) as ?d1IsBigger) ((?d2 > ?d1) as ?d2IsBigger) ((?d1 + ?d2) as ?sum)
WHERE {
BIND("PT0.5123S"^^xsd:dayTimeDuration as ?d1 )
BIND("PT0.4321S"^^xsd:dayTimeDuration as ?d2 )
}
Notice in the results that both tests ?d1IsBigger and ?d2IsBigger report false. However the addition operation gives the expected result.
{
"head" : {
"vars" : [
"d1IsBigger",
"d2IsBigger",
"sum"
]
},
"results" : {
"bindings" : [
{
"d1IsBigger" : {
"datatype" : "http://www.w3.org/2001/XMLSchema#boolean",
"type" : "literal",
"value" : "false"
},
"d2IsBigger" : {
"datatype" : "http://www.w3.org/2001/XMLSchema#boolean",
"type" : "literal",
"value" : "false"
},
"sum" : {
"datatype" : "http://www.w3.org/2001/XMLSchema#dayTimeDuration",
"type" : "literal",
"value" : "PT0.9444S"
}
}
]
}
}