diff --git a/config/migrations/2024/20240315104123-add-fusion-event-pz-aalter-maldegem.sparql b/config/migrations/2024/20240315104123-add-fusion-event-pz-aalter-maldegem.sparql new file mode 100644 index 0000000..8431ca5 --- /dev/null +++ b/config/migrations/2024/20240315104123-add-fusion-event-pz-aalter-maldegem.sparql @@ -0,0 +1,55 @@ +PREFIX org: +PREFIX dct: +PREFIX ch: +PREFIX lblodOrg: +PREFIX ext: +PREFIX mu: + +INSERT { + GRAPH { + ?changeEvent a org:ChangeEvent ; + mu:uuid ?uuidChangeEvent ; + ch:typeWijziging ; # Fusie + org:resultingOrganization ?resultingOrganisation ; + dct:date "2024-01-01"^^xsd:date ; + dct:description "Fusie tussen PZ Aalter en PZ Maldegem resulteert in PZ Aalter/Maldegem" ; + org:originalOrganization ?originalAalter ; + org:originalOrganization ?originalMaldegem ; + lblodOrg:veranderingsgebeurtenisResultaat ?changeEventFirstNotActiveResult ; + lblodOrg:veranderingsgebeurtenisResultaat ?changeEventSecondNotActiveResult ; + lblodOrg:veranderingsgebeurtenisResultaat ?changeEventActiveResult . + + ?changeEventFirstNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat ; + mu:uuid ?uuidChangeEventFirstNotActiveResult ; + lblodOrg:resulterendeStatus ; # not active + ext:resultingOrganization ?originalAalter . + + ?changeEventSecondNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat ; + mu:uuid ?uuidChangeEventSecondNotActiveResult ; + lblodOrg:resulterendeStatus ; # not active + ext:resultingOrganization ?originalMaldegem . + + ?changeEventActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat ; + mu:uuid ?uuidChangeEventActiveResult ; + lblodOrg:resulterendeStatus ; # active + ext:resultingOrganization ?resultingOrganisation . + } +} WHERE { + VALUES (?originalAalter ?originalMaldegem ?resultingOrganisation) { + ( + + ) + } + + BIND(SHA256(CONCAT(STR(?originalAalter), STR(?originalMaldegem), STR(?resultingOrganization))) AS ?uuidChangeEvent) . + BIND(IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent) . + + BIND(SHA256(CONCAT(STR(?originalAalter), "fusieChangeEventFirstNotActiveResult")) AS ?uuidChangeEventFirstNotActiveResult) . + BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventFirstNotActiveResult))) AS ?changeEventFirstNotActiveResult) . + + BIND(SHA256(CONCAT(STR(?originalMaldegem), "fusieChangeEventSecondNotActiveResult")) AS ?uuidChangeEventSecondNotActiveResult) . + BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventSecondNotActiveResult))) AS ?changeEventSecondNotActiveResult) . + + BIND(SHA256(CONCAT(STR(?originalAalter), STR(?originalMaldegem), STR(?resultingOrganization), "fusieChangeEventActiveResult")) AS ?uuidChangeEventActiveResult) . + BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventActiveResult))) AS ?changeEventActiveResult) . +}