From 54e381bfad96b373475ba724b40d5d4e4c5f9452 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 5 Dec 2023 11:58:54 +0100 Subject: [PATCH 01/17] converted-date-to-datetime --- ...1205094320-mandaat-date-to-datetime.sparql | 110 ++++++++++++++++++ config/resources/domain.json | 10 +- 2 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql diff --git a/config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql new file mode 100644 index 0000000..0db4d31 --- /dev/null +++ b/config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql @@ -0,0 +1,110 @@ +PREFIX mandaat: +PREFIX ch: +PREFIX ere: +PREFIX xsd: +DELETE { + GRAPH ?g { + ?s mandaat:start ?o . + } +} +INSERT { + GRAPH ?g { + ?s mandaat:start ?converteddate . + } +} +WHERE { + GRAPH ?g { + ?s mandaat:start ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). +} +; +DELETE { + GRAPH ?g { + ?s mandaat:einde ?o . + } + } + INSERT { + GRAPH ?g { + ?s mandaat:einde ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s mandaat:einde ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } + +; +DELETE { + GRAPH ?g { + ?s ch:startdatum ?o . + } +} +INSERT { + GRAPH ?g { + ?s ch:startdatum ?converteddate . + } +} +WHERE { + GRAPH ?g { + ?s ch:startdatum ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). +} +; +DELETE { + GRAPH ?g { + ?s ch:eindedatum ?o . + } + } + INSERT { + GRAPH ?g { + ?s ch:eindedatum ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s ch:eindedatum ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } +; + DELETE { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?o . + } + } + INSERT { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } + ; \ No newline at end of file diff --git a/config/resources/domain.json b/config/resources/domain.json index 7a33825..5c67e33 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -92,11 +92,11 @@ "super": ["agents"], "attributes": { "agent-start-date": { - "type": "date", + "type": "datetime", "predicate": "ch:startdatum" }, "agent-end-date": { - "type": "date", + "type": "datetime", "predicate": "ch:eindedatum" } }, @@ -140,11 +140,11 @@ "super": ["agents-in-position"], "attributes": { "start-date": { - "type": "date", + "type": "datetime", "predicate": "mandaat:start" }, "end-date": { - "type": "date", + "type": "datetime", "predicate": "mandaat:einde" } }, @@ -188,7 +188,7 @@ "super": ["mandatories"], "attributes": { "expected-end-date": { - "type": "date", + "type": "datetime", "predicate": "ere:geplandeEinddatumAanstelling" }, "reason-stopped": { From 663c975725e718c8e82df17bf35625070fd1863c Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 19 Dec 2023 10:50:50 +0100 Subject: [PATCH 02/17] removed datetime to date conversions from reasoner --- config/reasoner/dl2op/main-info/mapping.n3 | 28 ------------ config/reasoner/dl2op/main/mapping.n3 | 53 ---------------------- 2 files changed, 81 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index ec1a9a1..4d7158b 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -68,34 +68,6 @@ PREFIX ere: }. # Test -# ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:start ?startDateTime. - # use backward arrow rule defined below - ?startDateTime :dateFromDateTime ?startDate. - { - ?s mandaat:start ?startDateTime - } e:becomes { - ?s mandaat:start ?startDate - }. -} => { - ?s mandaat:start ?startDate -}. - -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:einde ?eindeDateTime. - # use backward arrow rule defined below - ?eindeDateTime :dateFromDateTime ?eindeDate. - { - ?s mandaat:einde ?eindeDateTime - } e:becomes { - ?s mandaat:einde ?eindeDate - }. -} => { - ?s mandaat:einde ?eindeDate -}. - # Backward arrow rule is like a function call. # Removes time info in the returned date diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 0f79ceb..f280bf8 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -67,59 +67,6 @@ PREFIX lblodlg: }. # Test -# ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:start ?startDateTime. - # use backward arrow rule defined below - ?startDateTime :dateFromDateTime ?startDate. - { - ?s mandaat:start ?startDateTime - } e:becomes { - ?s mandaat:start ?startDate - }. -} => { - ?s mandaat:start ?startDate -}. - -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:einde ?eindeDateTime. - # use backward arrow rule defined below - ?eindeDateTime :dateFromDateTime ?eindeDate. - { - ?s mandaat:einde ?eindeDateTime - } e:becomes { - ?s mandaat:einde ?eindeDate - }. -} => { - ?s mandaat:einde ?eindeDate -}. - -{ - ?s mandaat:bindingStart ?bindingStartDateTime. - # use backward arrow rule defined below - ?bindingStartDateTime :dateFromDateTime ?bindingStartDate. - { - ?s mandaat:bindingStart ?bindingStartDateTime - } e:becomes { - ?s mandaat:bindingStart ?bindingStartDate - }. -} => { - ?s mandaat:bindingStart ?bindingStartDate -}. - -{ - ?s mandaat:bindingEinde ?bindingEindeDateTime. - # use backward arrow rule defined below - ?bindingEindeDateTime :dateFromDateTime ?bindingEindeDate. - { - ?s mandaat:bindingEinde ?bindingEindeDateTime - } e:becomes { - ?s mandaat:bindingEinde ?bindingEindeDate - }. -} => { - ?s mandaat:bindingEinde ?bindingEindeDate -}. # Backward arrow rule is like a function call. # Removes time info in the returned date From 329e87f0ebad9cc58b969cc70d2525d912c64868 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 5 Dec 2023 11:58:54 +0100 Subject: [PATCH 03/17] converted-date-to-datetime --- ...1205094320-mandaat-date-to-datetime.sparql | 110 ++++++++++++++++++ config/resources/domain.json | 10 +- 2 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql diff --git a/config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql new file mode 100644 index 0000000..0db4d31 --- /dev/null +++ b/config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql @@ -0,0 +1,110 @@ +PREFIX mandaat: +PREFIX ch: +PREFIX ere: +PREFIX xsd: +DELETE { + GRAPH ?g { + ?s mandaat:start ?o . + } +} +INSERT { + GRAPH ?g { + ?s mandaat:start ?converteddate . + } +} +WHERE { + GRAPH ?g { + ?s mandaat:start ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). +} +; +DELETE { + GRAPH ?g { + ?s mandaat:einde ?o . + } + } + INSERT { + GRAPH ?g { + ?s mandaat:einde ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s mandaat:einde ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } + +; +DELETE { + GRAPH ?g { + ?s ch:startdatum ?o . + } +} +INSERT { + GRAPH ?g { + ?s ch:startdatum ?converteddate . + } +} +WHERE { + GRAPH ?g { + ?s ch:startdatum ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). +} +; +DELETE { + GRAPH ?g { + ?s ch:eindedatum ?o . + } + } + INSERT { + GRAPH ?g { + ?s ch:eindedatum ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s ch:eindedatum ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } +; + DELETE { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?o . + } + } + INSERT { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } + ; \ No newline at end of file diff --git a/config/resources/domain.json b/config/resources/domain.json index 7a33825..5c67e33 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -92,11 +92,11 @@ "super": ["agents"], "attributes": { "agent-start-date": { - "type": "date", + "type": "datetime", "predicate": "ch:startdatum" }, "agent-end-date": { - "type": "date", + "type": "datetime", "predicate": "ch:eindedatum" } }, @@ -140,11 +140,11 @@ "super": ["agents-in-position"], "attributes": { "start-date": { - "type": "date", + "type": "datetime", "predicate": "mandaat:start" }, "end-date": { - "type": "date", + "type": "datetime", "predicate": "mandaat:einde" } }, @@ -188,7 +188,7 @@ "super": ["mandatories"], "attributes": { "expected-end-date": { - "type": "date", + "type": "datetime", "predicate": "ere:geplandeEinddatumAanstelling" }, "reason-stopped": { From 70e79734df5453c7b074380d9060edec496b999b Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 19 Dec 2023 10:50:50 +0100 Subject: [PATCH 04/17] removed datetime to date conversions from reasoner --- config/reasoner/dl2op/main-info/mapping.n3 | 28 ------------ config/reasoner/dl2op/main/mapping.n3 | 53 ---------------------- 2 files changed, 81 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index ec1a9a1..4d7158b 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -68,34 +68,6 @@ PREFIX ere: }. # Test -# ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:start ?startDateTime. - # use backward arrow rule defined below - ?startDateTime :dateFromDateTime ?startDate. - { - ?s mandaat:start ?startDateTime - } e:becomes { - ?s mandaat:start ?startDate - }. -} => { - ?s mandaat:start ?startDate -}. - -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:einde ?eindeDateTime. - # use backward arrow rule defined below - ?eindeDateTime :dateFromDateTime ?eindeDate. - { - ?s mandaat:einde ?eindeDateTime - } e:becomes { - ?s mandaat:einde ?eindeDate - }. -} => { - ?s mandaat:einde ?eindeDate -}. - # Backward arrow rule is like a function call. # Removes time info in the returned date diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 0f79ceb..f280bf8 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -67,59 +67,6 @@ PREFIX lblodlg: }. # Test -# ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:start ?startDateTime. - # use backward arrow rule defined below - ?startDateTime :dateFromDateTime ?startDate. - { - ?s mandaat:start ?startDateTime - } e:becomes { - ?s mandaat:start ?startDate - }. -} => { - ?s mandaat:start ?startDate -}. - -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:einde ?eindeDateTime. - # use backward arrow rule defined below - ?eindeDateTime :dateFromDateTime ?eindeDate. - { - ?s mandaat:einde ?eindeDateTime - } e:becomes { - ?s mandaat:einde ?eindeDate - }. -} => { - ?s mandaat:einde ?eindeDate -}. - -{ - ?s mandaat:bindingStart ?bindingStartDateTime. - # use backward arrow rule defined below - ?bindingStartDateTime :dateFromDateTime ?bindingStartDate. - { - ?s mandaat:bindingStart ?bindingStartDateTime - } e:becomes { - ?s mandaat:bindingStart ?bindingStartDate - }. -} => { - ?s mandaat:bindingStart ?bindingStartDate -}. - -{ - ?s mandaat:bindingEinde ?bindingEindeDateTime. - # use backward arrow rule defined below - ?bindingEindeDateTime :dateFromDateTime ?bindingEindeDate. - { - ?s mandaat:bindingEinde ?bindingEindeDateTime - } e:becomes { - ?s mandaat:bindingEinde ?bindingEindeDate - }. -} => { - ?s mandaat:bindingEinde ?bindingEindeDate -}. # Backward arrow rule is like a function call. # Removes time info in the returned date From e8061f6a0bf173b77deabff790d5500ac17504f1 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 19 Dec 2023 11:01:02 +0100 Subject: [PATCH 05/17] commit --- ...1205094322-mandaat-date-to-datetime.sparql | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql diff --git a/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql new file mode 100644 index 0000000..0db4d31 --- /dev/null +++ b/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql @@ -0,0 +1,110 @@ +PREFIX mandaat: +PREFIX ch: +PREFIX ere: +PREFIX xsd: +DELETE { + GRAPH ?g { + ?s mandaat:start ?o . + } +} +INSERT { + GRAPH ?g { + ?s mandaat:start ?converteddate . + } +} +WHERE { + GRAPH ?g { + ?s mandaat:start ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). +} +; +DELETE { + GRAPH ?g { + ?s mandaat:einde ?o . + } + } + INSERT { + GRAPH ?g { + ?s mandaat:einde ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s mandaat:einde ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } + +; +DELETE { + GRAPH ?g { + ?s ch:startdatum ?o . + } +} +INSERT { + GRAPH ?g { + ?s ch:startdatum ?converteddate . + } +} +WHERE { + GRAPH ?g { + ?s ch:startdatum ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). +} +; +DELETE { + GRAPH ?g { + ?s ch:eindedatum ?o . + } + } + INSERT { + GRAPH ?g { + ?s ch:eindedatum ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s ch:eindedatum ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } +; + DELETE { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?o . + } + } + INSERT { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s ere:geplandeEinddatumAanstelling ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } + ; \ No newline at end of file From 11105113a9e184ff64b08e9ad44ed361716bf678 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Fri, 22 Dec 2023 10:46:37 +0100 Subject: [PATCH 06/17] added backwards arrow rule to reasoner --- ...1205094322-mandaat-date-to-datetime.sparql | 110 ------------------ ...205094323-mandaat-date-to-datetime.sparql} | 0 config/reasoner/dl2op/main-info/mapping.n3 | 89 +++++++++++++- config/reasoner/dl2op/main/mapping.n3 | 88 ++++++++++++++ 4 files changed, 176 insertions(+), 111 deletions(-) delete mode 100644 config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql rename config/migrations/2023/{20231205094320-mandaat-date-to-datetime.sparql => 20231205094323-mandaat-date-to-datetime.sparql} (100%) diff --git a/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql deleted file mode 100644 index 0db4d31..0000000 --- a/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql +++ /dev/null @@ -1,110 +0,0 @@ -PREFIX mandaat: -PREFIX ch: -PREFIX ere: -PREFIX xsd: -DELETE { - GRAPH ?g { - ?s mandaat:start ?o . - } -} -INSERT { - GRAPH ?g { - ?s mandaat:start ?converteddate . - } -} -WHERE { - GRAPH ?g { - ?s mandaat:start ?o . - } - VALUES ?g { - - - } - BIND(xsd:dateTime(?o) AS ?converteddate). -} -; -DELETE { - GRAPH ?g { - ?s mandaat:einde ?o . - } - } - INSERT { - GRAPH ?g { - ?s mandaat:einde ?converteddate . - } - } - WHERE { - GRAPH ?g { - ?s mandaat:einde ?o . - } - VALUES ?g { - - - } - BIND(xsd:dateTime(?o) AS ?converteddate). - } - -; -DELETE { - GRAPH ?g { - ?s ch:startdatum ?o . - } -} -INSERT { - GRAPH ?g { - ?s ch:startdatum ?converteddate . - } -} -WHERE { - GRAPH ?g { - ?s ch:startdatum ?o . - } - VALUES ?g { - - - } - BIND(xsd:dateTime(?o) AS ?converteddate). -} -; -DELETE { - GRAPH ?g { - ?s ch:eindedatum ?o . - } - } - INSERT { - GRAPH ?g { - ?s ch:eindedatum ?converteddate . - } - } - WHERE { - GRAPH ?g { - ?s ch:eindedatum ?o . - } - VALUES ?g { - - - } - BIND(xsd:dateTime(?o) AS ?converteddate). - } -; - DELETE { - GRAPH ?g { - ?s ere:geplandeEinddatumAanstelling ?o . - } - } - INSERT { - GRAPH ?g { - ?s ere:geplandeEinddatumAanstelling ?converteddate . - } - } - WHERE { - GRAPH ?g { - ?s ere:geplandeEinddatumAanstelling ?o . - } - VALUES ?g { - - - } - BIND(xsd:dateTime(?o) AS ?converteddate). - } - ; \ No newline at end of file diff --git a/config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094323-mandaat-date-to-datetime.sparql similarity index 100% rename from config/migrations/2023/20231205094320-mandaat-date-to-datetime.sparql rename to config/migrations/2023/20231205094323-mandaat-date-to-datetime.sparql diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index 4d7158b..201724c 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -68,6 +68,84 @@ PREFIX ere: }. # Test +# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. +{ + ?s mandaat:einde ?eindeDateTime. + # use backward arrow rule defined below + ?eindeDateTime :dateFromDateTime ?eindeDate. + { + ?s mandaat:einde ?eindeDateTime + } e:becomes { + ?s mandaat:einde ?eindeDate + }. +} => { + ?s mandaat:einde ?eindeDate +}. + +{ + ?s mandaat:bindingStart ?bindingStartDateTime. + # use backward arrow rule defined below + ?bindingStartDateTime :dateFromDateTime ?bindingStartDate. + { + ?s mandaat:bindingStart ?bindingStartDateTime + } e:becomes { + ?s mandaat:bindingStart ?bindingStartDate + }. +} => { + ?s mandaat:bindingStart ?bindingStartDate +}. + +{ + ?s mandaat:bindingEinde ?bindingEindeDateTime. + # use backward arrow rule defined below + ?bindingEindeDateTime :dateFromDateTime ?bindingEindeDate. + { + ?s mandaat:bindingEinde ?bindingEindeDateTime + } e:becomes { + ?s mandaat:bindingEinde ?bindingEindeDate + }. +} => { + ?s mandaat:bindingEinde ?bindingEindeDate +}. + +{ + ?s ch:startdatum ?startDate. + # use backward arrow rule defined below + ?startDate :dateFromDateTime ?startDateTime. + { + ?s ch:startdatum ?startDate + } e:becomes { + ?s ch:startdatum ?startDateTime + }. +} => { + ?s ch:startdatum ?startDateTime +}. + +{ + ?s ch:eindedatum ?startDDate. + # use backward arrow rule defined below + ?startDate :dateFromDateTime ?startDateTime. + { + ?s ch:eindedatum ?startDate + } e:becomes { + ?s ch:eindedatum ?startDateTime + }. +} => { + ?s ch:eindedatum ?startDateTime +}. + +{ + ?s ere:geplandeEinddatumAanstelling ?startDDate. + # use backward arrow rule defined below + ?startDate :dateFromDateTime ?startDateTime. + { + ?s ere:geplandeEinddatumAanstelling ?startDate + } e:becomes { + ?s ere:geplandeEinddatumAanstelling ?startDateTime + }. +} => { + ?s ere:geplandeEinddatumAanstelling ?startDateTime +}. # Backward arrow rule is like a function call. # Removes time info in the returned date @@ -85,10 +163,19 @@ PREFIX ere: (?dateTimeLiteral xsd:dateTime) log:dtlit ?dateTime. (?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. }. +#backwards arrow rule for converting date to datetime +{ + ?date :dateTimeFromDate ?dateTime +} <= { + ?date string:notMatches """^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).*""" . + (?date "T00:00:00") string:concatenation ?datePlusTime. + (?datePlusTime xsd:dateTime) log:dtlit ?dateTime +}. + + # ex:orgA besluit:classificatie . { diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index f280bf8..2b506ca 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -67,6 +67,85 @@ PREFIX lblodlg: }. # Test +# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. +{ + ?s mandaat:einde ?eindeDateTime. + # use backward arrow rule defined below + ?eindeDateTime :dateFromDateTime ?eindeDate. + { + ?s mandaat:einde ?eindeDateTime + } e:becomes { + ?s mandaat:einde ?eindeDate + }. +} => { + ?s mandaat:einde ?eindeDate +}. + +{ + ?s mandaat:bindingStart ?bindingStartDateTime. + # use backward arrow rule defined below + ?bindingStartDateTime :dateFromDateTime ?bindingStartDate. + { + ?s mandaat:bindingStart ?bindingStartDateTime + } e:becomes { + ?s mandaat:bindingStart ?bindingStartDate + }. +} => { + ?s mandaat:bindingStart ?bindingStartDate +}. + +{ + ?s mandaat:bindingEinde ?bindingEindeDateTime. + # use backward arrow rule defined below + ?bindingEindeDateTime :dateFromDateTime ?bindingEindeDate. + { + ?s mandaat:bindingEinde ?bindingEindeDateTime + } e:becomes { + ?s mandaat:bindingEinde ?bindingEindeDate + }. +} => { + ?s mandaat:bindingEinde ?bindingEindeDate +}. + +{ + ?s ch:startdatum ?startDate. + # use backward arrow rule defined below + ?startDate :dateFromDateTime ?startDateTime. + { + ?s ch:startdatum ?startDate + } e:becomes { + ?s ch:startdatum ?startDateTime + }. +} => { + ?s ch:startdatum ?startDateTime +}. + +{ + ?s ch:eindedatum ?startDDate. + # use backward arrow rule defined below + ?startDate :dateFromDateTime ?startDateTime. + { + ?s ch:eindedatum ?startDate + } e:becomes { + ?s ch:eindedatum ?startDateTime + }. +} => { + ?s ch:eindedatum ?startDateTime +}. + +{ + ?s ere:geplandeEinddatumAanstelling ?startDDate. + # use backward arrow rule defined below + ?startDate :dateFromDateTime ?startDateTime. + { + ?s ere:geplandeEinddatumAanstelling ?startDate + } e:becomes { + ?s ere:geplandeEinddatumAanstelling ?startDateTime + }. +} => { + ?s ere:geplandeEinddatumAanstelling ?startDateTime +}. + # Backward arrow rule is like a function call. # Removes time info in the returned date @@ -88,6 +167,15 @@ PREFIX lblodlg: (?dateLiteral xsd:date) log:dtlit ?date. }. +#backwards arrow rule for converting date to datetime +{ + ?date :dateTimeFromDate ?dateTime +} <= { + ?date string:notMatches """^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).*""" . + (?date "T00:00:00") string:concatenation ?datePlusTime. + (?datePlusTime xsd:dateTime) log:dtlit ?dateTime +}. + # ex:orgA besluit:classificatie . { From 6fae30d24596990e9d966b5a67c4eae1ea836c0c Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 2 Jan 2024 12:18:16 +0100 Subject: [PATCH 07/17] fixed typo --- config/reasoner/dl2op/main/mapping.n3 | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 2b506ca..33ec1bf 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -71,7 +71,7 @@ PREFIX lblodlg: { ?s mandaat:einde ?eindeDateTime. # use backward arrow rule defined below - ?eindeDateTime :dateFromDateTime ?eindeDate. + ?eindeDateTime :dateTimeFromDate ?eindeDate. { ?s mandaat:einde ?eindeDateTime } e:becomes { @@ -110,7 +110,7 @@ PREFIX lblodlg: { ?s ch:startdatum ?startDate. # use backward arrow rule defined below - ?startDate :dateFromDateTime ?startDateTime. + ?startDate :dateTimeFromDate ?startDateTime. { ?s ch:startdatum ?startDate } e:becomes { @@ -121,9 +121,9 @@ PREFIX lblodlg: }. { - ?s ch:eindedatum ?startDDate. + ?s ch:eindedatum ?startDate. # use backward arrow rule defined below - ?startDate :dateFromDateTime ?startDateTime. + ?startDate :dateTimeFromDate ?startDateTime. { ?s ch:eindedatum ?startDate } e:becomes { @@ -133,19 +133,6 @@ PREFIX lblodlg: ?s ch:eindedatum ?startDateTime }. -{ - ?s ere:geplandeEinddatumAanstelling ?startDDate. - # use backward arrow rule defined below - ?startDate :dateFromDateTime ?startDateTime. - { - ?s ere:geplandeEinddatumAanstelling ?startDate - } e:becomes { - ?s ere:geplandeEinddatumAanstelling ?startDateTime - }. -} => { - ?s ere:geplandeEinddatumAanstelling ?startDateTime -}. - # Backward arrow rule is like a function call. # Removes time info in the returned date From 76784840a444306927127a7689f721d4b77764fe Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Thu, 4 Jan 2024 16:21:01 +0100 Subject: [PATCH 08/17] removed rule for mandaat because it's already datetime --- config/reasoner/dl2op/main-info/mapping.n3 | 17 ++--------------- config/reasoner/dl2op/main/mapping.n3 | 13 ------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index 201724c..cc473d4 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -69,19 +69,6 @@ PREFIX ere: # Test # ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:einde ?eindeDateTime. - # use backward arrow rule defined below - ?eindeDateTime :dateFromDateTime ?eindeDate. - { - ?s mandaat:einde ?eindeDateTime - } e:becomes { - ?s mandaat:einde ?eindeDate - }. -} => { - ?s mandaat:einde ?eindeDate -}. - { ?s mandaat:bindingStart ?bindingStartDateTime. # use backward arrow rule defined below @@ -122,7 +109,7 @@ PREFIX ere: }. { - ?s ch:eindedatum ?startDDate. + ?s ch:eindedatum ?startDate. # use backward arrow rule defined below ?startDate :dateFromDateTime ?startDateTime. { @@ -135,7 +122,7 @@ PREFIX ere: }. { - ?s ere:geplandeEinddatumAanstelling ?startDDate. + ?s ere:geplandeEinddatumAanstelling ?startDate. # use backward arrow rule defined below ?startDate :dateFromDateTime ?startDateTime. { diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 33ec1bf..71b7a4a 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -68,19 +68,6 @@ PREFIX lblodlg: # Test # ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:einde ?eindeDateTime. - # use backward arrow rule defined below - ?eindeDateTime :dateTimeFromDate ?eindeDate. - { - ?s mandaat:einde ?eindeDateTime - } e:becomes { - ?s mandaat:einde ?eindeDate - }. -} => { - ?s mandaat:einde ?eindeDate -}. - { ?s mandaat:bindingStart ?bindingStartDateTime. # use backward arrow rule defined below From a53f0d3f30a4e206dfa0dafdcb26186c84c135f6 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 9 Jan 2024 11:35:42 +0100 Subject: [PATCH 09/17] fixed copy paste errors... --- ...205094322-mandaat-date-to-datetime.sparql} | 0 config/reasoner/dl2op/main-info/mapping.n3 | 22 +++++++++---------- config/reasoner/dl2op/main/mapping.n3 | 10 ++++----- 3 files changed, 16 insertions(+), 16 deletions(-) rename config/migrations/2023/{20231205094323-mandaat-date-to-datetime.sparql => 20231205094322-mandaat-date-to-datetime.sparql} (100%) diff --git a/config/migrations/2023/20231205094323-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql similarity index 100% rename from config/migrations/2023/20231205094323-mandaat-date-to-datetime.sparql rename to config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index cc473d4..a22239e 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -98,7 +98,7 @@ PREFIX ere: { ?s ch:startdatum ?startDate. # use backward arrow rule defined below - ?startDate :dateFromDateTime ?startDateTime. + ?startDate :dateTimeFromDate ?startDateTime. { ?s ch:startdatum ?startDate } e:becomes { @@ -109,29 +109,29 @@ PREFIX ere: }. { - ?s ch:eindedatum ?startDate. + ?s ch:eindedatum ?endDate. # use backward arrow rule defined below - ?startDate :dateFromDateTime ?startDateTime. + ?endDate :dateTimeFromDate ?endDateTime. { - ?s ch:eindedatum ?startDate + ?s ch:eindedatum ?endDate } e:becomes { - ?s ch:eindedatum ?startDateTime + ?s ch:eindedatum ?endDateTime }. } => { - ?s ch:eindedatum ?startDateTime + ?s ch:eindedatum ?endDateTime }. { - ?s ere:geplandeEinddatumAanstelling ?startDate. + ?s ere:geplandeEinddatumAanstelling ?endDate. # use backward arrow rule defined below - ?startDate :dateFromDateTime ?startDateTime. + ?endDate :dateTimeFromDate ?endDateTime. { - ?s ere:geplandeEinddatumAanstelling ?startDate + ?s ere:geplandeEinddatumAanstelling ?endDate } e:becomes { - ?s ere:geplandeEinddatumAanstelling ?startDateTime + ?s ere:geplandeEinddatumAanstelling ?endDateTime }. } => { - ?s ere:geplandeEinddatumAanstelling ?startDateTime + ?s ere:geplandeEinddatumAanstelling ?endDateTime }. # Backward arrow rule is like a function call. diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 71b7a4a..8aacb8d 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -108,16 +108,16 @@ PREFIX lblodlg: }. { - ?s ch:eindedatum ?startDate. + ?s ch:eindedatum ?endDate. # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. + ?endDate :dateTimeFromDate ?endDateTime. { - ?s ch:eindedatum ?startDate + ?s ch:eindedatum ?endDate } e:becomes { - ?s ch:eindedatum ?startDateTime + ?s ch:eindedatum ?endDateTime }. } => { - ?s ch:eindedatum ?startDateTime + ?s ch:eindedatum ?endDateTime }. From 97c1929346d4286d6c60c7c60a83116fb7c56969 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Wed, 10 Jan 2024 14:48:10 +0100 Subject: [PATCH 10/17] re;oved bindingstart and eindedatum from mapping + added conversions to migrations --- ...205094325-mandaat-date-to-datetime.sparql} | 43 ++++++++++++++++++- config/reasoner/dl2op/main-info/mapping.n3 | 28 ------------ config/reasoner/dl2op/main/mapping.n3 | 25 ----------- 3 files changed, 42 insertions(+), 54 deletions(-) rename config/migrations/2023/{20231205094322-mandaat-date-to-datetime.sparql => 20231205094325-mandaat-date-to-datetime.sparql} (72%) diff --git a/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094325-mandaat-date-to-datetime.sparql similarity index 72% rename from config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql rename to config/migrations/2023/20231205094325-mandaat-date-to-datetime.sparql index 0db4d31..0b7c557 100644 --- a/config/migrations/2023/20231205094322-mandaat-date-to-datetime.sparql +++ b/config/migrations/2023/20231205094325-mandaat-date-to-datetime.sparql @@ -43,7 +43,48 @@ DELETE { } BIND(xsd:dateTime(?o) AS ?converteddate). } - +; +DELETE { + GRAPH ?g { + ?s mandaat:bindingStart ?o . + } + } + INSERT { + GRAPH ?g { + ?s mandaat:bindingStart ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s mandaat:bindingStart ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } +; +DELETE { + GRAPH ?g { + ?s mandaat:bindingEinde ?o . + } + } + INSERT { + GRAPH ?g { + ?s mandaat:bindingEinde ?converteddate . + } + } + WHERE { + GRAPH ?g { + ?s mandaat:bindingEinde ?o . + } + VALUES ?g { + + + } + BIND(xsd:dateTime(?o) AS ?converteddate). + } ; DELETE { GRAPH ?g { diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index a22239e..088e0bf 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -67,34 +67,6 @@ PREFIX ere: ?s persoon:gebruikteVoornaam ?o }. -# Test -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:bindingStart ?bindingStartDateTime. - # use backward arrow rule defined below - ?bindingStartDateTime :dateFromDateTime ?bindingStartDate. - { - ?s mandaat:bindingStart ?bindingStartDateTime - } e:becomes { - ?s mandaat:bindingStart ?bindingStartDate - }. -} => { - ?s mandaat:bindingStart ?bindingStartDate -}. - -{ - ?s mandaat:bindingEinde ?bindingEindeDateTime. - # use backward arrow rule defined below - ?bindingEindeDateTime :dateFromDateTime ?bindingEindeDate. - { - ?s mandaat:bindingEinde ?bindingEindeDateTime - } e:becomes { - ?s mandaat:bindingEinde ?bindingEindeDate - }. -} => { - ?s mandaat:bindingEinde ?bindingEindeDate -}. - { ?s ch:startdatum ?startDate. # use backward arrow rule defined below diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 8aacb8d..89ca847 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -68,31 +68,6 @@ PREFIX lblodlg: # Test # ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:bindingStart ?bindingStartDateTime. - # use backward arrow rule defined below - ?bindingStartDateTime :dateFromDateTime ?bindingStartDate. - { - ?s mandaat:bindingStart ?bindingStartDateTime - } e:becomes { - ?s mandaat:bindingStart ?bindingStartDate - }. -} => { - ?s mandaat:bindingStart ?bindingStartDate -}. - -{ - ?s mandaat:bindingEinde ?bindingEindeDateTime. - # use backward arrow rule defined below - ?bindingEindeDateTime :dateFromDateTime ?bindingEindeDate. - { - ?s mandaat:bindingEinde ?bindingEindeDateTime - } e:becomes { - ?s mandaat:bindingEinde ?bindingEindeDate - }. -} => { - ?s mandaat:bindingEinde ?bindingEindeDate -}. { ?s ch:startdatum ?startDate. From e414a9e0868acedd312c692e33cc00ee06f91fc2 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Thu, 18 Jan 2024 14:59:14 +0100 Subject: [PATCH 11/17] replaced orignal backwards arrowrule with new rule --- config/reasoner/dl2op/main-info/mapping.n3 | 41 ++++++++++++++++------ config/reasoner/dl2op/main/mapping.n3 | 40 ++++++++++++++------- 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index 088e0bf..36c4585 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -67,6 +67,35 @@ PREFIX ere: ?s persoon:gebruikteVoornaam ?o }. + +# Test +# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. +{ + ?s mandaat:bindingeinde ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:bindingeinde ?eindeDate + } e:becomes { + ?s mandaat:bindingeinde ?eindeDateTime + }. +} => { + ?s mandaat:bindingeinde ?eindeDateTime +}. + + +{ + ?s mandaat:bindingstart ?startDate. + # use backward arrow rule defined below + ?startDate :dateTimeFromDate ?startDateTime. + { + ?s mandaat:bindingstart ?startDate + } e:becomes { + ?s mandaat:bindingstart ?startDateTime + }. +} => { + ?s mandaat:bindingstart ?startDateTime +}. { ?s ch:startdatum ?startDate. # use backward arrow rule defined below @@ -119,17 +148,7 @@ PREFIX ere: { ?dateTime :dateFromDateTime ?date } <= { - (?dateTimeLiteral xsd:dateTime) log:dtlit ?dateTime. - (?dateTime "PT2H"^^xsd:dayTimeDuration) func:add-dayTimeDuration-to-dateTime ?localDateTime. - (?localDateTimeLiteral xsd:dateTime) log:dtlit ?localDateTime. - (?dateLiteral xsd:date) log:dtlit ?date. -}. - -#backwards arrow rule for converting date to datetime -{ - ?date :dateTimeFromDate ?dateTime -} <= { - ?date string:notMatches """^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).*""" . + ?date string:notMatches """^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).*""" . (?date "T00:00:00") string:concatenation ?datePlusTime. (?datePlusTime xsd:dateTime) log:dtlit ?dateTime }. diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 89ca847..310f9c1 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -68,6 +68,32 @@ PREFIX lblodlg: # Test # ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. +{ + ?s mandaat:bindingeinde ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:bindingeinde ?eindeDate + } e:becomes { + ?s mandaat:bindingeinde ?eindeDateTime + }. +} => { + ?s mandaat:bindingeinde ?eindeDateTime +}. + + +{ + ?s mandaat:bindingstart ?startDate. + # use backward arrow rule defined below + ?startDate :dateTimeFromDate ?startDateTime. + { + ?s mandaat:bindingstart ?startDate + } e:becomes { + ?s mandaat:bindingstart ?startDateTime + }. +} => { + ?s mandaat:bindingstart ?startDateTime +}. { ?s ch:startdatum ?startDate. @@ -107,25 +133,13 @@ PREFIX lblodlg: # 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. - (?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. -}. - -#backwards arrow rule for converting date to datetime -{ - ?date :dateTimeFromDate ?dateTime + ?dateTime :dateTimeFromDate ?date } <= { ?date string:notMatches """^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).*""" . (?date "T00:00:00") string:concatenation ?datePlusTime. (?datePlusTime xsd:dateTime) log:dtlit ?dateTime }. - # ex:orgA besluit:classificatie . { { From 3bef65188ceac7e73e015a5985dc1d5a40e84431 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Thu, 18 Jan 2024 15:05:33 +0100 Subject: [PATCH 12/17] fixed migration accordingly due to bug in virtuoso --- ...20231205094344-mandaat-date-to-datetime.sparql} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename config/migrations/2023/{20231205094325-mandaat-date-to-datetime.sparql => 20231205094344-mandaat-date-to-datetime.sparql} (76%) diff --git a/config/migrations/2023/20231205094325-mandaat-date-to-datetime.sparql b/config/migrations/2023/20231205094344-mandaat-date-to-datetime.sparql similarity index 76% rename from config/migrations/2023/20231205094325-mandaat-date-to-datetime.sparql rename to config/migrations/2023/20231205094344-mandaat-date-to-datetime.sparql index 0b7c557..6e81b83 100644 --- a/config/migrations/2023/20231205094325-mandaat-date-to-datetime.sparql +++ b/config/migrations/2023/20231205094344-mandaat-date-to-datetime.sparql @@ -20,7 +20,7 @@ WHERE { } - BIND(xsd:dateTime(?o) AS ?converteddate). + BIND(IF(strlen(str(?o)) = 10, strdt(concat(str(?o), 'T02:00:00'), xsd:dateTime), ?o) as ?converteddate). } ; DELETE { @@ -41,7 +41,7 @@ DELETE { } - BIND(xsd:dateTime(?o) AS ?converteddate). + BIND(IF(strlen(str(?o)) = 10, strdt(concat(str(?o), 'T02:00:00'), xsd:dateTime), ?o) as ?converteddate). } ; DELETE { @@ -62,7 +62,7 @@ DELETE { } - BIND(xsd:dateTime(?o) AS ?converteddate). + BIND(IF(strlen(str(?o)) = 10, strdt(concat(str(?o), 'T02:00:00'), xsd:dateTime), ?o) as ?converteddate). } ; DELETE { @@ -83,7 +83,7 @@ DELETE { } - BIND(xsd:dateTime(?o) AS ?converteddate). + BIND(IF(strlen(str(?o)) = 10, strdt(concat(str(?o), 'T02:00:00'), xsd:dateTime), ?o) as ?converteddate). } ; DELETE { @@ -104,7 +104,7 @@ WHERE { } - BIND(xsd:dateTime(?o) AS ?converteddate). + BIND(IF(strlen(str(?o)) = 10, strdt(concat(str(?o), 'T02:00:00'), xsd:dateTime), ?o) as ?converteddate). } ; DELETE { @@ -125,7 +125,7 @@ DELETE { } - BIND(xsd:dateTime(?o) AS ?converteddate). + BIND(IF(strlen(str(?o)) = 10, strdt(concat(str(?o), 'T02:00:00'), xsd:dateTime), ?o) as ?converteddate). } ; DELETE { @@ -146,6 +146,6 @@ DELETE { } - BIND(xsd:dateTime(?o) AS ?converteddate). + BIND(IF(strlen(str(?o)) = 10, strdt(concat(str(?o), 'T02:00:00'), xsd:dateTime), ?o) as ?converteddate). } ; \ No newline at end of file From e80d231f358f45e5f71ab0a26054b0c7de0cbe28 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Wed, 13 Mar 2024 18:36:53 +0100 Subject: [PATCH 13/17] fixed taking out Z in reasoner for date time conversion --- config/reasoner/dl2op/main-info/mapping.n3 | 14 ++++++++------ config/reasoner/dl2op/main/mapping.n3 | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index 36c4585..6166723 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -145,16 +145,18 @@ PREFIX ere: # "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) +# To make sure the date have the same convention we now save them as datetime without the timezone indicator { - ?dateTime :dateFromDateTime ?date -} <= { - ?date string:notMatches """^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).*""" . - (?date "T00:00:00") string:concatenation ?datePlusTime. - (?datePlusTime xsd:dateTime) log:dtlit ?dateTime + ?date :dateTimeFromDate ?dateTime +} +<= +{ + ( ?date 1 10 ) string:substring ?dateSolo . + (?dateSolo "T00:00:00") string:concatenation ?datePlusTime. + (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . }. - # ex:orgA besluit:classificatie . { { diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 310f9c1..9d57423 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -131,13 +131,15 @@ PREFIX lblodlg: # 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) +# To make sure the date have the same convention we now save them as datetime without the timezone indicator { - ?dateTime :dateTimeFromDate ?date -} <= { - ?date string:notMatches """^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).*""" . - (?date "T00:00:00") string:concatenation ?datePlusTime. - (?datePlusTime xsd:dateTime) log:dtlit ?dateTime + ?date :dateTimeFromDate ?dateTime +} +<= +{ + ( ?date 1 10 ) string:substring ?dateSolo . + (?dateSolo "T00:00:00") string:concatenation ?datePlusTime. + (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . }. # ex:orgA besluit:classificatie . From d42986ff43a1a7ae04a9dad3d4868adb8f99ac0e Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Thu, 21 Mar 2024 13:26:52 +0100 Subject: [PATCH 14/17] added reasoner to private-info --- config/reasoner/dl2op/main-info/mapping.n3 | 55 ++++++++++-- config/reasoner/dl2op/main/mapping.n3 | 37 ++++++-- config/reasoner/dl2op/private-info/mapping.n3 | 87 +++++++++++++++---- 3 files changed, 145 insertions(+), 34 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index 6166723..f967a1c 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -71,30 +71,41 @@ PREFIX ere: # Test # ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. { - ?s mandaat:bindingeinde ?eindeDate. + ?s mandaat:bindingEinde ?eindeDate. # use backward arrow rule defined below ?eindeDate :dateTimeFromDate ?eindeDateTime. { - ?s mandaat:bindingeinde ?eindeDate + ?s mandaat:bindingEinde ?eindeDate } e:becomes { - ?s mandaat:bindingeinde ?eindeDateTime + ?s mandaat:bindingEinde ?eindeDateTime }. } => { - ?s mandaat:bindingeinde ?eindeDateTime + ?s mandaat:bindingEinde ?eindeDateTime +}. +{ + ?s mandaat:bindingEinde ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:bindingEinde ?eindeDate + } e:becomes { + ?s mandaat:bindingEinde ?eindeDateTime + }. +} => { + ?s mandaat:bindingEinde ?eindeDateTime }. - { - ?s mandaat:bindingstart ?startDate. + ?s mandaat:bindingStart ?startDate. # use backward arrow rule defined below ?startDate :dateTimeFromDate ?startDateTime. { - ?s mandaat:bindingstart ?startDate + ?s mandaat:bindingStart ?startDate } e:becomes { - ?s mandaat:bindingstart ?startDateTime + ?s mandaat:bindingStart ?startDateTime }. } => { - ?s mandaat:bindingstart ?startDateTime + ?s mandaat:bindingStart ?startDateTime }. { ?s ch:startdatum ?startDate. @@ -109,6 +120,32 @@ PREFIX ere: ?s ch:startdatum ?startDateTime }. +{ + ?s mandaat:start ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:start ?eindeDate + } e:becomes { + ?s mandaat:start ?eindeDateTime + }. +} => { + ?s mandaat:start ?eindeDateTime +}. + +{ + ?s mandaat:einde ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:einde ?eindeDate + } e:becomes { + ?s mandaat:einde ?eindeDateTime + }. +} => { + ?s mandaat:einde ?eindeDateTime +}. + { ?s ch:eindedatum ?endDate. # use backward arrow rule defined below diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 9d57423..f50f7ae 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -73,26 +73,51 @@ PREFIX lblodlg: # use backward arrow rule defined below ?eindeDate :dateTimeFromDate ?eindeDateTime. { - ?s mandaat:bindingeinde ?eindeDate + ?s mandaat:bindingEinde ?eindeDate } e:becomes { - ?s mandaat:bindingeinde ?eindeDateTime + ?s mandaat:bindingEinde ?eindeDateTime }. } => { - ?s mandaat:bindingeinde ?eindeDateTime + ?s mandaat:bindingEinde ?eindeDateTime }. +{ + ?s mandaat:start ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:start ?eindeDate + } e:becomes { + ?s mandaat:start ?eindeDateTime + }. +} => { + ?s mandaat:start ?eindeDateTime +}. + +{ + ?s mandaat:einde ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:einde ?eindeDate + } e:becomes { + ?s mandaat:einde ?eindeDateTime + }. +} => { + ?s mandaat:einde ?eindeDateTime +}. { ?s mandaat:bindingstart ?startDate. # use backward arrow rule defined below ?startDate :dateTimeFromDate ?startDateTime. { - ?s mandaat:bindingstart ?startDate + ?s mandaat:bindingStart ?startDate } e:becomes { - ?s mandaat:bindingstart ?startDateTime + ?s mandaat:bindingStart ?startDateTime }. } => { - ?s mandaat:bindingstart ?startDateTime + ?s mandaat:bindingStart ?startDateTime }. { diff --git a/config/reasoner/dl2op/private-info/mapping.n3 b/config/reasoner/dl2op/private-info/mapping.n3 index 82bebd9..6debd28 100644 --- a/config/reasoner/dl2op/private-info/mapping.n3 +++ b/config/reasoner/dl2op/private-info/mapping.n3 @@ -66,32 +66,82 @@ PREFIX xsd: # Test # ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. { - ?s mandaat:start ?startDateTime. + ?s mandaat:bindingeinde ?eindeDate. # use backward arrow rule defined below - ?startDateTime :dateFromDateTime ?startDate. + ?eindeDate :dateTimeFromDate ?eindeDateTime. { - ?s mandaat:start ?startDateTime + ?s mandaat:bindingEinde ?eindeDate } e:becomes { - ?s mandaat:start ?startDate + ?s mandaat:bindingEinde ?eindeDateTime }. } => { - ?s mandaat:start ?startDate + ?s mandaat:bindingEinde ?eindeDateTime }. -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. { - ?s mandaat:einde ?eindeDateTime. + ?s mandaat:start ?eindeDate. # use backward arrow rule defined below - ?eindeDateTime :dateFromDateTime ?eindeDate. + ?eindeDate :dateTimeFromDate ?eindeDateTime. { - ?s mandaat:einde ?eindeDateTime + ?s mandaat:start ?eindeDate } e:becomes { - ?s mandaat:einde ?eindeDate + ?s mandaat:start ?eindeDateTime }. } => { - ?s mandaat:einde ?eindeDate + ?s mandaat:start ?eindeDateTime }. +{ + ?s mandaat:einde ?eindeDate. + # use backward arrow rule defined below + ?eindeDate :dateTimeFromDate ?eindeDateTime. + { + ?s mandaat:einde ?eindeDate + } e:becomes { + ?s mandaat:einde ?eindeDateTime + }. +} => { + ?s mandaat:einde ?eindeDateTime +}. + +{ + ?s mandaat:bindingstart ?startDate. + # use backward arrow rule defined below + ?startDate :dateTimeFromDate ?startDateTime. + { + ?s mandaat:bindingStart ?startDate + } e:becomes { + ?s mandaat:bindingStart ?startDateTime + }. +} => { + ?s mandaat:bindingStart ?startDateTime +}. + +{ + ?s ch:startdatum ?startDate. + # use backward arrow rule defined below + ?startDate :dateTimeFromDate ?startDateTime. + { + ?s ch:startdatum ?startDate + } e:becomes { + ?s ch:startdatum ?startDateTime + }. +} => { + ?s ch:startdatum ?startDateTime +}. + +{ + ?s ch:eindedatum ?endDate. + # use backward arrow rule defined below + ?endDate :dateTimeFromDate ?endDateTime. + { + ?s ch:eindedatum ?endDate + } e:becomes { + ?s ch:eindedatum ?endDateTime + }. +} => { + ?s ch:eindedatum ?endDateTime +}. # Backward arrow rule is like a function call. # Removes time info in the returned date @@ -104,16 +154,15 @@ PREFIX xsd: # 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. - (?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. + ?date :dateTimeFromDate ?dateTime +} +<= +{ + ( ?date 1 10 ) string:substring ?dateSolo . + (?dateSolo "T00:00:00") string:concatenation ?datePlusTime. + (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . }. - # ex:orgA besluit:classificatie . { { From 0b3d1febdfb3744d8956d5838f96c1c6ed7a7afa Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Thu, 21 Mar 2024 13:59:38 +0100 Subject: [PATCH 15/17] added 2 hours extra to timezone to prevent duplpication --- config/reasoner/dl2op/main-info/mapping.n3 | 2 +- config/reasoner/dl2op/main/mapping.n3 | 2 +- config/reasoner/dl2op/private-info/mapping.n3 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index f967a1c..2b7ee60 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -189,7 +189,7 @@ PREFIX ere: <= { ( ?date 1 10 ) string:substring ?dateSolo . - (?dateSolo "T00:00:00") string:concatenation ?datePlusTime. + (?dateSolo "T02:00:00") string:concatenation ?datePlusTime. (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . }. diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index f50f7ae..4726fcc 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -163,7 +163,7 @@ PREFIX lblodlg: <= { ( ?date 1 10 ) string:substring ?dateSolo . - (?dateSolo "T00:00:00") string:concatenation ?datePlusTime. + (?dateSolo "T02:00:00") string:concatenation ?datePlusTime. (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . }. diff --git a/config/reasoner/dl2op/private-info/mapping.n3 b/config/reasoner/dl2op/private-info/mapping.n3 index 6debd28..c47268f 100644 --- a/config/reasoner/dl2op/private-info/mapping.n3 +++ b/config/reasoner/dl2op/private-info/mapping.n3 @@ -159,7 +159,7 @@ PREFIX xsd: <= { ( ?date 1 10 ) string:substring ?dateSolo . - (?dateSolo "T00:00:00") string:concatenation ?datePlusTime. + (?dateSolo "T02:00:00") string:concatenation ?datePlusTime. (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . }. From 8755bbc4321a7a117d2c7d60d724346831ad7bc6 Mon Sep 17 00:00:00 2001 From: mirdono Date: Thu, 21 Mar 2024 15:35:22 +0100 Subject: [PATCH 16/17] fix/refactor: removed duplicate rule, correct predicate names, improved variable names --- config/reasoner/dl2op/main-info/mapping.n3 | 22 +++------- config/reasoner/dl2op/main/mapping.n3 | 14 +++---- config/reasoner/dl2op/private-info/mapping.n3 | 42 +++++++++---------- 3 files changed, 33 insertions(+), 45 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index 2b7ee60..6a4cdd1 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -82,18 +82,6 @@ PREFIX ere: } => { ?s mandaat:bindingEinde ?eindeDateTime }. -{ - ?s mandaat:bindingEinde ?eindeDate. - # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. - { - ?s mandaat:bindingEinde ?eindeDate - } e:becomes { - ?s mandaat:bindingEinde ?eindeDateTime - }. -} => { - ?s mandaat:bindingEinde ?eindeDateTime -}. { ?s mandaat:bindingStart ?startDate. @@ -121,16 +109,16 @@ PREFIX ere: }. { - ?s mandaat:start ?eindeDate. + ?s mandaat:start ?startDate. # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. + ?startDate :dateTimeFromDate ?startDateTime. { - ?s mandaat:start ?eindeDate + ?s mandaat:start ?startDate } e:becomes { - ?s mandaat:start ?eindeDateTime + ?s mandaat:start ?startDateTime }. } => { - ?s mandaat:start ?eindeDateTime + ?s mandaat:start ?startDateTime }. { diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 4726fcc..268d389 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -69,7 +69,7 @@ PREFIX lblodlg: # Test # ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. { - ?s mandaat:bindingeinde ?eindeDate. + ?s mandaat:bindingEinde ?eindeDate. # use backward arrow rule defined below ?eindeDate :dateTimeFromDate ?eindeDateTime. { @@ -82,16 +82,16 @@ PREFIX lblodlg: }. { - ?s mandaat:start ?eindeDate. + ?s mandaat:start ?startDate. # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. + ?startDate :dateTimeFromDate ?startDateTime. { - ?s mandaat:start ?eindeDate + ?s mandaat:start ?startDate } e:becomes { - ?s mandaat:start ?eindeDateTime + ?s mandaat:start ?startDateTime }. } => { - ?s mandaat:start ?eindeDateTime + ?s mandaat:start ?startDateTime }. { @@ -108,7 +108,7 @@ PREFIX lblodlg: }. { - ?s mandaat:bindingstart ?startDate. + ?s mandaat:bindingStart ?startDate. # use backward arrow rule defined below ?startDate :dateTimeFromDate ?startDateTime. { diff --git a/config/reasoner/dl2op/private-info/mapping.n3 b/config/reasoner/dl2op/private-info/mapping.n3 index c47268f..e230655 100644 --- a/config/reasoner/dl2op/private-info/mapping.n3 +++ b/config/reasoner/dl2op/private-info/mapping.n3 @@ -66,7 +66,20 @@ PREFIX xsd: # Test # ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. { - ?s mandaat:bindingeinde ?eindeDate. + ?s mandaat:bindingStart ?startDate. + # use backward arrow rule defined below + ?startDate :dateTimeFromDate ?startDateTime. + { + ?s mandaat:bindingStart ?startDate + } e:becomes { + ?s mandaat:bindingStart ?startDateTime + }. +} => { + ?s mandaat:bindingStart ?startDateTime +}. + +{ + ?s mandaat:bindingEinde ?eindeDate. # use backward arrow rule defined below ?eindeDate :dateTimeFromDate ?eindeDateTime. { @@ -79,16 +92,16 @@ PREFIX xsd: }. { - ?s mandaat:start ?eindeDate. + ?s mandaat:start ?startDate. # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. + ?startDate :dateTimeFromDate ?startDateTime. { - ?s mandaat:start ?eindeDate + ?s mandaat:start ?startDate } e:becomes { - ?s mandaat:start ?eindeDateTime + ?s mandaat:start ?startDateTime }. } => { - ?s mandaat:start ?eindeDateTime + ?s mandaat:start ?startDateTime }. { @@ -104,19 +117,6 @@ PREFIX xsd: ?s mandaat:einde ?eindeDateTime }. -{ - ?s mandaat:bindingstart ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s mandaat:bindingStart ?startDate - } e:becomes { - ?s mandaat:bindingStart ?startDateTime - }. -} => { - ?s mandaat:bindingStart ?startDateTime -}. - { ?s ch:startdatum ?startDate. # use backward arrow rule defined below @@ -155,8 +155,8 @@ PREFIX xsd: # to come to the date that the DL user selected (in CE(S)T) { ?date :dateTimeFromDate ?dateTime -} -<= +} +<= { ( ?date 1 10 ) string:substring ?dateSolo . (?dateSolo "T02:00:00") string:concatenation ?datePlusTime. From 19f9d6f4e84578fef308b0bdd0659d3a16b00a41 Mon Sep 17 00:00:00 2001 From: mirdono Date: Thu, 21 Mar 2024 16:27:57 +0100 Subject: [PATCH 17/17] refactor: update backward arrow rule comment --- config/reasoner/dl2op/main-info/mapping.n3 | 15 +++++---------- config/reasoner/dl2op/main/mapping.n3 | 14 +++++--------- config/reasoner/dl2op/private-info/mapping.n3 | 14 +++++--------- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 index 6a4cdd1..326b028 100644 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -161,16 +161,11 @@ PREFIX ere: }. # Backward arrow rule is like a function call. -# 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) -# To make sure the date have the same convention we now save them as datetime without the timezone indicator +# Removes the timezone indicator "Z" from incoming datetimes +# To make sure all datetimes have the same convention we now save them as +# datetime without the timezone indicator +# We use "T02:00:00" as time indicator to work around a virtuoso bug that +# results in datetimes being converted to a date when using "T00:00:00" { ?date :dateTimeFromDate ?dateTime } diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 index 268d389..a0fa3ba 100644 --- a/config/reasoner/dl2op/main/mapping.n3 +++ b/config/reasoner/dl2op/main/mapping.n3 @@ -148,15 +148,11 @@ PREFIX lblodlg: # Backward arrow rule is like a function call. -# 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 make sure the date have the same convention we now save them as datetime without the timezone indicator +# Removes the timezone indicator "Z" from incoming datetimes +# To make sure all datetimes have the same convention we now save them as +# datetime without the timezone indicator +# We use "T02:00:00" as time indicator to work around a virtuoso bug that +# results in datetimes being converted to a date when using "T00:00:00" { ?date :dateTimeFromDate ?dateTime } diff --git a/config/reasoner/dl2op/private-info/mapping.n3 b/config/reasoner/dl2op/private-info/mapping.n3 index e230655..c410991 100644 --- a/config/reasoner/dl2op/private-info/mapping.n3 +++ b/config/reasoner/dl2op/private-info/mapping.n3 @@ -144,15 +144,11 @@ PREFIX xsd: }. # Backward arrow rule is like a function call. -# 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) +# Removes the timezone indicator "Z" from incoming datetimes +# To make sure all datetimes have the same convention we now save them as +# datetime without the timezone indicator +# We use "T02:00:00" as time indicator to work around a virtuoso bug that +# results in datetimes being converted to a date when using "T00:00:00" { ?date :dateTimeFromDate ?dateTime }