From 7050629e0c1ce6aad22c0505c33ceddcb94f450a Mon Sep 17 00:00:00 2001 From: mirdono Date: Tue, 16 Jul 2024 15:23:32 +0200 Subject: [PATCH] feat: replace `is-associated-with` with a membership relation --- .../20240716151700-associated-with.sparql | 33 +++++++++++++++++++ config/resources/domain.json | 6 ---- 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql 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 new file mode 100644 index 0000000..2ccf9bd --- /dev/null +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql @@ -0,0 +1,33 @@ +PREFIX skos: +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:member ?org ; + org:role . # gerelateerd + } +} +WHERE { + VALUES ?g { + + + + } + + GRAPH ?g { + ?org org:linkedTo ?foundedOrg . + } + + BIND(SHA1(CONCAT(STR(?org), STR(?foundedOrg), "associated with")) as ?uuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} \ No newline at end of file diff --git a/config/resources/domain.json b/config/resources/domain.json index 3b529ca..c9eeac6 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -445,12 +445,6 @@ "target": "organizations", "cardinality": "many" }, - "is-associated-with": { - "predicate": "org:linkedTo", - "target": "organizations", - "cardinality": "one", - "inverse": true - }, "memberships-of-organizations": { "predicate": "org:member", "target": "memberships",