diff --git a/config/migrations/2024/20240115141651-fix-missing-resulting-orgs.sparql b/config/migrations/2024/20240115141651-fix-missing-resulting-orgs.sparql new file mode 100644 index 00000000..cad97298 --- /dev/null +++ b/config/migrations/2024/20240115141651-fix-missing-resulting-orgs.sparql @@ -0,0 +1,24 @@ +PREFIX rdf: +PREFIX org: +PREFIX mu: +PREFIX ext: +PREFIX ch: +PREFIX code: + + + +INSERT { + graph ?g { + ?ce org:resultingOrganization ?extResultingOrg. + ?ce org:originalOrganization ?extResultingOrg + } +} +WHERE { + graph ?g { + ?ce rdf:type org:ChangeEvent ; + code:veranderingsgebeurtenisResultaat ?resultaat. + ?resultaat . + ?resultaat ext:resultingOrganization ?extResultingOrg. + filter not exists {?ce org:resultingOrganization ?result } + } +}