diff --git a/config/migrations/2025/20250725120522-remove-duplicate-memberships-ocmw-municipality.sparql b/config/migrations/2025/20250725120522-remove-duplicate-memberships-ocmw-municipality.sparql index a55bf85..dac16fd 100644 --- a/config/migrations/2025/20250725120522-remove-duplicate-memberships-ocmw-municipality.sparql +++ b/config/migrations/2025/20250725120522-remove-duplicate-memberships-ocmw-municipality.sparql @@ -8,26 +8,26 @@ DELETE { } WHERE { GRAPH { ?duplicateMembership a org:Membership ; - org:organization ?orgB ; # OCMW - org:member ?orgA ; # Municipality + org:organization ?ocmw ; + org:member ?municipality ; org:role ; ?p ?o . # Find the other memberships with swapped organizations ?correctMembership a org:Membership ; - org:organization ?orgA ; # Municipality - org:member ?orgB ; # OCMW + org:organization ?municipality ; + org:member ?ocmw ; org:role . } - GRAPH ?gA { - ?orgA org:classification ?classA . + GRAPH ?graphMunicipality { + ?municipality org:classification ?municipalityClassification . } - GRAPH ?gB { - ?orgB org:classification ?classB . + GRAPH ?graphOCMW { + ?ocmw org:classification ?ocmwClassificiation . } - FILTER(?classA = ) - FILTER(?classB = ) + FILTER(?municipalityClassification = ) + FILTER(?ocmwClassificiation = ) }