equal
deleted
inserted
replaced
42 cardinality |
42 cardinality |
43 """ |
43 """ |
44 # compute how many entities by type we need to be able to satisfy relation constraint |
44 # compute how many entities by type we need to be able to satisfy relation constraint |
45 relmap = {} |
45 relmap = {} |
46 for rschema in schema.relations(): |
46 for rschema in schema.relations(): |
47 if rschema.meta or rschema.is_final(): # skip meta relations |
47 if rschema.is_final(): |
48 continue |
48 continue |
49 for subj, obj in rschema.iter_rdefs(): |
49 for subj, obj in rschema.iter_rdefs(): |
50 card = rschema.rproperty(subj, obj, 'cardinality') |
50 card = rschema.rproperty(subj, obj, 'cardinality') |
51 if card[0] in '1?' and len(rschema.subjects(obj)) == 1: |
51 if card[0] in '1?' and len(rschema.subjects(obj)) == 1: |
52 relmap.setdefault((rschema, subj), []).append(str(obj)) |
52 relmap.setdefault((rschema, subj), []).append(str(obj)) |