diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 80a9c1a..bf94c92 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -60,12 +60,22 @@ PREFIX xsd: # Backward arrow rule is like a function call. -# Removes time and timezone info in the returned date +# Removes time info in the returned date +# The user in DL selects a date via the UI. +# These dates are persisted as midnight dateTimes in UTC. +# Meaning that 1st of July is stored as +# "2022-06-30T22:00:00Z"^^xsd:dateTime +# and 1 December +# "2022-11-30T23:00:00Z"^^xsd:dateTime +# So, the following rule adds 2 hours to the datetime, and then takes the date part of the UTC date time +# to come to the date that the DL user selected (in CE(S)T) { ?dateTime :dateFromDateTime ?date } <= { (?dateTimeLiteral xsd:dateTime) log:dtlit ?dateTime. - (?dateTimeLiteral 0 11) func:substring ?dateLiteral. + (?dateTime "PT2H"^^xsd:dayTimeDuration) func:add-dayTimeDuration-to-dateTime ?localDateTime. + (?localDateTimeLiteral xsd:dateTime) log:dtlit ?localDateTime. + (?localDateTimeLiteral 0 11) func:substring ?dateLiteral. (?dateLiteral xsd:date) log:dtlit ?date. }.