From 329e87f0ebad9cc58b969cc70d2525d912c64868 Mon Sep 17 00:00:00 2001 From: Elias Papanikitas Date: Tue, 5 Dec 2023 11:58:54 +0100 Subject: [PATCH] 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": {