author Sylvain Thénault <>
Wed, 11 Oct 2017 15:11:03 +0200
changeset 2745 82e332e6c5b8
parent 2744 32150c18b188
child 2746 0f01adf6f65e
permissions -rw-r--r--
[schema] Add file_category relation to binary data objects This relation will be used in later csets to link the file to a high-level file format, that will be used to control low-level mime type and format id fields. Related to extranet #36331831

from __future__ import print_function

print('filtering language concepts, this will take a while')

seda_02_langs = set((
    'aa', 'ab', 'af', 'ak', 'am', 'ar', 'an', 'as', 'av', 'ae', 'ay', 'az',
    'ba', 'bm', 'be', 'bn', 'bh', 'bi', 'bo', 'bs', 'br', 'bg',
    'ca', 'cs', 'ch', 'ce', 'cu', 'cv', 'co', 'cr', 'cy',
    'da', 'de', 'dv', 'dz',
    'el', 'en', 'eo', 'et', 'ee', 'es', 'eu',
    'fo', 'fa', 'fj', 'fi', 'fr', 'fy', 'ff',
    'ga', 'gl', 'gv', 'gn', 'gu',
    'ht', 'ha', 'he', 'hz', 'hi', 'ho', 'hr', 'hu', 'hy',
    'ig', 'is', 'io', 'ii', 'iu', 'ie', 'ia', 'id', 'ik', 'it',
    'jv', 'ja',
    'ka', 'kl', 'kn', 'ks', 'kr', 'kk', 'km', 'ki', 'ky', 'kv', 'kg', 'ko', 'kj', 'ku', 'kw',
    'lo', 'lv', 'li', 'ln', 'lt', 'lb', 'lu', 'lg',
    'mk', 'mh', 'ml', 'mi', 'mr', 'ms', 'mg', 'mt', 'mn', 'my',
    'na', 'nv', 'nr', 'nd', 'ng', 'ne', 'nn', 'nb', 'no', 'ny', 'nl',
    'oc', 'oj', 'or', 'om', 'os',
    'pa', 'pi', 'pl', 'pt', 'ps'
    'rm', 'ro', 'rn', 'ru', 'rw',
    'sg', 'sa', 'si', 'sk', 'sl', 'se', 'sm', 'sn', 'sd', 'so', 'st', 'sc', 'sr', 'ss', 'su', 'sw', 'sv', 'sq',
    'ty', 'ta', 'tt', 'te', 'tg', 'tl', 'th', 'ti', 'to', 'tn', 'ts', 'tk', 'tr', 'tw',
    'ug', 'uk', 'ur', 'uz',
    've', 'vi', 'vo',
    'wa', 'wo',
    'yi', 'yo',
    'za', 'zu', 'zh',

rset = rql(
    'Any X WHERE X in_scheme S, S title "Langues (ISO-639-3)", '
    'L label_of X, L language_code "seda-02", NOT L label IN ({})'
    .format(','.join(repr(code) for code in seda_02_langs)))
print(len(rset), 'concepts to delete')
for i, concept in enumerate(rset.entities()):
    if i % 10: