logo Netzschleuder network catalog, repository, and centrifuge

History of signed_social_relations

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/signed_social_relations/__init__.py b/entries/signed_social_relations/__init__.py
index eccadb6..2c96c84 100644
--- a/entries/signed_social_relations/__init__.py
+++ b/entries/signed_social_relations/__init__.py
@@ -44,7 +44,7 @@ citation = [('S. Aref and M. C. Wilson, "Measuring partial balance in signed net
             ('T. B. Lemann and R. L. Solomon, "Group characteristics as revealed in sociometric patterns and personality ratings." Sociometry 15(1/2), 7–90 (1952)', 'https://doi.org/10.2307/2785447'),
             ('Z. Neal, "The backbone of bipartite projections: Inferring relationships from co-authorship, co-sponsorship, co-attendance and other co-behaviors." Social Networks 39, 84–97 (2014)', 'https://doi.org/10.1016/j.socnet.2014.06.001'),
             ('S. Aref, "Signed networks from sociology and political science, systems biology, international relations, finance, and computational chemistry." Figshare (2017)', 'https://doi.org/10.6084/m9.figshare.5700832')]
-icon_hash = None
+date_added = '2026-10-25'
 upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
                     "https://creativecommons.org/licenses/by/4.0/")
 upstream_prefix = 'https://ndownloader.figshare.com/files'
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/signed_social_relations/__init__.py b/entries/signed_social_relations/__init__.py
index b14a6b4..eccadb6 100644
--- a/entries/signed_social_relations/__init__.py
+++ b/entries/signed_social_relations/__init__.py
@@ -31,7 +31,7 @@ Nodes are people, and an undirected edge has sign $+1$ for a positive and $-1$ f
 
 The networks have the following properties:
 
-- `sign` (edges): $+1$ for a positive and $-1$ for a negative relation.
+- (Edge) `sign` (edges): $+1$ for a positive and $-1$ for a negative relation.
 
 The nodes have no names in the source; their order follows the node numbering of the source files.
 
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/signed_social_relations/__init__.py b/entries/signed_social_relations/__init__.py
index de2ed8f..b14a6b4 100644
--- a/entries/signed_social_relations/__init__.py
+++ b/entries/signed_social_relations/__init__.py
@@ -62,7 +62,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     ns = {"g": "http://graphml.graphdrawing.org/xmlns"}
     for fname, alt, fmt in files:
[entries] New entry: signed_social_relations by Tiago de Paula Peixoto b7b750d
diff --git a/entries/signed_social_relations/__init__.py b/entries/signed_social_relations/__init__.py
new file mode 100644
index 0000000..de2ed8f
--- /dev/null
+++ b/entries/signed_social_relations/__init__.py
@@ -0,0 +1,86 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import xml.etree.ElementTree as ET
+
+from .. import *
+
+title = "Signed social relations in small groups and the US Senate (1952-2004)"
+description = r"""Three undirected signed social networks prepared by S. Aref and M. C. Wilson as benchmarks for measuring structural balance and computing the frustration index of signed networks (Aref and Wilson, 2018 and 2019), and distributed in their collection of signed networks.
+
+Nodes are people, and an undirected edge has sign $+1$ for a positive and $-1$ for a negative relation between two people. The networks are:
+
+- `monastery`: 18 novices in a New England monastery, from the sociometric rankings collected by S. F. Sampson (1968) at the fourth time point of his study. Sampson's data include rankings of like, dislike, esteem, disesteem, positive influence, negative influence, praise and blame; all the positive and negative rankings were combined, and two novices are connected only if their relations are reciprocated with the same sign.
+- `eastern_college`: 17 women living in house B of the off-campus dormitories of an Eastern college, from the sociometric data of T. B. Lemann and R. L. Solomon (1952), which integrate the top three and bottom three choices on several criteria; two women are connected only if their choices of each other are reciprocated with the same sign.
+- `senate_108`: the 100 senators of the 108th US Senate (2003–2004), with the signed relations inferred by Z. Neal (2014) from J. H. Fowler's bill co-sponsorship data by extracting the signed backbone of the senator–bill network with the stochastic degree sequence model: senators are connected positively if they co-sponsored significantly more bills together than expected, and negatively if significantly fewer.
+
+The networks have the following properties:
+
+- `sign` (edges): $+1$ for a positive and $-1$ for a negative relation.
+
+The nodes have no names in the source; their order follows the node numbering of the source files.
+
+Other signed networks of the same collection are in existing entries or derived from them: the Highland tribes network is identical to `new_guinea_tribes`; the fraternity network is the network `signed_week15` of `newcomb_fraternity`, derived there from the week 15 rankings (ranks 1–5 as positive and 12–16 as negative choices, keeping the reciprocated relations with the same sign); and the undirected Wikipedia elections network is obtained from the votes in `elec`. A different version of the signed backbone of the US Senate, with senator names, inferred by Neal for every Congress up to 2016, is in `us_congress`."""
+tags = ['Social', 'Offline', 'Political', 'Signed']
+url = 'https://doi.org/10.6084/m9.figshare.5700832'
+citation = [('S. Aref and M. C. Wilson, "Measuring partial balance in signed networks." J. Complex Networks 6(4), 566–595 (2018)', 'https://doi.org/10.1093/comnet/cnx044'),
+            ('S. Aref and M. C. Wilson, "Balance and frustration in signed networks." J. Complex Networks 7(2), 163–189 (2019)', 'https://doi.org/10.1093/comnet/cny015'),
+            ('S. F. Sampson, "A Novitiate in a Period of Change: An Experimental and Case Study of Social Relationships." PhD thesis, Cornell University (1968)', 'https://web.archive.org/web/20040706122656/http://vlado.fmf.uni-lj.si/pub/networks/data/esna/sampson.htm'),
+            ('T. B. Lemann and R. L. Solomon, "Group characteristics as revealed in sociometric patterns and personality ratings." Sociometry 15(1/2), 7–90 (1952)', 'https://doi.org/10.2307/2785447'),
+            ('Z. Neal, "The backbone of bipartite projections: Inferring relationships from co-authorship, co-sponsorship, co-attendance and other co-behaviors." Social Networks 39, 84–97 (2014)', 'https://doi.org/10.1016/j.socnet.2014.06.001'),
+            ('S. Aref, "Signed networks from sociology and political science, systems biology, international relations, finance, and computational chemistry." Figshare (2017)', 'https://doi.org/10.6084/m9.figshare.5700832')]
+icon_hash = None
+upstream_license = ("Creative Commons Attribution 4.0 International (CC BY 4.0)",
+                    "https://creativecommons.org/licenses/by/4.0/")
+upstream_prefix = 'https://ndownloader.figshare.com/files'
+
+files = [(f"21172485:zip:Social and Political Networks/Five small signed social networks/{fn}.graphml", alt, "graphml")
+         for alt, fn in [("monastery", "Monastery interactions"),
+                         ("eastern_college", "Eastern College"),
+                         ("senate_108", "Senate108th")]]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    ns = {"g": "http://graphml.graphdrawing.org/xmlns"}
+    for fname, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        with open_upstream_file(name, fname, "rb") as f:
+            root = ET.parse(f).getroot()
+        key = [k.get("id") for k in root.findall("g:key", ns)
+               if k.get("attr.name") == "weight"][0]
+        graph = root.find("g:graph", ns)
+        N = len(graph.findall("g:node", ns))  # node ids are 0, ..., N-1
+        edges = []
+        for e in graph.findall("g:edge", ns):
+            s = [d.text for d in e.findall("g:data", ns)
+                 if d.get("key") == key][0]
+            edges.append((int(e.get("source")), int(e.get("target")), int(s)))
+        g = Graph(directed=False)
+        g.add_vertex(N)
+        g.ep.sign = g.new_ep("int")
+        g.add_edge_list(edges, eprops=[g.ep.sign])
+        yield alt, g