changeset 58:4f833d8fc383

add public bit as attribute _public.
author casties
date Tue, 01 Aug 2017 19:10:46 +0200
parents be1c7d6814b6
children adfb57978a69
files importFromOpenMind/importer/ismixml2model.py
diffstat 1 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)