[schema] Use 1 as default cardinality for seda elements
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 31 Aug 2017 16:03:55 +0200
changeset 2669 a88e6cc83189
parent 2668 43b999d7ecd1
child 2670 a671735e9217
[schema] Use 1 as default cardinality for seda elements This has several advantages: * it's consistent with xsd/rng defaults * it simplifies code * it may avoid undesired validation error once #17098404 will be fixed This requires several test update, fixed by a mix of test case update or expected data update to minimize the changes. Related to #17098404
cubicweb_seda/schema/seda2.py
cubicweb_seda/xsd2yams.py
test/test_profile_generation.py
--- a/cubicweb_seda/schema/seda2.py	Thu Aug 31 11:12:38 2017 +0200
+++ b/cubicweb_seda/schema/seda2.py	Thu Aug 31 16:03:55 2017 +0200
@@ -32,7 +32,7 @@
     u""""""
 
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAComment(EntityType):
     u""""""
@@ -48,7 +48,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDASignature(EntityType):
     u""""""
@@ -63,7 +63,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAArchivalAgreement(EntityType):
     u""""""
@@ -79,7 +79,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDARelatedTransferReference(EntityType):
     u""""""
@@ -94,7 +94,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDATransferRequestReplyIdentifier(EntityType):
     u""""""
@@ -127,7 +127,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAMessageDigestAlgorithmCodeListVersion(EntityType):
     u""""""
@@ -151,7 +151,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAMimeTypeCodeListVersion(EntityType):
     u""""""
@@ -175,7 +175,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAEncodingCodeListVersion(EntityType):
     u""""""
@@ -199,7 +199,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAFileFormatCodeListVersion(EntityType):
     u""""""
@@ -223,7 +223,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACompressionAlgorithmCodeListVersion(EntityType):
     u""""""
@@ -247,7 +247,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADataObjectVersionCodeListVersion(EntityType):
     u""""""
@@ -271,7 +271,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAStorageRuleCodeListVersion(EntityType):
     u""""""
@@ -295,7 +295,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAppraisalRuleCodeListVersion(EntityType):
     u""""""
@@ -319,7 +319,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAccessRuleCodeListVersion(EntityType):
     u""""""
@@ -343,7 +343,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADisseminationRuleCodeListVersion(EntityType):
     u""""""
@@ -367,7 +367,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAReuseRuleCodeListVersion(EntityType):
     u""""""
@@ -391,7 +391,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAClassificationRuleCodeListVersion(EntityType):
     u""""""
@@ -415,7 +415,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAcquisitionInformationCodeListVersion(EntityType):
     u""""""
@@ -439,7 +439,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDARelationshipCodeListVersion(EntityType):
     u""""""
@@ -463,7 +463,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDABinaryDataObject(EntityType):
     u""""""
@@ -479,7 +479,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAPhysicalDataObject(EntityType):
     u""""""
@@ -494,7 +494,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDARelationship(EntityType):
     u""""""
@@ -509,7 +509,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADataObjectVersion(EntityType):
     u""""""
@@ -548,7 +548,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACompressed(EntityType):
     u""""""
@@ -573,7 +573,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAArchiveUnit(EntityType):
     u""""""
@@ -588,7 +588,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAServiceLevel(EntityType):
     u""""""
@@ -604,7 +604,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAcquisitionInformation(EntityType):
     u""""""
@@ -628,7 +628,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, EXISTS(CACLV seda_acquisition_information_code_list_version_from AT,        CACLV seda_acquisition_information_code_list_version_to CS,       S container AT) OR EXISTS(S container AU, AU is SEDAArchiveUnit, CS scheme_relation_type RT,            RT name "seda_acquisition_information_to")')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDALegalStatus(EntityType):
     u""""""
@@ -652,7 +652,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_legal_status_to"')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAOriginatingAgencyIdentifier(EntityType):
     u""""""
@@ -668,7 +668,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDASubmissionAgencyIdentifier(EntityType):
     u""""""
@@ -684,7 +684,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAStorageRule(EntityType):
     u""""""
@@ -699,7 +699,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAppraisalRule(EntityType):
     u""""""
@@ -714,7 +714,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAccessRule(EntityType):
     u""""""
@@ -729,7 +729,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADisseminationRule(EntityType):
     u""""""
@@ -744,7 +744,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAReuseRule(EntityType):
     u""""""
@@ -759,7 +759,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAClassificationRule(EntityType):
     u""""""
@@ -775,7 +775,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDANeedAuthorization(EntityType):
     u""""""
@@ -872,7 +872,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CACLV seda_compression_algorithm_code_list_version_from AT, CACLV seda_compression_algorithm_code_list_version_to CS,S container AT')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAFormatLitteral(EntityType):
     u""""""
@@ -888,7 +888,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAMimeType(EntityType):
     u""""""
@@ -912,7 +912,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, EXISTS(CACLV seda_mime_type_code_list_version_from AT,        CACLV seda_mime_type_code_list_version_to CS,       S container AT) OR EXISTS(S container AU, AU is SEDAArchiveUnit, CS scheme_relation_type RT,            RT name "seda_mime_type_to")')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAFormatId(EntityType):
     u""""""
@@ -936,7 +936,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CACL seda_file_format_code_list_version_from AT, CACL seda_file_format_code_list_version_to CS, S container AT')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAEncoding(EntityType):
     u""""""
@@ -960,7 +960,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, EXISTS(CACLV seda_encoding_code_list_version_from AT,        CACLV seda_encoding_code_list_version_to CS,       S container AT) OR EXISTS(S container AU, AU is SEDAArchiveUnit, CS scheme_relation_type RT,            RT name "seda_encoding_to")')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACreatingApplicationName(EntityType):
     u""""""
@@ -976,7 +976,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACreatingApplicationVersion(EntityType):
     u""""""
@@ -992,7 +992,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADateCreatedByApplication(EntityType):
     u""""""
@@ -1007,7 +1007,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACreatingOs(EntityType):
     u""""""
@@ -1023,7 +1023,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACreatingOsVersion(EntityType):
     u""""""
@@ -1039,7 +1039,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDALastModified(EntityType):
     u""""""
@@ -1054,7 +1054,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAWidth(EntityType):
     u""""""
@@ -1069,7 +1069,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAHeight(EntityType):
     u""""""
@@ -1084,7 +1084,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADepth(EntityType):
     u""""""
@@ -1099,7 +1099,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAShape(EntityType):
     u""""""
@@ -1114,7 +1114,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADiameter(EntityType):
     u""""""
@@ -1129,7 +1129,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDALength(EntityType):
     u""""""
@@ -1144,7 +1144,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAThickness(EntityType):
     u""""""
@@ -1159,7 +1159,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAWeight(EntityType):
     u""""""
@@ -1174,7 +1174,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDANumberOfPage(EntityType):
     u""""""
@@ -1243,7 +1243,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAltStorageRulePreventInheritance(EntityType):
     u""""""
@@ -1282,7 +1282,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAltAppraisalRulePreventInheritance(EntityType):
     u""""""
@@ -1321,7 +1321,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAltAccessRulePreventInheritance(EntityType):
     u""""""
@@ -1351,7 +1351,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAltDisseminationRulePreventInheritance(EntityType):
     u""""""
@@ -1381,7 +1381,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAltReuseRulePreventInheritance(EntityType):
     u""""""
@@ -1411,7 +1411,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAltClassificationRulePreventInheritance(EntityType):
     u""""""
@@ -1435,7 +1435,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_classification_level"')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAClassificationReassessingDate(EntityType):
     u""""""
@@ -1450,7 +1450,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDANeedReassessingAuthorization(EntityType):
     u""""""
@@ -1475,7 +1475,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDADataObjectReference(EntityType):
     u""""""
@@ -1616,7 +1616,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_description_level"')]
 
-@seda_profile_element(cardinalities=['1..n', '1'], default_cardinality='1..n',
+@seda_profile_element(cardinalities=['1..n', '1'], default_cardinality='1',
                       annotable=True)
 class SEDATitle(EntityType):
     u""""""
@@ -1632,7 +1632,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAFilePlanPosition(EntityType):
     u""""""
@@ -1648,7 +1648,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDASystemId(EntityType):
     u""""""
@@ -1663,7 +1663,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAOriginatingSystemId(EntityType):
     u""""""
@@ -1678,7 +1678,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAArchivalAgencyArchiveUnitIdentifier(EntityType):
     u""""""
@@ -1694,7 +1694,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAOriginatingAgencyArchiveUnitIdentifier(EntityType):
     u""""""
@@ -1710,7 +1710,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDATransferringAgencyArchiveUnitIdentifier(EntityType):
     u""""""
@@ -1726,7 +1726,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDADescription(EntityType):
     u""""""
@@ -1742,7 +1742,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAType(EntityType):
     u""""""
@@ -1766,7 +1766,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_type_to"')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADocumentType(EntityType):
     u""""""
@@ -1782,7 +1782,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDALanguage(EntityType):
     u""""""
@@ -1806,7 +1806,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_language_to"')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDADescriptionLanguage(EntityType):
     u""""""
@@ -1830,7 +1830,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_description_language_to"')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAStatus(EntityType):
     u""""""
@@ -1846,7 +1846,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAVersion(EntityType):
     u""""""
@@ -1862,7 +1862,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDATag(EntityType):
     u""""""
@@ -1878,7 +1878,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAKeyword(EntityType):
     u""""""
@@ -1894,7 +1894,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAOriginatingAgency(EntityType):
     u""""""
@@ -1918,7 +1918,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDASubmissionAgency(EntityType):
     u""""""
@@ -1942,7 +1942,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAuthorizedAgent(EntityType):
     u""""""
@@ -1966,7 +1966,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAWriter(EntityType):
     u""""""
@@ -1990,7 +1990,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAAddressee(EntityType):
     u""""""
@@ -2014,7 +2014,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDARecipient(EntityType):
     u""""""
@@ -2038,7 +2038,7 @@
     inlined = False
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDASource(EntityType):
     u""""""
@@ -2054,7 +2054,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACreatedDate(EntityType):
     u""""""
@@ -2069,7 +2069,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDATransactedDate(EntityType):
     u""""""
@@ -2084,7 +2084,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAAcquiredDate(EntityType):
     u""""""
@@ -2099,7 +2099,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDASentDate(EntityType):
     u""""""
@@ -2114,7 +2114,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAReceivedDate(EntityType):
     u""""""
@@ -2129,7 +2129,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDARegisteredDate(EntityType):
     u""""""
@@ -2159,7 +2159,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAEndDate(EntityType):
     u""""""
@@ -2174,7 +2174,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAEvent(EntityType):
     u""""""
@@ -2232,7 +2232,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['1..n', '1'], default_cardinality='1..n',
+@seda_profile_element(cardinalities=['1..n', '1'], default_cardinality='1',
                       annotable=True)
 class SEDARefNonRuleId(EntityType):
     u""""""
@@ -2301,7 +2301,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CACLV seda_classification_rule_code_list_version_from AT, CACLV seda_classification_rule_code_list_version_to CS,S container AT')]
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDACustodialHistoryItem(EntityType):
     u""""""
@@ -2317,7 +2317,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDACustodialHistoryFile(EntityType):
     u""""""
@@ -2356,7 +2356,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, S seda_keyword_reference_to_scheme CS')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAKeywordType(EntityType):
     u""""""
@@ -2380,7 +2380,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_keyword_type_to"')]
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDASpatial(EntityType):
     u""""""
@@ -2396,7 +2396,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDATemporal(EntityType):
     u""""""
@@ -2412,7 +2412,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAJuridictional(EntityType):
     u""""""
@@ -2428,7 +2428,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAIsVersionOf(EntityType):
     u""""""
@@ -2443,7 +2443,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAReplaces(EntityType):
     u""""""
@@ -2458,7 +2458,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDARequires(EntityType):
     u""""""
@@ -2473,7 +2473,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAIsPartOf(EntityType):
     u""""""
@@ -2488,7 +2488,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '0..n', '1', '1..n'], default_cardinality='1',
                       annotable=True)
 class SEDAReferences(EntityType):
     u""""""
@@ -2503,7 +2503,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAEventIdentifier(EntityType):
     u""""""
@@ -2518,7 +2518,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAEventType(EntityType):
     u""""""
@@ -2542,7 +2542,7 @@
     inlined = True
     constraints = [RQLConstraint('O in_scheme CS, CS scheme_relation_type CR, CR name "seda_event_type_to"')]
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAEventDetail(EntityType):
     u""""""
@@ -2557,7 +2557,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsVersionID(EntityType):
     u""""""
@@ -2572,7 +2572,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsAltitude(EntityType):
     u""""""
@@ -2587,7 +2587,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsAltitudeRef(EntityType):
     u""""""
@@ -2602,7 +2602,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsLatitude(EntityType):
     u""""""
@@ -2617,7 +2617,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsLatitudeRef(EntityType):
     u""""""
@@ -2632,7 +2632,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsLongitude(EntityType):
     u""""""
@@ -2647,7 +2647,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsLongitudeRef(EntityType):
     u""""""
@@ -2662,7 +2662,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAGpsDateStamp(EntityType):
     u""""""
@@ -2677,7 +2677,7 @@
     inlined = True
     constraints = []
 
-@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='0..1',
+@seda_profile_element(cardinalities=['0..1', '1'], default_cardinality='1',
                       annotable=True)
 class SEDAwhen(EntityType):
     u""""""
--- a/cubicweb_seda/xsd2yams.py	Thu Aug 31 11:12:38 2017 +0200
+++ b/cubicweb_seda/xsd2yams.py	Thu Aug 31 16:03:55 2017 +0200
@@ -207,14 +207,6 @@
 RTYPE_CARD = {
     'seda_custodial_history_item': '*',
 }
-DEFAULT_USER_CARDINALITY = {
-    'SEDAStartDate': '1',
-    'SEDAKeywordReference': '1',
-}
-for rule_type in RULE_TYPES:
-    etype = 'SEDASeq{0}RuleRule'.format(rule_type.capitalize())
-    DEFAULT_USER_CARDINALITY[etype] = '1'
-
 _CARD_TO_CARDS = {
     '1': ['1'],
     '?': ['0..1', '1'],
@@ -518,7 +510,7 @@
         if mapping.cards:
             cards = mapping.cards
             annotable = len(cards) > 1
-            default_card = DEFAULT_USER_CARDINALITY.get(mapping.etype, cards[0])
+            default_card = '1'
             code = '''\
 @seda_profile_element(cardinalities={cards}, default_cardinality='{default_card}',
                       annotable={annotable})
--- a/test/test_profile_generation.py	Thu Aug 31 11:12:38 2017 +0200
+++ b/test/test_profile_generation.py	Thu Aug 31 16:03:55 2017 +0200
@@ -366,7 +366,7 @@
 
             profile = self.profile_etree(transfer)
             fileinfo = self.get_element(profile, 'FileInfo')
-            self.assertElementDefinition(fileinfo, {'name': 'FileInfo', 'minOccurs': '0'})
+            self.assertElementDefinition(fileinfo, {'name': 'FileInfo'})
 
             appname.cw_set(user_cardinality=u'1')
             profile = self.profile_etree(transfer)
@@ -388,7 +388,7 @@
 
             profile = self.profile_etree(transfer)
             fileinfo = self.get_element(profile, 'DataObjectPackage')
-            self.assertElementDefinition(fileinfo, {'name': 'DataObjectPackage', 'minOccurs': '0'})
+            self.assertElementDefinition(fileinfo, {'name': 'DataObjectPackage'})
 
             bdo.cw_set(user_cardinality=u'1')
             profile = self.profile_etree(transfer)
@@ -434,8 +434,7 @@
             cnx.create_entity('SEDASignature', seda_signature=transfer)
             profile = self.profile_etree(transfer)
             signature = self.get_element(profile, 'Signature')
-            self.assertElementDefinition(signature, {'name': 'Signature', 'type': 'OpenType',
-                                                     'minOccurs': '0'})
+            self.assertElementDefinition(signature, {'name': 'Signature', 'type': 'OpenType'})
             self.assertOpenTypeIsDefined(profile)
 
     def test_keyword(self):
@@ -464,8 +463,7 @@
             kwt = self.get_element(profile, 'KeywordType')
             self.assertElementDefinition(kwt, {'name': 'KeywordType',
                                                'type': 'xsd:token',
-                                               'fixed': 'theme',
-                                               'minOccurs': '0'})
+                                               'fixed': 'theme'})
             self.assertXSDAttributes(
                 kwt,
                 [{'name': 'listVersionID', 'fixed': 'seda_keyword_type_to/None vocabulary'}])
@@ -513,8 +511,7 @@
             mt_clv = self.get_element(profile, 'MimeTypeCodeListVersion')
             self.assertElementDefinition(mt_clv, {'name': 'MimeTypeCodeListVersion',
                                                   'fixed': scheme.cwuri,
-                                                  'type': 'xsd:token',
-                                                  'minOccurs': '0'})
+                                                  'type': 'xsd:token'})
             # XXX also fix listSchemeURI ?
             self.assertXSDAttributes(
                 mt_clv,
@@ -583,22 +580,30 @@
             some_concept = scheme.add_concept(label=u'md5', language_code=u'de')
 
             transfer = create('SEDAArchiveTransfer', title=u'test profile')
-            cnx.create_entity('SEDAMessageDigestAlgorithmCodeListVersion',
-                              seda_message_digest_algorithm_code_list_version_from=transfer,
-                              seda_message_digest_algorithm_code_list_version_to=scheme)
-            cnx.create_entity('SEDAFileFormatCodeListVersion',
-                              seda_file_format_code_list_version_from=transfer)
-            create('SEDAMimeTypeCodeListVersion', seda_mime_type_code_list_version_from=transfer,
+            create('SEDAMessageDigestAlgorithmCodeListVersion',
+                   seda_message_digest_algorithm_code_list_version_from=transfer,
+                   seda_message_digest_algorithm_code_list_version_to=scheme)
+            create('SEDAFileFormatCodeListVersion',
+                   seda_file_format_code_list_version_from=transfer)
+            create('SEDAMimeTypeCodeListVersion',
+                   user_cardinality=u'0..1',
+                   seda_mime_type_code_list_version_from=transfer,
                    seda_mime_type_code_list_version_to=scheme)
-            access_rule = create('SEDAAccessRule', seda_access_rule=transfer)
+            access_rule = create('SEDAAccessRule',
+                                 user_cardinality=u'0..1',
+                                 seda_access_rule=transfer)
             access_rule_seq = create('SEDASeqAccessRuleRule',
                                      reverse_seda_seq_access_rule_rule=access_rule)
             create('SEDAStartDate', user_cardinality=u'0..1', seda_start_date=access_rule_seq)
             # binary data object
             bdo = testutils.create_data_object(transfer, user_cardinality=u'0..n',
                                                seda_algorithm=some_concept)
-            create('SEDAFormatLitteral', seda_format_litteral=bdo)
-            create('SEDAEncoding', seda_encoding_from=bdo)
+            create('SEDAFormatLitteral',
+                   user_cardinality=u'0..1',
+                   seda_format_litteral=bdo)
+            create('SEDAEncoding',
+                   user_cardinality=u'0..1',
+                   seda_encoding_from=bdo)
             create('SEDAUri', seda_uri=bdo.seda_alt_binary_data_object_attachment)
             # first level archive unit
             unit, unit_alt, unit_alt_seq = testutils.create_archive_unit(
@@ -620,7 +625,9 @@
             create('SEDAKeywordReference', seda_keyword_reference_from=kw)
             history_item = create('SEDACustodialHistoryItem',
                                   seda_custodial_history_item=unit_alt_seq)
-            create('SEDAwhen', seda_when=history_item)
+            create('SEDAwhen',
+                   user_cardinality=u'0..1',
+                   seda_when=history_item)
             version_of = create('SEDAIsVersionOf', seda_is_version_of=unit_alt_seq)
             alt2 = create('SEDAAltIsVersionOfArchiveUnitRefId',
                           reverse_seda_alt_is_version_of_archive_unit_ref_id=version_of)
@@ -731,6 +738,7 @@
                                          user_annotation=u"C'est dans 10ans je m'en irai",
                                          reverse_seda_start_date=create('SEDAStartDate'))
             create('SEDAAppraisalRule',
+                   user_cardinality=u'0..1',
                    seda_appraisal_rule=transfer,
                    seda_final_action=concepts['detruire'],
                    seda_seq_appraisal_rule_rule=appraisal_rule_rule,
@@ -741,9 +749,11 @@
 
             unit_alt_seq.cw_set(reverse_seda_start_date=create('SEDAStartDate',
                                                                user_cardinality=u'0..1'),
-                                reverse_seda_end_date=create('SEDAEndDate'),
+                                reverse_seda_end_date=create('SEDAEndDate',
+                                                             user_cardinality=u'0..1'),
                                 # XXX, value=date(2015, 2, 24)),
-                                reverse_seda_description=create('SEDADescription'))
+                                reverse_seda_description=create('SEDADescription',
+                                                                user_cardinality=u'0..1'))
 
             kw = create('SEDAKeyword',
                         user_cardinality=u'0..n',
@@ -753,26 +763,35 @@
                    seda_keyword_reference_to=concepts['file'],
                    seda_keyword_reference_to_scheme=concepts['file'].scheme)
             create('SEDAKeywordType',
-                   seda_keyword_type_from=kw,
-                   user_cardinality=u'0..1')
+                   user_cardinality=u'0..1',
+                   seda_keyword_type_from=kw)
 
-            create('SEDAOriginatingAgency', seda_originating_agency_from=unit_alt_seq,
+            create('SEDAOriginatingAgency',
+                   user_cardinality=u'0..1',
+                   seda_originating_agency_from=unit_alt_seq,
                    seda_originating_agency_to=agent)
 
-            create('SEDAType', seda_type_from=unit_alt_seq,
+            create('SEDAType',
+                   user_cardinality=u'0..1',
+                   seda_type_from=unit_alt_seq,
                    seda_type_to=concepts['CDO'])
 
-            create('SEDACustodialHistoryItem', seda_custodial_history_item=unit_alt_seq,
-                   reverse_seda_when=create('SEDAwhen'))
+            create('SEDACustodialHistoryItem',
+                   user_cardinality=u'0..1',
+                   seda_custodial_history_item=unit_alt_seq,
+                   reverse_seda_when=create('SEDAwhen',
+                                            user_cardinality=u'0..1'))
 
             # Add sub archive unit
             _, _, subunit_alt_seq = testutils.create_archive_unit(unit_alt_seq,
                                                                   user_cardinality=u'1..n')
 
             create('SEDAAppraisalRule',
+                   user_cardinality=u'0..1',
                    seda_appraisal_rule=subunit_alt_seq,
                    seda_seq_appraisal_rule_rule=create(
-                       'SEDASeqAppraisalRuleRule', reverse_seda_start_date=create('SEDAStartDate')))
+                       'SEDASeqAppraisalRuleRule',
+                       reverse_seda_start_date=create('SEDAStartDate')))
 
             create('SEDAAccessRule',
                    user_cardinality=u'1',
@@ -783,7 +802,9 @@
                                                     seda_rule=concepts['AR038']))
 
             # Add minimal document to first level archive
-            ref = create('SEDADataObjectReference', seda_data_object_reference=unit_alt_seq)
+            ref = create('SEDADataObjectReference',
+                         user_cardinality=u'0..1',
+                         seda_data_object_reference=unit_alt_seq)
             bdo = testutils.create_data_object(transfer, user_cardinality=u'0..n',
                                                filename=u'this_is_the_filename.pdf',
                                                seda_algorithm=concepts['md5'],
@@ -883,11 +904,15 @@
                    seda_transferring_agency_archive_unit_identifier=unit_alt_seq)
             create('SEDAStartDate', seda_start_date=unit_alt_seq)
             create('SEDAEndDate', seda_end_date=unit_alt_seq)
-            appraisal_rule = create('SEDAAppraisalRule', seda_appraisal_rule=unit_alt_seq)
+            appraisal_rule = create('SEDAAppraisalRule',
+                                    user_cardinality=u'0..1',
+                                    seda_appraisal_rule=unit_alt_seq)
             appraisal_rule_seq = create('SEDASeqAppraisalRuleRule',
                                         reverse_seda_seq_appraisal_rule_rule=appraisal_rule)
             create('SEDAStartDate', seda_start_date=appraisal_rule_seq)
-            access_rule = create('SEDAAccessRule', seda_access_rule=unit_alt_seq)
+            access_rule = create('SEDAAccessRule',
+                                 user_cardinality=u'0..1',
+                                 seda_access_rule=unit_alt_seq)
             access_rule_seq = create('SEDASeqAccessRuleRule',
                                      reverse_seda_seq_access_rule_rule=access_rule)
             create('SEDAStartDate', seda_start_date=access_rule_seq)