Skip to content

Supported Formats

SocNetV supports the following network data formats:

  • GraphML (.graphml or .xml)
  • GML (.gml or .xml)
  • GraphViz (.dot)
  • Adjacency Matrix (.sm, .adj, or .csv)
  • Pajek (.net, .paj, or .pajek)
  • UCINET’s Data Language (.dl)
  • Edge List (.lst or .list)
  • Weighted Lists (.wlst or .wlist)

The default network data format of SocNetV is GraphML.

If you create a new network and press Ctrl+S to save it, SocNetV will try to save it in GraphML format by default.

Loading and Importing Files

  • GraphML files can be loaded directly using File > Load or specified via the command line.

  • For other formats, use File > Import.


GraphML files

GraphML is a highly versatile and widely adopted XML-based format designed for graph data representation. SocNetV supports both reading and saving networks in GraphML format, making it an excellent choice for interoperability with other network analysis tools.

Features of GraphML

  • XML-Based: Uses XML structure to represent nodes, edges, and their attributes.
  • Custom Attributes: Allows defining custom attributes for nodes and edges, such as labels, weights, or types.
  • Directed and Undirected Graphs: Supports both directed and undirected graph structures.
  • Hierarchical Graphs: Facilitates multi-level graph representations.

Examples

Example 1: A simple GraphML File

Below is an example of a simple social network in GraphML, an undirected graph with two 11 nodes and 12 edges:

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph id="G" edgedefault="undirected">
<node id="n0"/>
<node id="n1"/>
<node id="n2"/>
<node id="n3"/>
<node id="n4"/>
<node id="n5"/>
<node id="n6"/>
<node id="n7"/>
<node id="n8"/>
<node id="n9"/>
<node id="n10"/>
<edge source="n0" target="n2"/>
<edge source="n1" target="n2"/>
<edge source="n2" target="n3"/>
<edge source="n3" target="n5"/>
<edge source="n3" target="n4"/>
<edge source="n4" target="n6"/>
<edge source="n6" target="n5"/>
<edge source="n5" target="n7"/>
<edge source="n6" target="n8"/>
<edge source="n8" target="n7"/>
<edge source="n8" target="n9"/>
<edge source="n8" target="n10"/>
</graph>
</graphml>

Explanation:

All GraphML files consist of a graphml element and a variety of sub-elements: graph, node, edge, keys. SocNetV understands all of them:

  • Nodes: Each element has an id attribute, which uniquely identifies the node. In this case, the nodes are labeled n0 through n10.

  • Edges: Each element defines a relationship between two nodes, indicated by source and target. For example, indicates an edge from node n0 to node n2.

  • Graph Structure: The graph is undirected as indicated by the edgedefault=“undirected” attribute in the element.

Here is the visualization of the above example using Mermaid, which demonstrates the directed graph structure:

graph TD n0 --> n2 n1 --> n2 n2 --> n3 n3 --> n5 n3 --> n4 n4 --> n6 n6 --> n5 n5 --> n7 n6 --> n8 n8 --> n7 n8 --> n9 n8 --> n10

And here’s the visualization of the above example using SocNetV where we have applied an FDP layout (Kamada-Kawai) for the node location and a prominence-based model (Betweenness Centrality) for the node sizes/colors:

SocNetV visualizing a simple undirected graph with two 11 nodes and 12 edges from a GraphML file

How to Use GraphML Files in SocNetV

Loading GraphML Files

To load a GraphML file in SocNetV:

  1. Go to File > Load.
  2. Select the desired .graphml file.
  3. The network will be rendered on the canvas with all its nodes, edges, and attributes.

Saving to GraphML files

To save a network as a GraphML file:

  1. Go to File > Save As.
  2. Choose the GraphML format from the list.
  3. Specify the filename and save.

Pros and Cons of GraphML

Advantages:

  • Standardized Format: As an XML-based format, GraphML is standardized and widely supported by many graph-analysis tools (such as SocNetV, Cytoscape, yEd, etc) making it easy to exchange graph data.
  • Extensible and Flexible: With support for custom attributes, GraphML is highly flexible and can describe complex networks with rich metadata.
  • Schema Validation: GraphML supports schema validation, allowing users to ensure that graph data adheres to a predefined structure, which is useful for maintaining data integrity.

Disadvantages:

  • File Size: Since GraphML is an XML-based format, it can be larger in size compared to binary formats, especially for large graphs. This can make file handling and transfer slower.
  • Complexity for Simple Graphs: For simpler, smaller networks, GraphML may be overkill compared to simpler formats like GML or CSV, which may be easier to use for basic graph tasks.
  • Parsing Overhead: Parsing XML can be more computationally expensive than parsing other formats, especially when working with large graphs, potentially affecting performance.

Reference


GML Files

GML (Graph Modeling Language) is a simple, text-based file format designed for describing graphs. It is widely used due to its human-readable structure and its ability to represent both small and large graphs in a flexible way. GML files are commonly used for storing and exchanging graph data and are supported by many graph-processing tools, including SocNetV.

Features of GML

  1. Human-readable format: GML is a text-based format that is easy to read and edit manually, making it accessible even to users without specialized graph software.
  2. Flexibility in Graph Representation: GML supports both directed and undirected graphs, as well as the inclusion of additional attributes for nodes and edges, such as labels, weights, and other custom properties.
  3. Graph-Level Properties: GML allows you to define global properties for the graph, such as directionality, making it easy to specify the overall structure of the network.

Examples

Example 1: A simple GML File

graph [
directed 1
node [
id 1
label "Alice"
]
node [
id 2
label "Bob"
]
node [
id 3
label "Charlie"
]
edge [
source 1
target 2
weight 1.0
]
edge [
source 2
target 3
weight 0.5
]
edge [
source 3
target 1
weight 2.0
]
]

Explanation

  • Nodes: Each node is defined by an id (unique identifier) and an optional label that describes the node. In this example, three nodes are defined: “Alice”, “Bob”, and “Charlie”, each with a unique ID.
  • Edges: The edges connect nodes using the source and target attributes. For example, an edge from node 1 (Alice) to node 2 (Bob) has a weight of 1.0. Similarly, other edges are defined with weights that indicate the strength of the connection.
  • Graph Properties: The directed 1 property at the beginning of the graph indicates that the graph is directed. If this value were set to 0, the graph would be undirected.

Visualization

This Mermaid diagram visualizes the directed graph described in the GML example. It captures the relationships between “Alice”, “Bob”, and “Charlie”, along with the weights assigned to the edges.

graph TD Alice -->|1.0| Bob Bob -->|0.5| Charlie Charlie -->|2.0| Alice

And here’s the visualization in SocNetV:

SocNetV visualizing a network from an example GML file

How to Use GML in SocNetV

  • Loading GML Files: In SocNetV, you can load a GML file by selecting File > Import from the menu and choosing your GML file. SocNetV will parse the file and display the network graph, preserving node labels, edge weights, and any other attributes defined in the GML.
  • Saving Networks as GML: Exporting a network from SocNetV in the GML format is not supported.

Supported GML Elements in SocNetV

SocNetV supports the following key features of GML files:

  • Graph Type: Directed (directed 1) and undirected graphs (directed 0).
  • Node Attributes: id, label, and simple custom attributes such as color or size for nodes.
  • Edge Attributes: source, target, and simple attributes like weight and color for edges.
  • Basic Graph Structure: SocNetV can handle simple graph structures with nodes and edges but does not support hierarchical elements or advanced GML features like nested graphs.

Pros and Cons of GML

Advantages:

  • Human-readable: As a text-based format, GML files are easy to read and edit by hand, making it simple to inspect and modify graph data.
  • Wide tool support: Many graph analysis tools, including SocNetV, support GML, making it a versatile format for sharing and processing graphs.
  • Flexibility: GML allows the inclusion of various attributes for both nodes and edges, making it adaptable to different types of networks.

Disadvantages:

  • Scalability Issues: For very large graphs, GML can become inefficient because it is a text-based format, leading to larger file sizes and slower parsing times compared to binary formats.
  • Limited Structure: While GML is flexible, it lacks the extensive validation or schema enforcement seen in more structured formats, which can lead to inconsistencies in large, complex graphs.
  • Manual Edits Can Be Error-Prone: While human-readable, manual edits to a GML file can easily introduce syntax errors or formatting mistakes, especially in large graphs.

Reference


GraphViz (DOT) Files

GraphViz is a graph description language that uses the “DOT format” to define and represent graphs. SocNetV supports importing GraphViz files for analysis and visualization. These files describe graphs using a simple text-based syntax, making them easy to create and edit.

Key Features

  1. Directed and Undirected Graphs: GraphViz supports both graph types using intuitive syntax (digraph for directed graphs and graph for undirected graphs). SocNetV determines the graph type directly from this declaration.
  2. Attribute Definitions: Customize nodes and edges with attributes like colors, shapes, labels, and weights to enrich graph visualizations.
  3. Hierarchical Structures: GraphViz allows defining subgraphs and clusters. SocNetV parses the graph structure but does not preserve cluster or subgraph hierarchy as structural entities.

Examples

Example 1 : A simple .dot file

digraph mydot {
node [color=red, shape=box];
a -> b -> c -> d;
node [color=pink, shape=circle];
d -> e -> a -> f -> j -> k -> l -> o [weight=1, color=black];
}
Explanation
  • Graph Type: The keyword digraph indicates a directed graph, where edges have direction. If the file begins with graph, SocNetV treats it as undirected.
  • Node Attributes: Nodes can have attributes such as color and shape. SocNetV applies supported visual attributes during import.
  • Edges: Directed edges are defined using ->, while undirected edges use --. Attributes like weight, color, and label can also be applied to edges.
  • Attribute Blocks: Default node or edge attributes declared at block level are applied to subsequent elements where supported.

Visualization:

This Mermaid diagram replicates the structure of the example GraphViz file, illustrating the directed relationships between nodes.

graph TD a --> b --> c --> d d --> e --> a --> f --> j --> k --> l --> o

In SocNetV, the same network can be visualized in many ways. For instance, in the screenshot below, we have applied a prominence-based layout (Eccentricity):

SocNetV visualizing a network from an example GraphViz file


How to Use GraphViz Files in SocNetV

  1. Loading Files: To import a GraphViz file, navigate to File > Import and select the .dot file. SocNetV will parse the graph and display it for further analysis.
  2. Visualization Options: SocNetV renders supported attributes (e.g., node colors, shapes, labels, edge weights). Unsupported or unrecognized attributes are safely ignored.
  3. Limitations: SocNetV does not support advanced GraphViz features such as full cluster layout control, subgraph hierarchy preservation, or complex attribute inheritance rules.

Supported DOT Elements in SocNetV

SocNetV supports the following core elements of GraphViz files:

  • Graph Type: digraph (directed) and graph (undirected).
  • Edge Syntax: -> for directed edges and -- for undirected edges.
  • Node Attributes: color, shape, label, and basic styles such as fillcolor and style.
  • Edge Attributes: weight, color, and label.
  • Basic Structure: Node and edge declarations are parsed and converted into SocNetV’s internal graph model.

Subgraphs and clusters may be parsed for structural correctness, but their hierarchical semantics are not preserved.


Pros and Cons of GraphViz Files

Advantages:

  • Human-Readable Syntax: Easy to create and edit with any text editor.
  • Customizable: Allows detailed customization of nodes and edges using attributes.
  • Widely Supported: Used in many visualization tools, including SocNetV.

Disadvantages:

  • Partial Feature Support: SocNetV does not implement the full DOT specification, especially advanced layout or cluster semantics.
  • Formatting Sensitivity: Requires properly formatted DOT syntax; malformed files may fail to import.
  • Visualization Complexity: Large graphs with extensive attributes can become difficult to manage and interpret.

Reference:


Summary

  • No structural changes were needed.
  • Clarified directed/undirected detection.
  • Clarified cluster/subgraph handling.
  • Clarified attribute tolerance.
  • Kept tone and structure consistent with your Pajek/GML sections.

Adjacency Matrix Files

The adjacency matrix format is a widely used format for representing one-mode networks, where each element in an NxN matrix represents the connection between nodes (or the weight). This format is simple to use and is typically employed for analyzing networks based on node relationships.

SocNetV supports adjacency matrix files in files with extensions such as .txt, .sm, .adj, and .csv.

Key Features

  • Each line in the matrix corresponds to a row, and the entries are separated by a delimiter: a space, a comma, a tab etc.
  • The value at position (i, j) in the matrix represents the weight of the edge from node i to node j. For unweighted networks, use 1 for edges and 0 for no connection.
  • Diagonal elements (self-loops) can be included but are not mandatory.
  • Directed networks can be represented by an asymmetric adjacency matrix, where the entry (i, j) differs from (j, i).

Node Labels

In addition to numeric node identifiers, SocNetV supports labeled nodes. This feature enables users to define custom node labels, making the matrix more descriptive.

Labels can be provided as follows:

  1. A header comment line at the top of the file lists the node labels, separated by spaces or tabs.
  2. The subsequent rows represent the adjacency matrix, where the order of rows matches the order of node labels.

Examples

Example 1: Adjacency Matrix File with Numeric Node Identifiers

For a simple network:

0 1 0
1 0 1
0 1 0
Explanation:
  • Matrix Representation: Each row and column in the matrix represents a node. The element (i, j) represents the connection between node i and node j. For example, the first row (0 1 0) means node 1 is connected to node 2
  • Unweighted: In this example, the matrix is unweighted, with binary values (0 and 1).
  • Symmetry: The adjacency matrix is symmetric for undirected graphs, meaning A[i][j] = A[j][i].

Example 2: With Labeled Nodes

Using labels instead of numeric identifiers:

# Alice Bob Carol
0 1 0
1 0 1
1 0 0

Here:

  • Alice is connected to Bob.
  • Bob is connected to both Alice and Carol.
  • Carol is connected to Alice.

Note that this matrix is not symmetric.

This format is especially useful for social networks where nodes represent entities like people, organizations, or websites, and meaningful labels enhance readability.

Example 3: A Weighted Network

0, 1, 1, 2
1, 0, 2, 1
0, 0, 0, 1
1, 0, 0, 0
Explanation:
  • Matrix Representation: Each row and column in the matrix represents a node. The element (i, j) represents the connection between node i and node j. For example, the first row (0, 1, 1, 2) means node 1 is connected to node 2 (with weight 1), and node 3 (with weight 1), while node 4 is connected to node 1 (with weight 2).
  • Weighted: In this example, the matrix is weighted, with values like 1 and 2 indicating the strength of the connections. Unweighted matrices would use binary values (0 and 1).
  • Symmetry: The adjacency matrix is symmetric for undirected graphs, meaning A[i][j] = A[j][i].

Visualization:

This Mermaid diagram visualizes the graph represented by the adjacency matrix. The nodes 1, 2, 3, and 4 are connected with weighted edges, as indicated by the matrix.

graph TD 1 -->|1| 2 1 -->|1| 3 1 -->|2| 4 3 -->|1| 4

How to Use Adjacency Matrix Files in SocNetV

  1. Loading Files: In SocNetV, you can load an adjacency matrix file by selecting the File > Import > Adjacency Matrix menu option. and choosing the appropriate file. SocNetV will parse the matrix and display the graph, representing each node and its connections.
  2. Delimiters: When importing an adjacency matrix, SocNetV allows you to specify the delimiter used in the file (comma, space, or tab) for correct parsing.
  3. Exporting as Matrix: SocNetV allows exporting the graph as an adjacency matrix file, which can be shared and used in other tools for further analysis.

Supported Elements in SocNetV

SocNetV supports the following elements of adjacency matrix files:

  • Basic Structure: The matrix should be a square matrix (NxN), where N is the number of nodes in the network.
  • Weighted and Unweighted Networks: SocNetV can handle both weighted (non-zero values) and unweighted (binary values 0 and 1) networks.
  • Node Labels: SocNetV supports the inclusion of node labels, either in the comment line (e.g., # Alice, Bob, Charlie) or as part of the matrix input.

Pros and Cons of Adjacency Matrix Files

The Adjacency Matrix Format is widely used in research and applications where the network structure is predefined, such as importing datasets from external tools or simulations. The inclusion of labels further enhances its versatility for descriptive and real-world social network data.

Advantages:

  • Simple and Efficient: Adjacency matrices are straightforward to use and understand, especially for small networks or those without complex structures.
  • Widely Supported: The matrix format is widely accepted and can be used across various graph analysis and network tools.
  • Direct Representation of Connections: The matrix provides an explicit representation of node connections, which is useful for mathematical and algorithmic analysis of networks.

Disadvantages:

  • Scalability Issues: For large networks, the adjacency matrix can become inefficient in terms of both storage and processing. Sparse networks can lead to a lot of wasted space in memory.
  • Limited Metadata: The adjacency matrix format is not ideal for representing additional information (e.g., node attributes) beyond connections. While it supports weights, more complex node and edge attributes are difficult to handle in this format.
  • Not Ideal for Directed Graphs: While the matrix can represent directed graphs, it becomes more difficult to distinguish between directed and undirected edges without additional context.

Reference:


Two-Mode Sociomatrix Files

A two-mode sociomatrix represents bipartite networks — networks where two fundamentally different types of actors exist, and connections only occur between types, never within them. Classic examples include people and the organisations they belong to, authors and the papers they co-authored, or directors and the company boards they sit on.

SocNetV supports two-mode sociomatrix files with extensions .2sm and .aff.

Understanding Two-Mode Data

In a regular (one-mode) network, you have one type of actor. The adjacency matrix is square: rows and columns are the same set of nodes, and cell A[i][j] = 1 means node i is directly connected to node j.

A two-mode network has two distinct sets of actors — traditionally called Mode 1 (e.g. persons, CEOs, authors) and Mode 2 (e.g. events, clubs, papers). The raw data is a rectangular NR × NC matrix — NR rows for Mode 1 actors, NC columns for Mode 2 actors. A cell value of 1 (or any non-zero weight) means person i is affiliated with event j. Crucially, there are no direct person-to-person or event-to-event connections in the raw data — only person-to-event affiliations.

This rectangular matrix is richer than it looks. From it, three distinct graphs can be derived:

Import modeWhat you getNodesEdges
Bipartite graph (default)The raw affiliation graphNR + NCOne per non-zero cell
Person networkWho shares a group with whomNRPerson i — person k if they share ≥1 event
Event networkWhich groups share membersNCEvent j — event l if they share ≥1 person

SocNetV will ask you which of these three graphs to construct when you load a .2sm file.

Key Features

  • The matrix is rectangular (NR × NC), not square. Rows = Mode 1 actors, columns = Mode 2 actors.
  • Cell values can be binary (0 / 1) or weighted (any non-zero numeric value representing affiliation strength).
  • Rows are separated by newlines. Values within a row are separated by spaces or commas.
  • Comment lines beginning with # are ignored.
  • In bipartite mode, Mode 1 nodes are labelled p1pNR and Mode 2 nodes are labelled e1eNC. Mode 2 nodes are visually distinct (blue diamond shape) so the two sets are immediately recognisable on the canvas.

Examples

Example 1: A Simple Bipartite Network

Four persons (rows) and three events (columns):

1 1 0
1 0 1
0 1 1
0 1 0
Explanation:
  • Person 1 attended events 1 and 2.
  • Person 2 attended events 1 and 3.
  • Person 3 attended events 2 and 3.
  • Person 4 attended event 2 only.

Bipartite graph (default import): SocNetV creates 4 + 3 = 7 nodes and 7 edges (one per 1 in the matrix). Nodes p1p4 represent persons; nodes e1e3 represent events.

graph LR p1 --- e1 p1 --- e2 p2 --- e1 p2 --- e3 p3 --- e2 p3 --- e3 p4 --- e2

Person network (import mode 2): SocNetV creates 4 nodes and connects persons who share at least one event:

  • p1–p2 share event 1
  • p1–p3 share event 2
  • p1–p4 share event 2
  • p2–p3 share event 3
  • p3–p4 share event 2

Event network (import mode 3): SocNetV creates 3 nodes and connects events that share at least one person:

  • e1–e2 share person 1
  • e1–e3 share person 2
  • e2–e3 share person 3

Example 2: A Weighted Two-Mode Sociomatrix

Affiliation strength can be expressed with non-zero weights:

3 0 1
0 2 2
1 1 0
Explanation:
  • Person 1 has a strong affiliation (weight 3) with event 1, and a weak affiliation (weight 1) with event 3.
  • Person 2 has affiliation weight 2 with both events 2 and 3.
  • Person 3 has affiliation weight 1 with events 1 and 2.

In bipartite mode, edge weights from the matrix are preserved. In person and event projection modes, edges are unweighted (presence/absence of co-membership only).


Example 3: The Galaskiewicz CEOs and Clubs Dataset

The shipped dataset Galaskiewicz_CEOs_and_clubs_affiliation_network_data.2sm is a real-world example — 26 CEOs (rows) × 15 clubs (columns):

0 0 1 1 0 0 0 0 1 0 0 0 0 0 0
0 0 1 0 1 0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 1 0 0 0
0 1 1 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 1 1 0
0 1 1 0 0 0 0 0 0 0 0 0 0 1 0
0 0 1 1 0 0 0 0 0 1 1 0 0 0 0
0 0 0 1 0 0 1 0 0 1 0 0 0 0 0
1 0 0 1 0 0 0 1 0 1 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0 0 0 0 0 0
0 1 1 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 1 0 0 1 0 0 0 0 0 0 0 0
0 0 1 1 1 0 0 0 1 0 0 0 0 0 0
0 1 1 1 0 0 0 0 0 0 1 1 1 0 1
0 1 1 0 0 1 0 0 0 0 0 0 1 0 1
0 1 1 0 0 1 0 1 0 0 0 0 0 1 0
0 1 1 0 1 0 0 0 0 0 1 1 0 0 1
0 0 0 1 0 0 0 0 1 0 0 1 1 0 1
1 0 1 1 0 0 1 0 1 0 0 0 0 0 0
0 1 1 1 0 0 0 0 0 0 1 0 0 0 1
0 0 1 1 0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 1 0 0 0 0 0 0 1
0 1 1 0 0 1 0 0 0 0 0 0 0 0 1
1 0 1 1 0 1 0 0 0 0 0 0 0 0 1
0 1 1 0 0 0 0 0 0 0 0 0 1 0 0
0 1 1 0 0 0 0 0 0 0 0 1 0 0 0

Importing as a bipartite graph produces 41 nodes (26 CEOs + 15 clubs) and one edge per club membership. Importing as a person network reveals which CEOs move in the same social circles. Importing as an event network reveals which clubs attract overlapping memberships.


How to Use Two-Mode Sociomatrix Files in SocNetV

  1. Loading files: Select File > Import > Two-Mode Sociomatrix and choose your .2sm or .aff file. SocNetV will display a dialog asking which graph to construct.

  2. Choosing the import mode:

    • Bipartite graph — recommended as the starting point. Preserves all information from the file. Both sets of actors appear as nodes; Mode 2 nodes are shown in blue diamond shape.
    • Person network — use when you want to analyse relationships among the Mode 1 actors (e.g. which CEOs are socially proximate).
    • Event network — use when you want to analyse relationships among the Mode 2 actors (e.g. which clubs attract overlapping memberships).
  3. Delimiter: values within each row may be separated by spaces or commas — SocNetV detects both automatically.


Supported Elements in SocNetV

ElementSupported
Rectangular NR × NC matrix
Binary (0/1) affiliations
Weighted affiliations✅ (bipartite mode)
Space-delimited rows
Comma-delimited rows
Comment lines (#)
Bipartite graph import
Person projection import
Event projection import
Node labels in file❌ (not yet supported)
Export back to .2sm❌ (not yet supported)

Pros and Cons of Two-Mode Sociomatrix Files

Advantages

  • Information-rich: a single file encodes three different graphs simultaneously, depending on how you choose to import it.
  • Compact: for sparse affiliation data, a rectangular binary matrix is much smaller than an equivalent adjacency matrix covering all actors.
  • Standard format: widely used in social network analysis research, with many published datasets available in this format (Davis Southern Women, Galaskiewicz CEOs and Clubs, etc.).

Disadvantages

  • No node attributes: the format carries no metadata beyond the affiliation values themselves.
  • Projection information loss: the person and event projection modes discard affiliation weights and merge co-memberships into a simple binary edge — some analytical nuance is lost.
  • Export not yet supported: SocNetV can import .2sm files but cannot currently export a network back to this format.

References

  • Wasserman, S. & Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge University Press. — the standard reference for two-mode network analysis.
  • Bipartite graph — Wikipedia
  • Davis, A., Gardner, B. B., & Gardner, M. R. (1941). Deep South. University of Chicago Press. — source of the classic Southern Women two-mode dataset.
  • Galaskiewicz, J. (1985). Social Organization of an Urban Grants Economy. Academic Press. — source of the CEOs and Clubs dataset shipped with SocNetV.

Pajek Files

SocNetV supports importing Pajek project files, which usually have a .net or .paj extension. It is important to note that SocNetV supports a limited subset of the features of this format.

Key Features

  1. Network Definition: Pajek files start with the *Network tag to declare the network and provide its name.

  2. Vertices and Edges/Arcs: The *Vertices section lists nodes, and the *Edges or *Arcs section defines relationships between nodes.

  3. ArcsList: The *ArcsList tag is used to represent arcs from one node to others in a more compact form. SocNetV supports this tag for defining relationships in a simplified way.

  4. Matrix Representation: SocNetV can also handle Pajek files that use the *Matrix tag to represent relationships in an adjacency matrix format.

  5. Multiple Matrix Declarations: SocNetV supports files with multiple *Matrix tags, which will each be parsed as a separate relation within the same network.

  6. Canonical Matrix Export: When exporting multirelational networks, SocNetV writes matrix headers in canonical Pajek form:

    • *Matrix :k
    • *Matrix :k "Label"

Examples

Example 1: A Simple Pajek Network

*Network "Simple Network"
*Vertices 6
1 "pe0" ic LightGreen 0.5 0.5 box
2 "pe1" ic LightYellow 0.8473 0.4981 ellipse
3 "pe2" ic LightYellow 0.6112 0.8387 triangle
4 "pe3" ic LightYellow 0.201 0.7205 diamond
5 "pe4" ic LightYellow 0.2216 0.2977 ellipse
6 "pe5" ic LightYellow 0.612 0.1552 circle
*Arcs
1 2 1 c black
1 3 -1 c red
2 4 1 c black
3 5 1 c black
*Edges
6 4 1 c black
5 6 1 c yellow

Explanation:

  • Network Declaration: The *Network tag declares the name of the network, in this case, “Simple Network.”
  • Vertices: The *Vertices section defines 6 nodes, each with an ID, a label (node name), color (LightGreen, LightYellow), and additional properties such as shape (box, ellipse, etc.) and position coordinates (0.5 0.5 for the X and Y coordinates).
  • Arcs: The *Arcs section defines directed edges between nodes. Each line specifies a source node, target node, weight (e.g., 1, -1), and an optional color.
  • Edges: The *Edges section defines undirected edges, similar to *Arcs, with the same format.

Visualization:

This Mermaid diagram visualizes the graph described in the Pajek file, showing the directed and undirected relationships between nodes.

graph TD pe0 -->|1| pe1 pe0 -->|-1| pe2 pe1 -->|1| pe4 pe2 -->|1| pe5 pe2 -->|1| pe4 pe4 -->|1| pe2 pe5 -->|1| pe3

Handling Multiple Matrices in Pajek Files

SocNetV supports Pajek files with multiple *Matrix declarations. Each matrix defines a new relation between the nodes.

Below is an example of a Pajek file with multiple matrices:

*Network "4 possible graphs of N=5"
*Vertices 5
1 "1" ic red 0.221583 0.644042 circle
2 "2" ic red 0.233094 0.351433 circle
3 "3" ic red 0.696403 0.328808 circle
4 "4" ic red 0.471942 0.197587 circle
5 "5" ic red 0.726619 0.644042 circle
*Matrix :1
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
*Matrix :2
0 0 0 0 0
0 0 0 1 0
0 0 0 0 0
0 1 0 0 0
0 0 0 0 0
*Matrix :3
0 1 0 0 0
1 0 0 1 0
0 0 0 0 0
0 1 0 0 0
0 0 0 0 0
*Matrix :4
0 0 0 0 1
0 0 0 1 0
0 0 0 0 0
0 1 0 0 0
1 0 0 0 0

Explanation:

  • Multiple Matrices: Each *Matrix section represents an adjacency matrix that defines a relation between nodes.
  • Matrix Format: Each matrix is a square matrix (NxN), where N is the number of nodes in the network. The values inside the matrix represent the connections between the nodes, where 0 indicates no connection and any non-zero number (such as 1 or -1) represents a connection.
  • Multiple Relations: Each matrix is treated as a separate relation within the same network.

Matrix Header Compatibility

SocNetV is tolerant when importing matrix headers and accepts common real-world variants, including:

*Matrix :1
*Matrix :1 "Label"
*Matrix 1:
*Matrix 1: "Label"

During import:

  • The matrix index (1, 2, etc.) is used only to determine the relation order.
  • If a label is present, it becomes the relation name.
  • The index is not treated as part of the relation name.
  • If no label is provided, SocNetV temporarily uses the matrix index as a relation name in the user interface.

During export:

  • SocNetV always writes matrix headers in canonical form:

    • *Matrix :k
    • *Matrix :k "Label"
  • If a relation has no explicit label (only a temporary numeric name), it is exported as:

    *Matrix :k

    (without writing "k" as a quoted label).

This ensures deterministic round-trip behavior for multirelational Pajek files.


How to Use Pajek Files in SocNetV

  1. Loading Files: To import a Pajek file, navigate to File > Import and select the .net or .paj file. SocNetV will parse the file and display the network structure.
  2. Limitations: SocNetV does not support advanced Pajek features like vectors, permutations, or event-based files.

Supported Pajek Elements in SocNetV

SocNetV supports the following elements of Pajek files:

  • Network Declaration: *Network header to define the start of the network file.
  • Node Definitions: *Vertices followed by a list of nodes with their labels, colors, shapes, and optional positions.
  • Edge Definitions: *Arcs followed by pairs of node IDs indicating directed connections, with optional weights and colors.
  • Edge Definitions: *Edges for undirected relationships between nodes.
  • ArcsList: The *ArcsList tag for representing multiple outgoing edges from a node in compact form.
  • Matrix Representation: The *Matrix tag for adjacency matrices, including multiple matrices corresponding to multiple relations.

Pros and Cons of Pajek Files (in SocNetV)

Advantages:

  • Simple Structure: Pajek files have a straightforward text-based format.
  • Efficient for Large Networks: Designed for handling large graphs efficiently.
  • Widely Used: Compatible with many network analysis tools.

Disadvantages:

  • Limited Attribute Support: While Pajek files support some attributes, SocNetV handles a limited subset of visual and advanced attributes.
  • Partial Feature Support: More complex Pajek constructs (e.g., vectors, permutations, event-based files) are not supported.
  • No Schema Validation: Pajek files are not automatically schema-validated, so malformed files may cause import issues.

References


UCINET DL Files

UCINET’s DL (Data Language) format is widely used for representing social networks and other types of relational data. It is a simple and flexible format, primarily designed for use with the UCINET software. SocNetV supports importing DL files in specific formats, including full matrices and edge lists.

Key Features

  1. File Header: DL files start with the DL header, followed by metadata describing the number of nodes, whether diagonals are included, and the data format.
  2. Matrix or Edge List Representation: SocNetV supports DL files in both adjacency matrix and edge list formats, making it versatile for different types of network data.
  3. Node Labels: DL files can include labels for nodes, making it easier to identify nodes in the graph.

Examples

Example 1: Full Matrix Format

DL
N=4
FORMAT=FULLMATRIX DIAGONAL PRESENT
LABELS:
Alice
Bob
Charlie
David
DATA:
0 1 1 2
1 0 2 1
0 0 0 1
1 0 0 0
Explanation:
  • Header: The file starts with DL, indicating the UCINET format, and specifies the number of nodes (N=4), the format (FULLMATRIX), and whether the diagonal is present.
  • Labels: The LABELS section lists the names of the nodes (e.g., Alice, Bob, Charlie, David).
  • Data: The DATA section provides the adjacency matrix for the network. For instance, the value 1 at position (1, 2) indicates a connection between Alice and Bob, with a weight of 1.

Visualization:

This diagram visualizes the relationships described in the full matrix format, showing both the weights and the direction of edges.

graph TD Alice -->|1| Bob Alice -->|1| Charlie Alice -->|2| David Bob -->|2| Charlie Bob -->|1| David Charlie -->|1| David

Example 2: Edge List Format

DL
N=4
FORMAT=EDGELIST1
LABELS:
Alice
Bob
Charlie
David
DATA:
1 2 1
1 3 1
1 4 2
2 3 2
2 4 1
3 4 1
Explanation:
  • Header: Similar to the full matrix format, the file begins with DL, followed by metadata. The format here is EDGELIST1, which indicates an edge list.
  • Labels: The LABELS section lists node names, just like in the full matrix example.
  • Data: The DATA section lists edges in the form source target weight. For instance, 1 2 1 means Alice (node 1) is connected to Bob (node 2) with a weight of 1.

Visualization:

graph TD Alice -->|1| Bob Alice -->|1| Charlie Alice -->|2| David Bob -->|2| Charlie Bob -->|1| David Charlie -->|1| David

This diagram visualizes the network described in the edge list format, where the weights of connections are shown.


How to Use UCINET DL Files in SocNetV

  1. Loading Files: To import a UCINET DL file, go to File > Import and select the .dl file. SocNetV will parse the file and display the network.
  2. Full Matrix or Edge List: Depending on the file format (FULLMATRIX or EDGELIST1), SocNetV will either render a matrix-based visualization or a graph-based edge list.
  3. Visualization Options: Node labels and edge weights will be displayed if included in the DL file.

Supported UCINET DL Features in SocNetV

SocNetV supports the following key features of UCINET DL files:

  • Full Matrix Format: FULLMATRIX representation with or without diagonals.
  • Edge List Format: EDGELIST1 for defining edges between nodes.
  • Node Labels: SocNetV recognizes the LABELS section and assigns these labels to the corresponding nodes in the graph.
  • Weighted Edges: SocNetV supports weights for both edge list and matrix formats.

Pros and Cons of UCINET DL Files (in SocNetV)

Advantages:

  • Simplicity: DL files are easy to read and write, especially for small networks.
  • Versatility: Supports both adjacency matrix and edge list representations, making it flexible for different types of network data.
  • Compatibility: Widely used in network analysis, particularly with UCINET, and compatible with many graph analysis tools.

Disadvantages:

  • Limited Advanced Features: In SocNetV, DL files with advanced attributes such as colors, shapes, or styles for nodes and edges are not supported.
  • Manual Editing Risks: Errors in formatting (e.g., mismatched rows in matrices) can lead to import failures or incorrect visualizations.
  • Scalability Issues: While adequate for small to medium-sized networks, very large networks may be cumbersome to represent in a text-based format.

References


Edge List Files

The edge list format is one of the simplest and most commonly used formats for representing graphs. It describes a graph in terms of its edges, where each line represents a connection (edge) between two nodes. SocNetV supports two types of edge list formats: unvalued and valued (weighted).

Key Features

  1. Simple Representation: Edge list files are straightforward, with each line representing a directed or undirected edge between two nodes.
  2. Unvalued and Valued Edges: The edge list can be unweighted (binary values, where 1 represents a connection) or weighted, where the third column represents the weight of the edge.
  3. Compatibility: The edge list format is compatible with a wide variety of graph analysis tools, making it a universal format for network data.

Examples

Example 1: Unvalued Edge List

1 2
1 3
2 4
3 4
Explanation:
  • Nodes: Each pair of numbers in the edge list represents an edge between two nodes. For instance, 1 2 indicates an edge from node 1 to node 2.
  • Unvalued: This example is unvalued, meaning the edges have no weight associated with them. A 1 is implicitly understood as the connection between the nodes.

Visualization:

graph TD 1 --> 2 1 --> 3 2 --> 4 3 --> 4

This Mermaid diagram visualizes the unvalued edge list. It shows a simple directed graph where each edge connects two nodes.

Example 2: Valued Edge List

1 2 0.5
1 3 1.2
2 4 0.8
3 4 1.0
Explanation:
  • Nodes and Weights: Each line in the edge list represents a connection between two nodes, with the third column representing the weight of the edge. For example, 1 2 0.5 means there is an edge from node 1 to node 2 with a weight of 0.5.
  • Valued Edges: This example is valued, meaning the edges are weighted with numerical values.

Visualization:

graph TD 1 -->|0.5| 2 1 -->|1.2| 3 2 -->|0.8| 4 3 -->|1.0| 4

This diagram visualizes the valued edge list. The edges are weighted, as indicated by the labels on each arrow.

How to Use Edge List Files in SocNetV

  1. Loading Files: To import an edge list file, navigate to File > Import and select the .lst or .list file. SocNetV will parse the file and display the graph structure.
  2. Unvalued and Valued Edge Lists: SocNetV can handle both unvalued and valued edge lists. It will automatically interpret the file based on whether it includes weights for the edges.
  3. Visualization Options: SocNetV will render the graph with the appropriate layout, and it will display edge weights if they are provided in the file.

Supported Edge List Features in SocNetV

SocNetV supports the following elements of edge list files:

  • Unvalued Edges: Simple binary edges, where 1 indicates a connection between nodes.
  • Valued Edges: Edges with numerical weights. SocNetV supports edge weights and will display them in the visualization.
  • Directed and Undirected Graphs: Edge lists can represent both directed and undirected graphs, depending on whether the file includes one or more directed edges.

Pros and Cons of Edge List Files

Advantages:

  • Simplicity: Edge list files are one of the simplest graph formats, making them easy to read, write, and manipulate.
  • Flexibility: Supports both unweighted and weighted graphs, as well as directed and undirected edges.
  • Wide Compatibility: Edge lists are widely supported by many graph analysis tools, making them a standard format for graph representation.

Disadvantages:

  • Limited Attributes: The edge list format does not support advanced node or edge attributes, such as colors, shapes, or other metadata. It is limited to node connections and, optionally, weights.
  • Scalability: For very large graphs, edge list files can become cumbersome to manage, especially when dealing with graphs with millions of edges.
  • No Topological Information: Unlike adjacency matrices or other formats, edge lists do not inherently encode the structure or topology of the graph in a way that makes it easy to retrieve specific information about the graph’s properties.

Reference:

Two-Mode Data — Crash Course A regular (1-mode) network has one type of actor. The adjacency matrix is square: rows and columns are the same actors, and a cell A[i][j]=1 means actor i is directly connected to actor j. A two-mode (bipartite) network has two distinct types of actors — traditionally called Mode 1 (e.g., people) and Mode 2 (e.g., events, clubs, organizations). The raw data matrix is rectangular: rows = Mode 1 actors, columns = Mode 2 actors. A cell B[i][j]=1 means person i attended event j. There are no direct person→person or event→event edges in the raw data — only person→event edges. The Davis Southern Women dataset (used in the issue) is the classic example:

18 women × 14 social events B[i][j]=1 if woman i attended event j

From this rectangular matrix you can derive two things:

The bipartite graph itself — 18+14=32 nodes, two visually distinct types, edges only crossing between types. This is the true import of a .2sm file. A projected 1-mode network (the “acquaintance network”) — computed as A = B × Bᵀ (or Bᵀ × B). This is what SocNetV currently does instead of (1), which is the bug.