Skip to content

Commit

Permalink
Merge pull request #135 from vlad902/vlad/save-more-vertex-properties
Browse files Browse the repository at this point in the history
Export all node properties and don't store empty keys
  • Loading branch information
Fabian Yamaguchi committed Dec 1, 2016
2 parents 9bda9b0 + 563433a commit 5965b0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public abstract class CSVWriterImpl implements WriterImpl {

final String[] nodeProperties = { NodeKeys.NODE_TYPE, NodeKeys.CODE,
NodeKeys.LOCATION, NodeKeys.FUNCTION_ID,
NodeKeys.CHILD_NUMBER, NodeKeys.IS_CFG_NODE };
NodeKeys.CHILD_NUMBER, NodeKeys.IS_CFG_NODE , NodeKeys.OPERATOR,
NodeKeys.BASE_TYPE, NodeKeys.COMPLETE_TYPE, NodeKeys.IDENTIFIER
};

final String[] edgeProperties = { EdgeKeys.VAR };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ private void addNodeToGraphNoReplace(String id, String[] row, String[] keys)

private void setPropertiesOnVertex(Vertex vertex, String[] row, String[] keys)
{
for(int i = 2; i < row.length; i++){
vertex.property(keys[i-1], row[i]);
for(int i = 2; i < row.length; i++) {
if (!row[i].equals(""))
vertex.property(keys[i - 1], row[i]);
}
}

Expand Down Expand Up @@ -224,7 +225,8 @@ private void importEdgeRow(String[] row)

for (int i = 3; i < row.length; i++)
{
edge.property(edgeFile.getKeys()[i], row[i]);
if (!row[i].equals(""))
edge.property(edgeFile.getKeys()[i], row[i]);
}

}
Expand Down

0 comments on commit 5965b0b

Please sign in to comment.