Skip to content
Novus Examples
graphml4.3 KB

Social Network Graph (GraphML)

A small synthetic social network in GraphML — 12 people in two communities with a few bridging ties, carrying node attributes (name, age, community) and weighted edges. Twinned with a GEXF file for testing graph importers and format converters.

Preview — first 50 linesgraphml
<?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">
  <key id="d_name" for="node" attr.name="name" attr.type="string"/>
  <key id="d_age" for="node" attr.name="age" attr.type="int"/>
  <key id="d_comm" for="node" attr.name="community" attr.type="string"/>
  <key id="d_weight" for="edge" attr.name="weight" attr.type="double"/>
  <graph id="social" edgedefault="undirected">
    <node id="n0">
      <data key="d_name">Ada</data>
      <data key="d_age">29</data>
      <data key="d_comm">A</data>
    </node>
    <node id="n1">
      <data key="d_name">Ben</data>
      <data key="d_age">34</data>
      <data key="d_comm">A</data>
    </node>
    <node id="n2">
      <data key="d_name">Chen</data>
      <data key="d_age">41</data>
      <data key="d_comm">A</data>
    </node>
    <node id="n3">
      <data key="d_name">Dara</data>
      <data key="d_age">26</data>
      <data key="d_comm">A</data>
    </node>
    <node id="n4">
      <data key="d_name">Ede</data>
      <data key="d_age">38</data>
      <data key="d_comm">A</data>
    </node>
    <node id="n5">
      <data key="d_name">Faye</data>
      <data key="d_age">31</data>
      <data key="d_comm">B</data>
    </node>
    <node id="n6">
      <data key="d_name">Gus</data>
      <data key="d_age">45</data>
      <data key="d_comm">B</data>
    </node>
    <node id="n7">
      <data key="d_name">Hana</data>
      <data key="d_age">27</data>
      <data key="d_comm">B</data>
    </node>
    <node id="n8">
135 lines total — download for the full file.

Specifications

Nodes
12
Edges
21
Directed
false
Attributes
name, age, community; edge weight

What is a .graphml file?

GraphML is an XML-based format for describing graphs — nodes, edges, and typed attributes (keys) on either. It supports directed and undirected graphs, and is widely read by network tools such as Gephi, NetworkX, and yEd. Being plain XML, it is human-readable and easy to transform.

How to use this file

Use an example GraphML file to test graph and network importers, layout tools, and converters between GraphML, GEXF, and adjacency formats, or to verify that node and edge attributes survive a round-trip.

Generated by generation/data_graphs.py. Free for any use, no attribution required — license.