Inserts or extracts attributes from GraphML files using CSV files. This provides a convenient way to access GraphML attributes. All types of attributes (graph, vertex and edge) are supported. The component can be used to insert new attributes, extract old attributes, or both.
If the input files vertexAttributes or edgeAttributes are present, their attributes are inserted into the graph. As output, the updated graph is produced. If no attributes are inserted, the output graph is equal to the input graph.
The attributes output files (graphAttributes, vertexAttributes and edgeAttributes) contain all graph/vertex/edge attributes of the output graph in CSV format.
Note: currently, the updated GraphML file contains different vertex/edge id values than the original file: vertices are named "n0", "n1", etc. The original values can be accessed using the vertex attribute "originalID".
Version | 1.1 |
---|---|
Bundle | tools |
Categories | Graph |
Authors | Kristian Ovaska (kristian.ovaska@helsinki.fi), Marko Laakso (Marko.Laakso@Helsinki.FI) |
Issue tracker | View/Report issues |
Requires | igraph (R-package) |
Source files | component.xml GraphAnnotator.r |
Usage | Example with default values |
Name | Type | Mandatory | Description |
---|---|---|---|
graph | GraphML | Mandatory | Input graph |
graphAttributes | CSV | Optional | Graph attributes that are to be inserted into the graph. The first column contains the name of the attribute and the second column the value. If an attribute is already present in the graph, it is replaced. |
vertexAttributes | CSV | Optional | Vertex attributes that are to be inserted into the graph. The first column contains the vertex ID and other columns contain the attributes so that the column name determines the name of the attribute. If an attribute is already present in the graph, it is replaced. |
edgeAttributes | CSV | Optional | Vertex attributes that are to be inserted into the graph. The first two columns identify the edge so that the first column is the source vertex and the second column is the target vertex. For undirected graphs, edges (v1, v2) and (v2, v1) are equal. The other columns contain the attributes so that the column name determines the name of the attribute. If an attribute is already present in the graph, it is replaced. |
Name | Type | Description |
---|---|---|
graph | GraphML | Updated graph. If no attributes were inserted, this is equal to the input graph. |
graphAttributes | AnnotationTable | Graph attributes of the output graph. The format is similar to the correspondingly named input. |
vertexAttributes | AnnotationTable | Vertex attributes of the output graph. The format is similar to the correspondingly named input. |
edgeAttributes | AnnotationTable | Edge attributes of the output graph. The format is similar to the correspondingly named input. |
Name | Type | Default | Description |
---|---|---|---|
idAttrib | string | "id" | Name of the vertex attribute that is used to map them to their annotations |