History of wolfe_primates
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] Remove superfluous details of the upstream distribution from the descriptions dc07aa0
The descriptions mentioned incidental details of how the upstream data are made available: the file formats (CSV, JSON, XML, GEXF, SBML, HIF, Pajek, UCINET, ...), file names, where the files were published or obtained from (Zenodo, figshare, Kaggle, the Pajek datasets page, the Internet Archive), and that some networks are only available in the gt format. These are left out; caveats about the data themselves are kept, referring to "the data" instead of "the file". The description of sp_baboons now lists its properties instead of the upstream columns, and says that events without a recipient are left out.
diff --git a/entries/wolfe_primates/__init__.py b/entries/wolfe_primates/__init__.py
index ae68c10..cd52b07 100644
--- a/entries/wolfe_primates/__init__.py
+++ b/entries/wolfe_primates/__init__.py
@@ -19,7 +19,7 @@
from .. import *
title = "Wolfe's monkey troop (1986)"
-description = """Interactions and kinship among a troop of 20 monkeys, observed in the wild by L. Wolfe during 3 months, as they sported by a river in Ocala, Florida (USA). The data were used, e.g., by S. P. Borgatti and M. G. Everett to illustrate core/periphery structures. The data were distributed in UCINET format (from the UCINET data collection of S. P. Borgatti, M. G. Everett and L. C. Freeman) on the Pajek datasets page of V. Batagelj and A. Mrvar, from which this version was obtained.
+description = """Interactions and kinship among a troop of 20 monkeys, observed in the wild by L. Wolfe during 3 months, as they sported by a river in Ocala, Florida (USA). The data were used, e.g., by S. P. Borgatti and M. G. Everett to illustrate core/periphery structures.
- `presence`: joint presence at the river, coded as an interaction and summed within all pairs (WOLFN).
- `kin`: the putative kin relationships among the animals (WOLFK), as directed edges as in the rows and columns of the source matrix (the direction is not further documented; e.g. animal 18 may be the granddaughter of 19).
[entries] Add the date when each entry was added, and remove icon_hash 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/wolfe_primates/__init__.py b/entries/wolfe_primates/__init__.py
index d25f3b1..ae68c10 100644
--- a/entries/wolfe_primates/__init__.py
+++ b/entries/wolfe_primates/__init__.py
@@ -35,7 +35,7 @@ tags = ['Social', 'Animal', 'Weighted', 'Metadata']
url = 'https://web.archive.org/web/20020312110633/http://vlado.fmf.uni-lj.si/pub/networks/data/UciNet/UciData.htm'
citation = [('S. P. Borgatti, M. G. Everett, "Models of core/periphery structures." Social Networks 21(4), 375-395 (2000)', 'https://doi.org/10.1016/S0378-8733(99)00019-2'),
('S. P. Borgatti, M. G. Everett, L. C. Freeman, "UCINET for Windows: Software for Social Network Analysis." Analytic Technologies, Harvard, MA (2002)', 'https://web.archive.org/web/20020312110633/http://vlado.fmf.uni-lj.si/pub/networks/data/UciNet/UciData.htm')]
-icon_hash = '590bed0d62da632511877ee7'
+date_added = '2026-10-25'
upstream_license = None
# The Pajek data site (vlado.fmf.uni-lj.si) is no longer reachable, so the
# files are obtained from the Internet Archive.
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/wolfe_primates/__init__.py b/entries/wolfe_primates/__init__.py
index 8b3e298..d25f3b1 100644
--- a/entries/wolfe_primates/__init__.py
+++ b/entries/wolfe_primates/__init__.py
@@ -26,8 +26,11 @@ description = """Interactions and kinship among a troop of 20 monkeys, observed
The networks have the following properties:
-- Nodes: `name`, the identification number of the animal; `sex`, "male" or "female"; `age`, the age in years; `rank`, the rank of the animal in the troop.
-- Edges: `weight` (`presence` only), the number of joint presences at the river."""
+- (Node) `name`: the identification number of the animal.
+- (Node) `sex`: "male" or "female".
+- (Node) `age`: the age in years.
+- (Node) `rank`: the rank of the animal in the troop.
+- (Edge) `weight` (`presence` only): the number of joint presences at the river."""
tags = ['Social', 'Animal', 'Weighted', 'Metadata']
url = 'https://web.archive.org/web/20020312110633/http://vlado.fmf.uni-lj.si/pub/networks/data/UciNet/UciData.htm'
citation = [('S. P. Borgatti, M. G. Everett, "Models of core/periphery structures." Social Networks 21(4), 375-395 (2000)', 'https://doi.org/10.1016/S0378-8733(99)00019-2'),
[entries] List the files of each network together, instead of as separate networks 3c5e521
wolfe_primates listed its attribute file as an unnamed network of its own, and eva_ownership, kansas_sar, political_actors, world_cities and yeast_pin listed their single network once per file, so that they appeared with networks that do not exist.
diff --git a/entries/wolfe_primates/__init__.py b/entries/wolfe_primates/__init__.py
index b0a6eb8..8b3e298 100644
--- a/entries/wolfe_primates/__init__.py
+++ b/entries/wolfe_primates/__init__.py
@@ -37,9 +37,9 @@ upstream_license = None
# The Pajek data site (vlado.fmf.uni-lj.si) is no longer reachable, so the
# files are obtained from the Internet Archive.
upstream_prefix = 'https://web.archive.org/web/20070228091801id_/http://vlado.fmf.uni-lj.si/pub/networks/data/UciNet'
-files = [('wolf.dat', 'presence', None),
- ('wolf.dat', 'kin', None),
- ('wolfi.dat', None, None)]
+# Each network is made from both files (the matrices and the attributes)
+files = [(('wolf.dat', 'wolfi.dat'), 'presence', None),
+ (('wolf.dat', 'wolfi.dat'), 'kin', None)]
def fetch_upstream(force=False):
return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
[entries] New entry: wolfe_primates 261a303
diff --git a/entries/wolfe_primates/__init__.py b/entries/wolfe_primates/__init__.py
new file mode 100644
index 0000000..b0a6eb8
--- /dev/null
+++ b/entries/wolfe_primates/__init__.py
@@ -0,0 +1,68 @@
+#! /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/>.
+
+from .. import *
+
+title = "Wolfe's monkey troop (1986)"
+description = """Interactions and kinship among a troop of 20 monkeys, observed in the wild by L. Wolfe during 3 months, as they sported by a river in Ocala, Florida (USA). The data were used, e.g., by S. P. Borgatti and M. G. Everett to illustrate core/periphery structures. The data were distributed in UCINET format (from the UCINET data collection of S. P. Borgatti, M. G. Everett and L. C. Freeman) on the Pajek datasets page of V. Batagelj and A. Mrvar, from which this version was obtained.
+
+- `presence`: joint presence at the river, coded as an interaction and summed within all pairs (WOLFN).
+- `kin`: the putative kin relationships among the animals (WOLFK), as directed edges as in the rows and columns of the source matrix (the direction is not further documented; e.g. animal 18 may be the granddaughter of 19).
+
+The networks have the following properties:
+
+- Nodes: `name`, the identification number of the animal; `sex`, "male" or "female"; `age`, the age in years; `rank`, the rank of the animal in the troop.
+- Edges: `weight` (`presence` only), the number of joint presences at the river."""
+tags = ['Social', 'Animal', 'Weighted', 'Metadata']
+url = 'https://web.archive.org/web/20020312110633/http://vlado.fmf.uni-lj.si/pub/networks/data/UciNet/UciData.htm'
+citation = [('S. P. Borgatti, M. G. Everett, "Models of core/periphery structures." Social Networks 21(4), 375-395 (2000)', 'https://doi.org/10.1016/S0378-8733(99)00019-2'),
+ ('S. P. Borgatti, M. G. Everett, L. C. Freeman, "UCINET for Windows: Software for Social Network Analysis." Analytic Technologies, Harvard, MA (2002)', 'https://web.archive.org/web/20020312110633/http://vlado.fmf.uni-lj.si/pub/networks/data/UciNet/UciData.htm')]
+icon_hash = '590bed0d62da632511877ee7'
+upstream_license = None
+# The Pajek data site (vlado.fmf.uni-lj.si) is no longer reachable, so the
+# files are obtained from the Internet Archive.
+upstream_prefix = 'https://web.archive.org/web/20070228091801id_/http://vlado.fmf.uni-lj.si/pub/networks/data/UciNet'
+files = [('wolf.dat', 'presence', None),
+ ('wolf.dat', 'kin', None),
+ ('wolfi.dat', None, None)]
+
+def fetch_upstream(force=False):
+ return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+ force)
+
+@cache_network()
+@coerce_props(vforce={"name": "string"})
+@annotate()
+def parse(alts=None):
+ name = __name__.split(".")[-1]
+ with open_upstream_file(name, "wolf.dat", "rb") as f:
+ Ms = read_dl(f)["data"]
+ with open_upstream_file(name, "wolfi.dat", "rb") as f:
+ lines = f.read().decode("latin-1").splitlines()
+ i = [l.strip().upper() for l in lines].index("ROW LABELS:")
+ rows = [l.split() for l in lines[i + 1:i + 21]]
+ i = [l.strip().upper() for l in lines].index("DATA:")
+ data = [l.split() for l in lines[i + 1:i + 21]]
+ for alt, M, directed in [("presence", Ms[1], False), ("kin", Ms[0], True)]:
+ if alts is not None and alt not in alts:
+ continue
+ g = adjacency_graph(M, directed=directed, labels=[r[0] for r in rows])
+ g.vp.sex = g.new_vp("string", vals=[r[1] for r in rows])
+ g.vp.age = g.new_vp("int", vals=[int(d[0]) for d in data])
+ g.vp.rank = g.new_vp("int", vals=[int(d[1]) for d in data])
+ yield alt, g