-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/limit positions to types we already onboarded rebased (#278)
* rebased * Fix n3q query for mandatarissen --------- Co-authored-by: Claire Lovisa <[email protected]>
- Loading branch information
1 parent
ae53746
commit 68b5c67
Showing
5 changed files
with
250 additions
and
5 deletions.
There are no files selected for viewing
65 changes: 63 additions & 2 deletions
65
config/loket-consumer/leidinggevenden-dispatching/delta-context-config.js
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 |
---|---|---|
@@ -1,11 +1,72 @@ | ||
|
||
const PREFIXES = ` | ||
PREFIX org: <http://www.w3.org/ns/org#> | ||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#> | ||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/> | ||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>` | ||
|
||
const contextConfig = { | ||
addTypes: { | ||
scope: 'all', // 'inserts, 'deletes', 'all' or none. To add rdf:type to subjects of inserts, deletes or both | ||
exhausitive: false, // true or false: find all types for a subject, even if one is already present in delta | ||
}, | ||
contextQueries: [] | ||
contextQueries: [ | ||
// Case Leidnggevenden | ||
// They can be triggered when being inserted or when their link to a bestuursfunctie is added | ||
{ | ||
trigger: { // subjectType or predicateValue | ||
subjectType: "lblodlg:Functionaris" | ||
}, | ||
queryTemplate: (subject) => ` | ||
${PREFIXES} | ||
CONSTRUCT { | ||
?functionaris org:holds ?bestuursfunctie ; | ||
?p ?o . | ||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} WHERE { | ||
GRAPH <http://mu.semte.ch/graphs/landing-zone/leidinggevenden> { | ||
VALUES ?functionaris { ${subject} } | ||
?functionaris org:holds ?bestuursfunctie ; | ||
?p ?o . | ||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} | ||
}` | ||
}, | ||
{ | ||
trigger: { | ||
predicateValue: "org:holds" | ||
}, | ||
queryTemplate: (subject) => ` | ||
${PREFIXES} | ||
CONSTRUCT { | ||
?functionaris org:holds ?bestuursfunctie ; | ||
?p ?o . | ||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} WHERE { | ||
GRAPH <http://mu.semte.ch/graphs/landing-zone/leidinggevenden> { | ||
VALUES ?functionaris { ${subject} } | ||
?functionaris org:holds ?bestuursfunctie ; | ||
?p ?o . | ||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} | ||
}` | ||
} | ||
] | ||
} | ||
|
||
module.exports = { | ||
contextConfig | ||
contextConfig, | ||
PREFIXES | ||
}; |
65 changes: 63 additions & 2 deletions
65
config/loket-consumer/mandatarissen-dispatching/delta-context-config.js
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 |
---|---|---|
@@ -1,11 +1,72 @@ | ||
|
||
const PREFIXES = ` | ||
PREFIX org: <http://www.w3.org/ns/org#> | ||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#> | ||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/> | ||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>` | ||
|
||
const contextConfig = { | ||
addTypes: { | ||
scope: 'all', // 'inserts, 'deletes', 'all' or none. To add rdf:type to subjects of inserts, deletes or both | ||
exhausitive: false, // true or false: find all types for a subject, even if one is already present in delta | ||
}, | ||
contextQueries: [] | ||
contextQueries: [ | ||
// Case Mandatarissen | ||
// They can be triggered when being inserted or when their link to a mandate is added | ||
{ | ||
trigger: { // subjectType or predicateValue | ||
subjectType: "mandaat:Mandataris" | ||
}, | ||
queryTemplate: (subject) => ` | ||
${PREFIXES} | ||
CONSTRUCT { | ||
?mandataris org:holds ?mandate ; | ||
?p ?o . | ||
?orgaanInTime org:hasPost ?mandate ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} WHERE { | ||
GRAPH <http://mu.semte.ch/graphs/landing-zone/mandatarissen> { | ||
VALUES ?mandataris { ${subject} } | ||
?mandataris org:holds ?mandate ; | ||
?p ?o . | ||
?orgaanInTime org:hasPost ?mandate ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} | ||
}` | ||
}, | ||
{ | ||
trigger: { | ||
predicateValue: "org:holds" | ||
}, | ||
queryTemplate: (subject) => ` | ||
${PREFIXES} | ||
CONSTRUCT { | ||
?mandataris org:holds ?mandate ; | ||
?p ?o . | ||
?orgaanInTime org:hasPost ?mandate ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} WHERE { | ||
GRAPH <http://mu.semte.ch/graphs/landing-zone/mandatarissen> { | ||
VALUES ?mandataris { ${subject} } | ||
?mandataris org:holds ?mandate ; | ||
?p ?o . | ||
?orgaanInTime org:hasPost ?mandate ; | ||
mandaat:isTijdspecialisatieVan ?orgaan . | ||
?orgaan besluit:bestuurt ?eenheid . | ||
?eenheid besluit:classificatie ?classification . | ||
} | ||
}` | ||
} | ||
] | ||
} | ||
|
||
module.exports = { | ||
contextConfig | ||
contextConfig, | ||
PREFIXES | ||
}; |
21 changes: 21 additions & 0 deletions
21
config/migrations/2023/20230515111900-remove-not-yet-onboarded-functionarissen.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,21 @@ | ||
DELETE { | ||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> { | ||
?functionaris ?pfunctionaris ?ofunctionaris . | ||
} | ||
} WHERE { | ||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> { | ||
?functionaris a <http://data.lblod.info/vocabularies/leidinggevenden/Functionaris> ; | ||
<http://www.w3.org/ns/org#holds> ?bestuursfunctie ; | ||
?pfunctionaris ?ofunctionaris . | ||
} | ||
|
||
?orgaan <http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie> ?bestuursfunctie ; | ||
<http://data.vlaanderen.be/ns/mandaat#isTijdspecialisatieVan>/<http://data.vlaanderen.be/ns/besluit#bestuurt>/<http://data.vlaanderen.be/ns/besluit#classificatie> ?classification . | ||
|
||
FILTER(?classification NOT IN ( | ||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000000>, | ||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000001>, | ||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000002>, | ||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000003> | ||
)) | ||
} |
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
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