<commit_before>PrintWriter failedHoldIDs = getReportWriter("failed-to-delete-holdIDs")
PrintWriter scheduledForDeletion = getReportWriter("scheduled-for-deletion")
String BIB_ID_FILE = 'bibIDlist'
File bibids = new File(scriptDir, BIB_ID_FILE)

String bibidstring = bibids.readLines().join("','")

String where =
        "id in " +
                "( " +
                "select l.id from " +
                "lddb__identifiers i " +
                "left join lddb__dependencies d on d.dependsonid = i.id and d.relation = 'itemOf' " +
                "left join lddb l on d.id = l.id " +
                "where " +
                "i.iri in ('${bibidstring}') and l.data#>>'{@graph,1,heldBy,@id}' = 'https://libris.kb.se/library/Osts' " +
                ")"

selectBySqlWhere(where, silent: false, { hold ->
    scheduledForDeletion.println("${hold.doc.getURI()}")
    hold.scheduleDelete(onError: { e ->
        failedHoldIDs.println("Failed to delete ${hold.doc.shortId} due to: $e")
    })
})<commit_msg>Use correct sigel.<commit_after>PrintWriter failedHoldIDs = getReportWriter("failed-to-delete-holdIDs")
PrintWriter scheduledForDeletion = getReportWriter("scheduled-for-deletion")
String BIB_ID_FILE = 'bibIDlist'
File bibids = new File(scriptDir, BIB_ID_FILE)

String bibidstring = bibids.readLines().join("','")

String where =
        "id in " +
                "( " +
                "select l.id from " +
                "lddb__identifiers i " +
                "left join lddb__dependencies d on d.dependsonid = i.id and d.relation = 'itemOf' " +
                "left join lddb l on d.id = l.id " +
                "where " +
                "i.iri in ('${bibidstring}') and l.data#>>'{@graph,1,heldBy,@id}' = 'https://libris.kb.se/library/Nv' " +
                ")"

selectBySqlWhere(where, silent: false, { hold ->
    scheduledForDeletion.println("${hold.doc.getURI()}")
    hold.scheduleDelete(onError: { e ->
        failedHoldIDs.println("Failed to delete ${hold.doc.shortId} due to: $e")
    })
})
{'fraction_non_alphanumeric': 0.14794656110836218, 'fraction_numerical': 0.0009896091044037606, 'mean_word_length': 2.5104166666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4938013', 'n_tokens_mistral': 690, 'n_tokens_neox': 655, 'n_words': 130}