[PATCH 2 of 9 seda] [dataimport] Import file categories vocabulary

Sylvain Thenault sylvain.thenault at logilab.fr
Thu Oct 12 16:59:47 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1507727539 -7200
#      Wed Oct 11 15:12:19 2017 +0200
# Node ID 0f01adf6f65eaa9c97734763cec3ca45de9fb8a3
# Parent  82e332e6c5b8b0ad6a89eaac1ae19b27f8060715
# Available At https://hg.logilab.org/review/cubes/seda
#              hg pull https://hg.logilab.org/review/cubes/seda -r 0f01adf6f65e
[dataimport] Import file categories vocabulary

provided by the SAEM team. Link it to the file_category relation.

Related to #36331831

diff --git a/cubicweb_seda/dataimport.py b/cubicweb_seda/dataimport.py
--- a/cubicweb_seda/dataimport.py
+++ b/cubicweb_seda/dataimport.py
@@ -88,10 +88,14 @@ LCSV_FILES = (
      ('seda_language_to', 'seda_description_language_to'), (),
      'languages.csv'),
     (u"Algorithmes d'empreinte",
      'seda_algorithm', 'SEDABinaryDataObject',
      'digest_algorithms.csv'),
+
+    (u'Catégories de fichier',
+     'file_category', (),
+     'file_categories.csv'),
 )
 
 
 def lcsv_import(cnx, store, fname, scheme_uri):
     """Actually import LCSV data file."""
diff --git a/cubicweb_seda/migration/0.11.0_Any.py b/cubicweb_seda/migration/0.11.0_Any.py
--- a/cubicweb_seda/migration/0.11.0_Any.py
+++ b/cubicweb_seda/migration/0.11.0_Any.py
@@ -43,5 +43,7 @@ for i, concept in enumerate(rset.entitie
 
 
 sync_schema_props_perms('user_cardinality')
 
 add_relation_type('file_category')
+
+import_seda_schemes(cnx)
diff --git a/cubicweb_seda/migration/data/file_categories.csv b/cubicweb_seda/migration/data/file_categories.csv
new file mode 100644
--- /dev/null
+++ b/cubicweb_seda/migration/data/file_categories.csv
@@ -0,0 +1,283 @@
+#;$id;broader_concept;libellé;Description du titre du niveau;libellé alternatif;libellé alternatif
+lang;;;seda;fr;fr;fr
+url;skos:Concept;skos:broader;skos:prefLabel;skos:definition;skos:altLabel;skos:note
+type;;url;string;string;string;string
+;#1; ;audio;catégorie;;
+;#1-1;#1;aac;extension;;
+;#1-1-1;#1-1;audio/aac;type_mime;;
+;#1-1-1-1;#1-1-1;fmt/xxx;format;;
+;#1-2;#1;flac;extension;;
+;#1-2-1;#1-2;audio/x-flac;type_mime;;
+;#1-2-1-1;#1-2-1;fmt/279;format;1.2.1;
+;#1-3;#1;mp3;extension;;
+;#1-3-1;#1-3;audio/mpeg;type_mime;;
+;#1-3-1-1;#1-3-1;fmt/134;format;toutes versions;
+;#1-3-2;#1-3;audio/MPA;type_mime;;
+;#1-3-2-1;#1-3-2;fmt/134;format;toutes versions;
+;#1-3-3;#1-3;audio/mparobust;type_mime;;
+;#1-3-3-1;#1-3-3;fmt/134;format;toutes versions;
+;#1-3-4;#1-3;audio/mp3;type_mime;;
+;#1-3-4-1;#1-3-4;fmt/134;format;toutes versions;
+;#1-4;#1;ogg;extension;;
+;#1-4-1;#1-4;audio/ogg;type_mime;;
+;#1-4-1-1;#1-4-1;fmt/203;format;;
+;#1-4-1-2;#1-4-1;fmt/944;format;;
+;#1-4-1-3;#1-4-1;fmt/947;format;;
+;#2;;compression;catégorie;;
+;#2-1;#2;7z;extension;;
+;#2-1-1;#2-1;application/x-7z-compressed;type_mime;;
+;#2-1-1-1;#2-1-1;fmt/484;format;toutes versions;
+;#2-2;#2;7z.001;extension;;
+;#2-2-1;#2-2;application/x-7z-compressed;type_mime;;
+;#2-2-1-1;#2-2-1;fmt/484;format;toutes versions;
+;#2-3;#2;7z.002;extension;;
+;#2-3-1;#2-3;application/x-7z-compressed;type_mime;;
+;#2-3-1-1;#2-3-1;fmt/484;format;toutes versions;
+;#2-4;#2;7z.003;extension;;
+;#2-4-1;#2-4;application/x-7z-compressed;type_mime;;
+;#2-4-1-1;#2-4-1;fmt/484;format;toutes versions;
+;#2-5;#2;7z.004;extension;;
+;#2-5-1;#2-5;application/x-7z-compressed;type_mime;;
+;#2-5-1-1;#2-5-1;fmt/484;format;toutes versions;
+;#2-6;#2;zip;extension;;
+;#2-6-1;#2-6;application/zip;type_mime;;
+;#2-6-1-1;#2-6-1;x-fmt/263;format;toutes versions;
+;#3;;document;catégorie;;
+;#3-1;#3;doc;extension;;
+;#3-1-1;#3-1;application/msword;type_mime;;
+;#3-1-1-1;#3-1-1;fmt/37;format;version 1.0;
+;#3-1-1-2;#3-1-1;fmt/38;format;version 2.0;
+;#3-1-1-3;#3-1-1;fmt/273;format;version 3.0;
+;#3-1-1-4;#3-1-1;fmt/274;format;version 4.0;
+;#3-1-1-5;#3-1-1;fmt/275;format;version 5.0;
+;#3-1-1-6;#3-1-1;fmt/276;format;version 5.5;
+;#3-1-1-7;#3-1-1;fmt/39;format;version 6.0 - 95;
+;#3-1-1-8;#3-1-1;fmt/609;format;version 6.0 - 2003;
+;#3-1-1-9;#3-1-1;fmt/754;format;version 97 - 2003;
+;#3-2;#3;docm;extension;;
+;#3-2-1;#3-2;application/vnd.ms-word.document.macroEnabled.12;type_mime;;
+;#3-2-1-1;#3-2-1;fmt/523;format;2007 onwards;
+;#3-3;#3;docx;extension;;
+;#3-3-1;#3-3;application/msword;type_mime;;
+;#3-3-1-1;#3-3-1;fmt/494;format;;
+;#3-3-2;#3-3;application/vnd.openxmlformats-officedocument.wordprocessingml.document;type_mime;;
+;#3-3-2-1;#3-3-2;fmt/494;format;2007 onwards;
+;#3-4;#3;dot;extension;;
+;#3-4-1;#3-4;application/msword;type_mime;;
+;#3-4-1-1;#3-4-1;fmt/609;format;version 97 - 2003;
+;#3-5;#3;dotm;extension;;
+;#3-5-1;#3-5;application/vnd.ms-word.template.macroEnabled.12;type_mime;;
+;#3-5-1-1;#3-5-1;fmt/599;format;2007 onwards;
+;#3-6;#3;dotx;extension;;
+;#3-6-1;#3-6;application/vnd.openxmlformats-officedocument.wordprocessingml.template;type_mime;;
+;#3-6-1-1;#3-6-1;fmt/597;format;2007 onwards;
+;#3-7;#3;ppt;extension;;
+;#3-7-1;#3-7;application/powerpoint;type_mime;;
+;#3-7-1-1;#3-7-1;fmt/111;format;Version 95;
+;#3-7-1-2;#3-7-1;fmt/125;format;Version 4.0;
+;#3-7-1-3;#3-7-1;fmt/126;format;version 97 - 2003;
+;#3-8;#3;xls;extension;;
+;#3-8-1;#3-8;application/vnd.ms-excel;type_mime;;
+;#3-8-1-1;#3-8-1;fmt/55;format;version 2.0;
+;#3-8-1-2;#3-8-1;fmt/56;format;version 3.0;
+;#3-8-1-3;#3-8-1;fmt/57;format;version 4S;
+;#3-8-1-4;#3-8-1;fmt/58;format;version 4W;
+;#3-8-1-5;#3-8-1;fmt/59;format;version 5.0/95;
+;#3-8-1-6;#3-8-1;fmt/61;format;version 8;
+;#3-8-1-7;#3-8-1;fmt/62;format;version 8X;
+;#3-8-1-8;#3-8-1;fmt/111;format;version 5.0/95;
+;#3-9;#3;epub;extension;;
+;#3-9-1;#3-9;application/epub+zip;type_mime;;
+;#3-9-1-1;#3-9-1;fmt/483;format;;
+;#3-9-1-2;#3-9-1;fmt/471;format;;
+;#3-10;#3;ots;extension;;
+;#3-10-1;#3-10;application/vnd.oasis.opendocument.spreadsheet;type_mime;;
+;#3-10-1-1;#3-10-1;fmt/137;format;version 1.0;
+;#3-10-1-2;#3-10-1;x-fmt/263;format;version 1.1;
+;#3-10-1-3;#3-10-1;fmt/294;format;version 1.1;
+;#3-10-1-4;#3-10-1;fmt/295;format;version 1.2;
+;#3-11;#3;ott;extension;;
+;#3-11-1;#3-11;application/vnd.oasis.opendocument.text;type_mime;;
+;#3-11-1-1;#3-11-1;fmt/136;format;version 1.0;
+;#3-11-1-2;#3-11-1;x-fmt/263;format;version 1.1;
+;#3-11-1-3;#3-11-1;fmt/290;format;version 1.1;
+;#3-11-1-4;#3-11-1;fmt/291;format;version 1.2;
+;#3-12;#3;otp;extension;;
+;#3-12-1;#3-12;application/vnd.oasis.opendocument.presentation;type_mime;;
+;#3-12-1-1;#3-12-1;fmt/138;format;version 1.0;
+;#3-12-1-2;#3-12-1;x-fmt/263;format;version 1.1;
+;#3-12-1-3;#3-12-1;fmt/292;format;version 1.1;
+;#3-12-1-4;#3-12-1;fmt/293;format;version 1.2;
+;#3-13;#3;pdf;extension;;
+;#3-13-1;#3-13;application/pdf;type_mime;;
+;#3-13-1-1;#3-13-1;fmt/14;format;version 1.0;
+;#3-13-1-2;#3-13-1;fmt/15;format;version 1.1;
+;#3-13-1-3;#3-13-1;fmt/16;format;version 1.2;
+;#3-13-1-4;#3-13-1;fmt/17;format;version 1.3;
+;#3-13-1-5;#3-13-1;fmt/18;format;version 1.4;
+;#3-13-1-6;#3-13-1;fmt/19;format;version 1.5;
+;#3-13-1-7;#3-13-1;fmt/20;format;version 1.6;
+;#3-13-1-8;#3-13-1;fmt/95;format;Version 1a -PDF/A;
+;#3-13-1-9;#3-13-1;fmt/144;format;PDF/X;
+;#3-13-1-10;#3-13-1;fmt/145;format;PDF/X;
+;#3-13-1-11;#3-13-1;fmt/146;format;PDF/X;
+;#3-13-1-12;#3-13-1;fmt/147;format;PDF/X;
+;#3-13-1-13;#3-13-1;fmt/148;format;PDF/X;
+;#3-13-1-14;#3-13-1;fmt/157;format;PDF/X;
+;#3-13-1-15;#3-13-1;fmt/158;format;PDF/X;
+;#3-13-1-16;#3-13-1;fmt/276;format;version 1.7;
+;#3-13-1-17;#3-13-1;fmt/354;format;version 1b - PDF/A;
+;#3-13-1-18;#3-13-1;x-fmt/453;format;version 1.0-1.6;
+;#3-13-1-19;#3-13-1;fmt/476;format;version 2a - PDF/A;
+;#3-13-1-20;#3-13-1;fmt/477;format;version 2b - PDF/A;
+;#3-13-1-21;#3-13-1;fmt/478;format;version 2u - PDF/A;
+;#3-13-1-22;#3-13-1;fmt/479;format;version 3a - PDF/A;
+;#3-13-1-23;#3-13-1;fmt/480;format;version 3b - PDF/A;
+;#3-13-1-24;#3-13-1;fmt/481;format;version 3u - PDF/A;
+;#3-13-1-25;#3-13-1;fmt/488;format;PDF/X;
+;#3-13-1-26;#3-13-1;fmt/489;format;PDF/X;
+;#3-13-1-27;#3-13-1;fmt/490;format;PDF/X;
+;#3-13-1-28;#3-13-1;fmt/491;format;PDF/X;
+;#3-13-1-29;#3-13-1;fmt/492;format;PDF/X;
+;#3-13-1-30;#3-13-1;fmt/493;format;PDF/E;
+;#4;;données structurées;catégorie;;
+;#4-1;#4;atom;extension;;
+;#4-1-1;#4-1;application/atom+xml;type_mime;;
+;#4-1-1-1;#4-1-1;fmt/96;format;version 1.0;
+;#4-1-1-2;#4-1-1;fmt/101;format;version 1.0;
+;#4-1-1-3;#4-1-1;fmt/120;format;version 1.0;
+;#4-1-1-4;#4-1-1;fmt/121;format;version 1.0;
+;#4-2;#4;css;extension;;
+;#4-2-1;#4-2;text/css;type_mime;;
+;#4-2-1-1;#4-2-1;x-fmt/224;format;;
+;#4-3;#4;htm;extension;;
+;#4-3-1;#4-3;text/html;type_mime;;
+;#4-3-1-1;#4-3-1;fmt/96;format;version 1.0;
+;#4-4;#4;html;extension;;
+;#4-4-1;#4-4;text/html;type_mime;;
+;#4-4-1-1;#4-4-1;fmt/96;format;version 1.0;
+;#4-4-1-2;#4-4-1;fmt/97;format;version 2.0;
+;#4-4-1-3;#4-4-1;fmt/98;format;version 3.2;
+;#4-4-1-4;#4-4-1;fmt/99;format;version 4.0;
+;#4-4-1-5;#4-4-1;fmt/100;format;version 4.01;
+;#4-4-1-6;#4-4-1;fmt/471;format;version 5.0;
+;#4-5;#4;js;extension;;
+;#4-5-1;#4-5;application/javascript;type_mime;;
+;#4-5-1-1;#4-5-1;x-fmt/423;format;;
+;#4-6;#4;json;extension;;
+;#4-6-1;#4-6;application/json;type_mime;;
+;#4-6-1-1;#4-6-1;fmt/817;format;;
+;#4-7;#4;kml;extension;;
+;#4-7-1;#4-7;application/vnd.google-earth.kml+xml;type_mime;;
+;#4-7-1-1;#4-7-1;fmt/101;format;;
+;#4-7-1-2;#4-7-1;fmt/244;format;;
+;#4-8;#4;kmz;extension;;
+;#4-8-1;#4-8;application/vnd.google-earth.kmz;type_mime;;
+;#4-8-1-1;#4-8-1;fmt/724;format;;
+;#4-9;#4;siard;extension;;
+;#4-9-1;#4-9;application/siard;type_mime;;
+;#4-9-1-1;#4-9-1;fmt/161;format;version 1.0;
+;#4-9-1-2;#4-9-1;x-fmt/263;format;version 1.0;
+;#4-9-1-3;#4-9-1;fmt/995;format;version 2.0;
+;#4-10;#4;vcf;extension;;
+;#4-10-1;#4-10;text/x-vcard;type_mime;;
+;#4-10-1-1;#4-10-1;fmt/395;format;;
+;#4-10-1-2;#4-10-1;fmt/905;format;version 1.x;
+;#4-10-1-3;#4-10-1;fmt/906;format;version 2.x;
+;#4-10-1-4;#4-10-1;fmt/907;format;version 3.x;
+;#4-10-1-5;#4-10-1;fmt/908;format;version 4.x;
+;#4-11;#4;xml;extension;;
+;#4-11-1;#4-11;text/xml;type_mime;;
+;#4-11-1-1;#4-11-1;fmt/96;format;version 1.0;
+;#4-11-1-2;#4-11-1;fmt/101;format;version 1.0;
+;#4-11-1-3;#4-11-1;fmt/120;format;version 1.0;
+;#4-11-1-4;#4-11-1;fmt/121;format;version 1.0;
+;#4-12;#4;xsd;extension;;
+;#4-12-1;#4-12;application/xml;type_mime;;
+;#4-12-1-1;#4-12-1;fmt/101;format;;
+;#4-12-1-2;#4-12-1;fmt/280;format;;
+;#4-13;#4;xsl;extension;;
+;#4-13-1;#4-13;text/xml;type_mime;;
+;#4-13-1-1;#4-13-1;x-fmt/281;format;;
+;#4-14;#4;xslt;extension;;
+;#4-14-1;#4-14;application/xslt+xml;type_mime;;
+;#4-14-1-1;#4-14-1;x-fmt/281;format;;
+;#5;;Image;catégorie;;
+;#5-1;#5;jpeg;extension;;
+;#5-1-1;#5-1;image/jpeg;type_mime;;
+;#5-1-1-1;#5-1-1;fmt/41;format;toutes versions;
+;#5-1-1-2;#5-1-1;fmt/43;format;Version 1.01;
+;#5-1-1-3;#5-1-1;fmt/44;format;Version 1.02;
+;#5-2;#5;jpg;extension;;
+;#5-2-1;#5-2;image/jpeg;type_mime;;
+;#5-2-1-1;#5-2-1;fmt/41;format;toutes versions;
+;#5-2-1-2;#5-2-1;fmt/42;format;Version 1.0;
+;#5-2-1-3;#5-2-1;fmt/112;format;Version 1.0;
+;#5-2-1-4;#5-2-1;x-fmt/390;format;Version 2.1;
+;#5-2-1-5;#5-2-1;x-fmt/391;format;Version 2.2;
+;#5-2-1-6;#5-2-1;x-fmt/398;format;Version 2.0;
+;#5-2-1-7;#5-2-1;fmt/645;format;Version 2.2.1;
+;#5-3;#5;png;extension;;
+;#5-3-1;#5-3;image/png;type_mime;;
+;#5-3-1-1;#5-3-1;fmt/11;format;Version 1.0;
+;#5-3-1-2;#5-3-1;fmt/12;format;Version 1.1;
+;#5-3-1-3;#5-3-1;fmt/13;format;Version 1.2;
+;#5-4;#5;svg;extension;;
+;#5-4-1;#5-4;image/svg+xml;type_mime;;
+;#5-4-1-1;#5-4-1;fmt/91;format;Version 1.0;
+;#5-4-1-2;#5-4-1;fmt/92;format;Version 1.1;
+;#5-4-1-3;#5-4-1;fmt/101;format;toutes versions;
+;#5-4-1-4;#5-4-1;fmt/413;format;Version 1.2;
+;#5-5;#5;tif;extension;;
+;#5-5-1;#5-5;image/tiff;type_mime;;
+;#5-5-1-1;#5-5-1;fmt/152;format;Version 1.1;
+;#5-5-1-2;#5-5-1;fmt/153;format;;
+;#5-5-1-3;#5-5-1;fmt/154;format;;
+;#5-5-1-4;#5-5-1;fmt/155;format;;
+;#5-5-1-5;#5-5-1;fmt/353;format;toutes versions;
+;#5-5-1-6;#5-5-1;x-fmt/387;format;Version 2.2;
+;#5-5-1-7;#5-5-1;x-fmt/388;format;Version 2.1;
+;#5-5-1-8;#5-5-1;x-fmt/399;format;Version 2.0;
+;#5-6;#5;tiff;extension;;
+;#5-6-1;#5-6;image/tiff;type_mime;;
+;#5-6-1-1;#5-6-1;fmt/152;format;Version 1.1;
+;#5-6-1-2;#5-6-1;fmt/153;format;;
+;#5-6-1-3;#5-6-1;fmt/154;format;;
+;#5-6-1-4;#5-6-1;fmt/155;format;;
+;#5-6-1-5;#5-6-1;fmt/353;format;toutes versions;
+;#5-6-1-6;#5-6-1;x-fmt/387;format;Version 2.2;
+;#5-6-1-7;#5-6-1;x-fmt/388;format;Version 2.1;
+;#5-6-1-8;#5-6-1;x-fmt/399;format;Version 2.0;
+;#7;;vidéo;catégorie;;
+;#7-1;#7;264;extension;;
+;#7-1-1;#7-1;video/h264;type_mime;;
+;#7-1-1-1;#7-1-1;fmt/???;format;;
+;#7-2;#7;avi;extension;;
+;#7-2-1;#7-2;video/avi;type_mime;;
+;#7-2-1-1;#7-2-1;fmt/5;format;;
+;#7-3;#7;h264;extension;;
+;#7-3-1;#7-3;video/h264;type_mime;;
+;#7-3-1-1;#7-3-1;fmt/???;format;;
+;#7-4;#7;m2t;extension;;
+;#7-4-1;#7-4;video/MP2T;type_mime;;
+;#7-4-1-1;#7-4-1;fmt/???;format;;
+;#7-5;#7;m4v;extension;;
+;#7-5-1;#7-5;video/x-m4v;type_mime;;
+;#7-5-1-1;#7-5-1;fmt/???;format;;
+;#7-6;#7;mkv;extension;;
+;#7-6-1;#7-6;video/x-matroska;type_mime;;
+;#7-6-1-1;#7-6-1;fmt/569;format;;
+;#7-7;#7;mp4;extension;;
+;#7-7-1;#7-7;video/mp4;type_mime;;
+;#7-7-1-1;#7-7-1;fmt/199;format;;
+;#7-7-1-2;#7-7-1;fmt/596;format;;
+;#7-8;#7;mts;extension;;
+;#7-8-1;#7-8;video/MP2T;type_mime;;
+;#7-8-1-1;#7-8-1;fmt/???;format;;
+;#7-9;#7;ogv;extension;;
+;#7-9-1;#7-9;video/ogg;type_mime;;
+;#7-9-1-1;#7-9-1;fmt/944;format;;
+;#7-9-1-2;#7-9-1;fmt/945;format;;
+;#7-10;#7;webm;extension;;
+;#7-10-1;#7-10;video/webm;type_mime;;
+;#7-10-1-1;#7-10-1;fmt/573;format;;


More information about the saem-devel mailing list