Skip to content

DEICH-6097 DEICH-6149 make events cancellable

Petter Goksøyr Åsen requested to merge DEICH-6097 into master

Migration SPARQLs for existing events:

Set cancelled prop to true/false:

PREFIX : <https://tjenester.deichman.no/ontology/>
WITH <https://tjenester.deichman.no>
INSERT {
  ?id :cancelled ?cancelled .
} WHERE {
  ?id a :LibraryEventInstance ; :title ?title .
  FILTER NOT EXISTS { ?id :cancelled ?cancelled }
  BIND(IF(regex(?title, "avlyst", "i"), true, false) AS ?cancelled)
}

Remove "AVLYST" variants from beginning title:

PREFIX : <https://tjenester.deichman.no/ontology/>
WITH <https://tjenester.deichman.no>
DELETE { ?id :title ?old_title }
INSERT { ?id :title ?new_title }
 WHERE {
  ?id a :LibraryEventInstance ; :title ?old_title .
  BIND(REPLACE(?old_title, "^\\s?avlyst[!:.]*(\\s*)?-?\\s?", "", "i") AS ?new_title)
  FILTER(REGEX(?old_title, "avlyst", "i"))
}

Closes DEICH-6097 Closes DEICH-6149

Edited by Petter Goksøyr Åsen

Merge request reports