diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112800-related-members.sparql b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112800-related-members.sparql index 8161fed..b46114f 100644 --- a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112800-related-members.sparql +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112800-related-members.sparql @@ -2,11 +2,6 @@ PREFIX skos: PREFIX org: PREFIX mu: -DELETE { - GRAPH ?g { - ?organization org:hasSubOrganization ?subOrganization . - } -} INSERT { GRAPH ?g { ?membership a org:Membership ; @@ -15,8 +10,7 @@ INSERT { org:member ?subOrganization ; org:role . # gerelateerd } -} -WHERE { +} WHERE { VALUES ?g { @@ -29,4 +23,4 @@ WHERE { BIND(SHA1(CONCAT(STR(?organization), STR(?subOrganization), "sub organization")) as ?uuid) BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) -} \ No newline at end of file +} diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql index 2ccf9bd..6ae7e22 100644 --- a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql @@ -3,21 +3,15 @@ PREFIX org: PREFIX mu: PREFIX ext: -DELETE { - GRAPH ?g { - ?org org:linkedTo ?foundedOrg . - } -} INSERT { GRAPH ?g { ?membership a org:Membership ; mu:uuid ?uuid ; - org:organization ?foundedOrg ; + org:organization ?linkedOrg ; org:member ?org ; org:role . # gerelateerd } -} -WHERE { +} WHERE { VALUES ?g { @@ -25,9 +19,9 @@ WHERE { } GRAPH ?g { - ?org org:linkedTo ?foundedOrg . + ?org org:linkedTo ?linkedOrg . } - BIND(SHA1(CONCAT(STR(?org), STR(?foundedOrg), "associated with")) as ?uuid) + BIND(SHA1(CONCAT(STR(?org), STR(?linkedOrg), "associated with")) as ?uuid) BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) -} \ No newline at end of file +}