@@ -102,7 +102,7 @@ public boolean setAttributeValue(Object value, Element row, Column column) {
102102 if (value != null && !value .getClass ().equals (targetType )) {
103103 try {
104104 GraphModel graphModel = column .getTable ().getGraph ().getModel ();
105-
105+
106106 String stringValue = AttributeUtils .print (value , graphModel .getTimeFormat (), graphModel .getTimeZone ());
107107 value = AttributeUtils .parse (stringValue , targetType );//Try to convert to target type from string representation
108108 } catch (Exception ex ) {
@@ -691,7 +691,7 @@ public void importCSVToNodesTable(Graph graph, File file, Character separator, C
691691 } finally {
692692 graph .readUnlockAll ();
693693 graph .writeUnlock ();
694-
694+
695695 if (reader != null ) {
696696 reader .close ();
697697 }
@@ -838,13 +838,15 @@ public void importCSVToEdgesTable(Graph graph, File file, Character separator, C
838838 }
839839 } else {
840840 edge = graph .getEdge (source , target );
841- if (edge == null ) {
841+ if (edge == null && ! directed ) {
842842 //Not from source to target but undirected and reverse?
843843 edge = graph .getEdge (target , source );
844- if (edge != null && edge .isDirected ()) {
845- edge = null ;//Cannot use it since it's actually directed
846- }
847844 }
845+
846+ if (edge != null && edge .isDirected () != directed ) {
847+ edge = null ;//Cannot use it since directedness is different
848+ }
849+
848850 if (edge != null ) {
849851 //Increase non dynamic edge weight with specified weight (if specified), else increase by 1:
850852 if (!isDynamicWeight ) {
@@ -856,12 +858,24 @@ public void importCSVToEdgesTable(Graph graph, File file, Character separator, C
856858 } catch (NumberFormatException numberFormatException ) {
857859 //Not valid weight, add 1
858860 edge .setWeight (edge .getWeight () + 1 );
861+
862+ Logger .getLogger ("" ).log (
863+ Level .WARNING ,
864+ "Could not parse weight {0}, adding 1" ,
865+ weight
866+ );
859867 }
860868 } else {
861869 //Add 1 (weight not specified)
862870 edge .setWeight (edge .getWeight () + 1 );
863871 }
864872 }
873+ } else {
874+ Logger .getLogger ("" ).log (
875+ Level .WARNING ,
876+ "Could not add edge [source = {0}, target = {1}, directed = {2}] to the graph and could not find the existing edge to add its weight" ,
877+ new Object []{source .getId (), target .getId (), directed }
878+ );
865879 }
866880 }
867881 }
@@ -872,7 +886,7 @@ public void importCSVToEdgesTable(Graph graph, File file, Character separator, C
872886 } finally {
873887 graph .readUnlockAll ();
874888 graph .writeUnlock ();
875-
889+
876890 if (reader != null ) {
877891 reader .close ();
878892 }
@@ -918,10 +932,10 @@ public List<List<Node>> detectNodeDuplicatesByColumn(Column column, boolean case
918932 Graph graph = Lookup .getDefault ().lookup (GraphController .class ).getGraphModel ().getGraph ();
919933 Object value ;
920934 String strValue ;
921-
935+
922936 TimeFormat timeFormat = graph .getModel ().getTimeFormat ();
923937 DateTimeZone timeZone = graph .getModel ().getTimeZone ();
924-
938+
925939 for (Node node : graph .getNodes ().toArray ()) {
926940 value = node .getAttribute (column );
927941 if (value != null ) {
0 commit comments