Skip to content

Commit

Permalink
Fix gephi#1719 Incorrect graph import from GraphML file
Browse files Browse the repository at this point in the history
  • Loading branch information
eduramiba committed Jun 29, 2017
1 parent 079cbd2 commit ffa25a1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public class ImporterGraphML implements FileImporter, LongTask {
public ImporterGraphML() {
//Default node associations
properties.addNodePropertyAssociation(NodeProperties.LABEL, "label");
properties.addNodePropertyAssociation(NodeProperties.LABEL, "d3"); // Default node label used by yEd from yworks.com.
properties.addNodePropertyAssociation(NodeProperties.X, "x");
properties.addNodePropertyAssociation(NodeProperties.Y, "y");
properties.addNodePropertyAssociation(NodeProperties.X, "xpos");
Expand All @@ -123,7 +122,6 @@ public ImporterGraphML() {
//Default edge associations
properties.addEdgePropertyAssociation(EdgeProperties.LABEL, "label");
properties.addEdgePropertyAssociation(EdgeProperties.LABEL, "edgelabel");
properties.addEdgePropertyAssociation(EdgeProperties.LABEL, "d7"); // Default edge label used by yEd from yworks.com.
properties.addEdgePropertyAssociation(EdgeProperties.WEIGHT, "weight");
properties.addEdgePropertyAssociation(EdgeProperties.WEIGHT, "Edge Weight");
properties.addEdgePropertyAssociation(EdgeProperties.ID, "id");
Expand All @@ -132,6 +130,9 @@ public ImporterGraphML() {
properties.addEdgePropertyAssociation(EdgeProperties.G, "g");
properties.addEdgePropertyAssociation(EdgeProperties.B, "b");
properties.addEdgePropertyAssociation(EdgeProperties.COLOR, "color");

nodePropertiesAttributes.put("d3", NodeProperties.LABEL);// Default node label used by yEd from yworks.com.
edgePropertiesAttributes.put("d7", EdgeProperties.LABEL);// Default edge label used by yEd from yworks.com.
}

@Override
Expand Down Expand Up @@ -672,7 +673,9 @@ private void readAttribute(XMLStreamReader reader) throws Exception {
column = container.addNodeColumn(id, attributeType);
column.setTitle(title);
report.log(NbBundle.getMessage(ImporterGraphML.class, "importerGraphML_log_nodeattribute", title, attributeType.getCanonicalName()));
} else if ("edge".equalsIgnoreCase(forStr) || "all".equalsIgnoreCase(forStr)) {
}

if ("edge".equalsIgnoreCase(forStr) || "all".equalsIgnoreCase(forStr)) {
if (container.getEdgeColumn(id) != null) {
report.log(NbBundle.getMessage(ImporterGraphML.class, "importerGraphML_error_attributecolumn_exist", id));
return;
Expand Down

0 comments on commit ffa25a1

Please sign in to comment.