# HG changeset patch # User casties # Date 1501607446 -7200 # Node ID 4f833d8fc383b05b26d46dfdbf69b71d7431c2e4 # Parent be1c7d6814b63f0fc3aa58aac10b77f2cb8738fd add public bit as attribute _public. diff -r be1c7d6814b6 -r 4f833d8fc383 importFromOpenMind/importer/ismixml2model.py --- a/importFromOpenMind/importer/ismixml2model.py Mon Jul 10 17:18:39 2017 +0200 +++ b/importFromOpenMind/importer/ismixml2model.py Tue Aug 01 19:10:46 2017 +0200 @@ -153,15 +153,21 @@ # ignore other content types continue + # # process base attributes + # + # type oc = ent_elem.get('object-class') - - # set type attrs[node_type_attribute] = fixName(oc) - + + # id ismi_id = int(ent_elem.get('id')) # rename id to ismi_id attrs['ismi_id'] = ismi_id + + # public + pub = ent_elem.get('public') + attrs['_public'] = (pub == 'true') if len(ov) > 0: # save ov as label @@ -262,10 +268,15 @@ #if len(ov) > 0: # # own value of relation is not useful # attrs['ov'] = ov - + + # set type attrs[rel_type_attribute] = fixName(rel_name) + # set id attrs['ismi_id'] = rel_id - #log('DEBUG', "new edge(%s, %s, %s)"%(src_id, tar_id, attrs)) + # set public + pub = rel_elem.get('public') + attrs['_public'] = (pub == 'true') + # create relation with type nx_rel = nx_graph.add_edge(src_id, tar_id, attr_dict=attrs)