-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration flushing data consumed from OP
- Loading branch information
1 parent
adf2ec4
commit 2bc9644
Showing
3 changed files
with
285 additions
and
0 deletions.
There are no files selected for viewing
231 changes: 231 additions & 0 deletions
231
...09142300-extended-sync-op/20241009142501-flush-all-admin-units-before-sync-with-op.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
# Remove mandates | ||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?typeOfInterest { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
<http://www.w3.org/ns/regorg#RegisteredOrganization> | ||
} | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
|
||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandaat>; | ||
?p ?o. | ||
|
||
?bot a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>; | ||
<http://www.w3.org/ns/org#hasPost> ?s; | ||
<http://data.vlaanderen.be/ns/mandaat#isTijdspecialisatieVan> ?orgaan. | ||
|
||
?orgaan a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>; | ||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?eenheid. | ||
?eenheid a ?typeOfInterest. | ||
} | ||
} | ||
|
||
; | ||
|
||
# Remove bestuursfuncties | ||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?typeOfInterest { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
<http://www.w3.org/ns/regorg#RegisteredOrganization> | ||
} | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
|
||
?s a <http://data.lblod.info/vocabularies/leidinggevenden/Bestuursfunctie>; | ||
?p ?o. | ||
|
||
?bot a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>; | ||
<http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie> ?s; | ||
<http://data.vlaanderen.be/ns/mandaat#isTijdspecialisatieVan> ?orgaan. | ||
|
||
?orgaan a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>; | ||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?eenheid. | ||
?eenheid a ?typeOfInterest. | ||
} | ||
} | ||
|
||
; | ||
|
||
# bestuursorganen in tijd | ||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?typeOfInterest { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
} | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>; | ||
?p ?o; | ||
<http://data.vlaanderen.be/ns/mandaat#isTijdspecialisatieVan> ?orgaan. | ||
?orgaan a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>; | ||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?eenheid. | ||
?eenheid a ?typeOfInterest. | ||
} | ||
} | ||
|
||
; | ||
|
||
# bestuursorganen | ||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?typeOfInterest { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
} | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>; | ||
?p ?o; | ||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?eenheid. | ||
?eenheid a ?typeOfInterest. | ||
} | ||
} | ||
|
||
; | ||
|
||
# Primary site addresses | ||
|
||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?typeOfInterest { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
<http://www.w3.org/ns/regorg#RegisteredOrganization> | ||
} | ||
|
||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s a <http://www.w3.org/ns/locn#Address>; | ||
?p ?o. | ||
?eenheid a ?typeOfInterest; | ||
<http://www.w3.org/ns/org#hasPrimarySite>/<https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?s . | ||
} | ||
} | ||
|
||
; | ||
|
||
# Primary site contact points | ||
|
||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?typeOfInterest { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
<http://www.w3.org/ns/regorg#RegisteredOrganization> | ||
} | ||
|
||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s a <http://schema.org/ContactPoint>; | ||
?p ?o. | ||
?eenheid a ?typeOfInterest; | ||
<http://www.w3.org/ns/org#hasPrimarySite>/<http://www.w3.org/ns/org#siteAddress> ?s . | ||
} | ||
} | ||
|
||
; | ||
|
||
# Primary sites | ||
|
||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?typeOfInterest { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
<http://www.w3.org/ns/regorg#RegisteredOrganization> | ||
} | ||
|
||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s a <http://www.w3.org/ns/org#Site>; | ||
?p ?o. | ||
?eenheid a ?typeOfInterest; | ||
<http://www.w3.org/ns/org#hasPrimarySite> ?s . | ||
} | ||
} | ||
|
||
; | ||
|
||
# betrokken lokaal bestuur | ||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s <http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur> ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?type { | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
} | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s a ?type; | ||
<http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur> ?o. | ||
} | ||
} | ||
|
||
; | ||
|
||
# remaining | ||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s ?p ?o. | ||
} | ||
} | ||
WHERE { | ||
VALUES ?type { | ||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst> | ||
<http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> | ||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst> | ||
<http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> | ||
<http://www.w3.org/ns/regorg#RegisteredOrganization> | ||
<http://data.lblod.info/vocabularies/erediensten/BetrokkenLokaleBesturen> | ||
<http://data.lblod.info/vocabularies/erediensten/PositieBedienaar> | ||
<http://www.w3.org/ns/org#ChangeEvent> | ||
} | ||
GRAPH <http://mu.semte.ch/graphs/public> { | ||
?s a ?type; | ||
?p ?o. | ||
} | ||
} | ||
|
||
; | ||
|
5 changes: 5 additions & 0 deletions
5
config/migrations/2024/20241009142300-extended-sync-op/20241009142502-flush-graphs.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CLEAR GRAPH <http://mu.semte.ch/graphs/landing-zone/op-public> | ||
|
||
; | ||
|
||
CLEAR GRAPH <http://mu.semte.ch/graphs/remapping-graph/op-public> |
49 changes: 49 additions & 0 deletions
49
config/migrations/2024/20241009142300-extended-sync-op/20241009142502-flush-sync-jobs.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/> | ||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
PREFIX prov: <http://www.w3.org/ns/prov#> | ||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#> | ||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/> | ||
PREFIX oslc: <http://open-services.net/ns/core#> | ||
PREFIX cogs: <http://vocab.deri.ie/cogs#> | ||
PREFIX adms: <http://www.w3.org/ns/adms#> | ||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> | ||
PREFIX dbpedia: <http://dbpedia.org/resource/> | ||
|
||
|
||
DELETE { | ||
GRAPH ?g { | ||
?job ?jobP ?jobO. | ||
?task ?taskP ?taskO. | ||
?container ?containerP ?containerO. | ||
} | ||
} WHERE { | ||
VALUES ?operation { | ||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/op-public> | ||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/op-public> | ||
} | ||
|
||
GRAPH ?g { | ||
{ | ||
?job a <http://vocab.deri.ie/cogs#Job>; | ||
task:operation ?operation; | ||
?jobP ?jobO. | ||
|
||
?task dct:isPartOf ?job; | ||
task:resultsContainer ?container; | ||
?taskP ?taskO. | ||
|
||
?container a nfo:DataContainer; | ||
?containerP ?containerO. | ||
} | ||
UNION | ||
{ | ||
?job a <http://vocab.deri.ie/cogs#Job>; | ||
task:operation ?operation; | ||
?jobP ?jobO. | ||
|
||
?task dct:isPartOf ?job; | ||
?taskP ?taskO. | ||
} | ||
} | ||
} |