Add remove-stale-jobs.sparql-template migration
This commit is contained in:
@@ -11,4 +11,5 @@ In addition, these files can function as templates or provide inspiration for fu
|
|||||||
## Template files
|
## Template files
|
||||||
|
|
||||||
- `pseudonimyze-data.sparql-template` - the file that contains the sparql for pseudonymizing data in the triplestore. It should run every time the db is "refreshed" with a copy from PROD.
|
- `pseudonimyze-data.sparql-template` - the file that contains the sparql for pseudonymizing data in the triplestore. It should run every time the db is "refreshed" with a copy from PROD.
|
||||||
|
- `remove-stale-jobs.sparql-template` - removing `busy` and `scheduled` jobs.
|
||||||
- `remove-type-in-producer-graph.sparql-template` - the migration to handle the occasional sync issue between OP and Loket.
|
- `remove-type-in-producer-graph.sparql-template` - the migration to handle the occasional sync issue between OP and Loket.
|
||||||
|
|||||||
25
config/migrations-sample/remove-stale-jobs.sparql-template
Normal file
25
config/migrations-sample/remove-stale-jobs.sparql-template
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
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#>
|
||||||
|
|
||||||
|
DELETE {
|
||||||
|
GRAPH ?g {
|
||||||
|
?jobUri a <http://vocab.deri.ie/cogs#Job>.
|
||||||
|
?jobUri adms:status ?status.
|
||||||
|
?jobUri ?p ?o
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WHERE {
|
||||||
|
GRAPH ?g {
|
||||||
|
?jobUri a <http://vocab.deri.ie/cogs#Job>.
|
||||||
|
?jobUri adms:status ?status.
|
||||||
|
?jobUri ?p ?o
|
||||||
|
FILTER(?status IN (<http://redpencil.data.gift/id/concept/JobStatus/busy>, <http://redpencil.data.gift/id/concept/JobStatus/scheduled>))
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user