From 8c7ba7afecb780241d684765aef39eca094699fc Mon Sep 17 00:00:00 2001 From: Nordine Bittich <3816305+nbittich@users.noreply.github.com> Date: Tue, 23 Nov 2021 10:36:41 +0100 Subject: [PATCH] migrate private data (#69) * migrate private data * bind subject before optional Co-authored-by: Boris De Vloed --- ...2411511111121112333222-private-data.sparql | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 config/migrations/2022212411511111121112333222-private-data.sparql diff --git a/config/migrations/2022212411511111121112333222-private-data.sparql b/config/migrations/2022212411511111121112333222-private-data.sparql new file mode 100644 index 0000000..6a2e496 --- /dev/null +++ b/config/migrations/2022212411511111121112333222-private-data.sparql @@ -0,0 +1,53 @@ + PREFIX ext: + PREFIX xsd: + PREFIX mu: + PREFIX generiek: + PREFIX persoon: + PREFIX person: + + DELETE { + GRAPH { + ?s persoon:heeftGeboorte ?heeftGeboorte . + ?s persoon:registratie ?registration . + ?registration generiek:gestructureerdeIdentificator ?identificator . + ?identificator ?x ?y . + ?registration ?t ?j . + ?s persoon:geslacht ?geslacht . + ?s persoon:heeftNationaliteit ?nationaliteit . + } + } + INSERT { + GRAPH { + ?s persoon:heeftGeboorte ?heeftGeboorte . + ?s persoon:registratie ?registration . + ?registration generiek:gestructureerdeIdentificator ?identificator . + ?identificator ?x ?y . + ?registration ?t ?j . + ?s persoon:geslacht ?geslacht . + ?s persoon:heeftNationaliteit ?nationaliteit . + } + } + WHERE + { GRAPH + { + ?s a person:Person. + OPTIONAL + { ?s persoon:heeftGeboorte ?heeftGeboorte . + ?heeftGeboorte + ?p ?o + } + OPTIONAL + { ?s persoon:registratie ?registration . + ?registration + generiek:gestructureerdeIdentificator ?identificator . + ?identificator + ?x ?y . + ?registration + ?t ?j + } + OPTIONAL + { ?s persoon:geslacht ?geslacht } + OPTIONAL + { ?s persoon:heeftNationaliteit ?nationaliteit } + } + }