Up: Component summary Component

GraphAnnotator

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

Inputs

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.

Outputs

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.

Parameters

Name Type Default Description
idAttrib string "id" Name of the vertex attribute that is used to map them to their annotations

Test cases

Test case Parameters IN
graph
IN
graphAttributes
IN
vertexAttributes
IN
edgeAttributes
OUT
graph
OUT
graphAttributes
OUT
vertexAttributes
OUT
edgeAttributes
case1 (missing) graph (missing) (missing) (missing) graph graphAttributes vertexAttributes edgeAttributes
case2_no_ann (missing) graph (missing) (missing) (missing) graph graphAttributes vertexAttributes edgeAttributes
case3_empty (missing) graph (missing) (missing) (missing) graph graphAttributes vertexAttributes edgeAttributes
case4_import (missing) graph graphAttributes vertexAttributes edgeAttributes graph graphAttributes vertexAttributes edgeAttributes
case5_import_directed (missing) graph graphAttributes vertexAttributes edgeAttributes graph graphAttributes vertexAttributes edgeAttributes
case6_numeric_id (missing) graph graphAttributes vertexAttributes edgeAttributes graph graphAttributes vertexAttributes edgeAttributes
case7_idattrib properties graph (missing) vertexAttributes edgeAttributes graph graphAttributes vertexAttributes edgeAttributes

idAttrib = name

case8_onerow (missing) graph graphAttributes vertexAttributes edgeAttributes graph graphAttributes vertexAttributes edgeAttributes
case9_keys (missing) graph (missing) (missing) (missing) (missing) (missing) vertexAttributes edgeAttributes

Generated 2019-02-08 07:42:16 by Anduril 2.0.0