logo Netzschleuder network catalog, repository, and centrifuge

History of star_wars

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/star_wars/__init__.py b/entries/star_wars/__init__.py
index 365ea6c..ffd3325 100644
--- a/entries/star_wars/__init__.py
+++ b/entries/star_wars/__init__.py
@@ -39,7 +39,7 @@ The networks have the following properties:
 tags = ['Social', 'Fictional', 'Weighted', 'Metadata']
 url = 'https://evelinag.com/blog/2015/12-15-star-wars-social-network/'
 citation = [('E. Gabasova, "Star Wars social network." Zenodo, version 1.0.1 (2016)', 'https://doi.org/10.5281/zenodo.1411479')]
-icon_hash = '56e9da39a6d70217090cdf17'
+date_added = '2026-10-25'
 upstream_license = ("CC BY 4.0", "https://github.com/evelinag/StarWars-social-network/blob/129fbbdb8919e0dd14bc2db4a44f496a14e5ea07/networks/LICENSE.txt")
 upstream_prefix = 'https://zenodo.org/records/1411479/files/evelinag'
 
[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/star_wars/__init__.py b/entries/star_wars/__init__.py
index 9e90516..365ea6c 100644
--- a/entries/star_wars/__init__.py
+++ b/entries/star_wars/__init__.py
@@ -32,8 +32,10 @@ There are four kinds of networks, for each episode (`episode1` to `episode7`) an
 
 The networks have the following properties:
 
-- Nodes: `name`, the name of the character; `scenes`, the number of scenes in which the character appears (speaks or is mentioned, according to the network type); `colour`, the color of the node in the author's visualizations (main characters have distinct colors, all others are gray).
-- Edges: `weight`, the number of scenes in which both characters appear."""
+- (Node) `name`: the name of the character.
+- (Node) `scenes`: the number of scenes in which the character appears (speaks or is mentioned, according to the network type).
+- (Node) `colour`: the color of the node in the author's visualizations (main characters have distinct colors, all others are gray).
+- (Edge) `weight`: the number of scenes in which both characters appear."""
 tags = ['Social', 'Fictional', 'Weighted', 'Metadata']
 url = 'https://evelinag.com/blog/2015/12-15-star-wars-social-network/'
 citation = [('E. Gabasova, "Star Wars social network." Zenodo, version 1.0.1 (2016)', 'https://doi.org/10.5281/zenodo.1411479')]
[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/star_wars/__init__.py b/entries/star_wars/__init__.py
index 7d02447..9e90516 100644
--- a/entries/star_wars/__init__.py
+++ b/entries/star_wars/__init__.py
@@ -69,7 +69,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fnames, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] Use American spelling in the descriptions by Tiago de Paula Peixoto 802d564
British spellings in the titles and descriptions of 69 entries (e.g.
labelled, organisation, millimetres, centres, anonymised, neighbours,
analysed, modelled, colour, licence) are replaced by the American ones.
Proper names keep their spelling (Otago Harbour, the Centre for Water
Systems, the Centre jeunesse de Montréal, the Dutch Ministry of Defence),
as do quoted upstream terms, citations, and property names.
diff --git a/entries/star_wars/__init__.py b/entries/star_wars/__init__.py
index 61cab76..7d02447 100644
--- a/entries/star_wars/__init__.py
+++ b/entries/star_wars/__init__.py
@@ -32,7 +32,7 @@ There are four kinds of networks, for each episode (`episode1` to `episode7`) an
 
 The networks have the following properties:
 
-- Nodes: `name`, the name of the character; `scenes`, the number of scenes in which the character appears (speaks or is mentioned, according to the network type); `colour`, the colour of the node in the author's visualizations (main characters have distinct colours, all others are grey).
+- Nodes: `name`, the name of the character; `scenes`, the number of scenes in which the character appears (speaks or is mentioned, according to the network type); `colour`, the color of the node in the author's visualizations (main characters have distinct colors, all others are gray).
 - Edges: `weight`, the number of scenes in which both characters appear."""
 tags = ['Social', 'Fictional', 'Weighted', 'Metadata']
 url = 'https://evelinag.com/blog/2015/12-15-star-wars-social-network/'
[entries] New entry: star_wars by Tiago de Paula Peixoto d20e5d5
diff --git a/entries/star_wars/__init__.py b/entries/star_wars/__init__.py
new file mode 100644
index 0000000..61cab76
--- /dev/null
+++ b/entries/star_wars/__init__.py
@@ -0,0 +1,87 @@
+#! /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 *
+
+import json
+
+title = "Star Wars character networks (1977-2015)"
+description = """Networks of the characters of the first seven Star Wars films (Episodes I to VII, released from 1977 to 2015), extracted by Evelina Gabasova from the film screenplays available in the Internet Movie Script Database (IMSDb). The screenplays (drafts that sometimes differ from the final films) were split into scenes at their "INT." and "EXT." scene headers, and the names of the characters were identified in each scene, using a manually compiled list of aliases to merge different names of the same character (e.g. Palpatine, Darth Sidious and the Emperor are a single node, as are Amidala and Padmé; Anakin and Darth Vader are, however, kept as separate nodes). Nodes are characters, and an edge connects two characters that occur together in at least one scene, weighted by the number of such scenes. The networks are undirected.
+
+There are four kinds of networks, for each episode (`episode1` to `episode7`) and for all the episodes together (`full`):
+
+- `*_interactions`: two characters are connected if they both speak in the same scene.
+- `*_interactions_all`: as `interactions`, with R2-D2 and Chewbacca (who do not have spoken lines in the screenplays) added using the data of the `mentions` network.
+- `*_mentions`: two characters are connected if they are both mentioned (by name) in the same scene.
+- `full_interactions_all_merged`: as `full_interactions_all`, with Anakin and Darth Vader merged into a single node ("DARTH VADER").
+
+The networks have the following properties:
+
+- Nodes: `name`, the name of the character; `scenes`, the number of scenes in which the character appears (speaks or is mentioned, according to the network type); `colour`, the colour of the node in the author's visualizations (main characters have distinct colours, all others are grey).
+- Edges: `weight`, the number of scenes in which both characters appear."""
+tags = ['Social', 'Fictional', 'Weighted', 'Metadata']
+url = 'https://evelinag.com/blog/2015/12-15-star-wars-social-network/'
+citation = [('E. Gabasova, "Star Wars social network." Zenodo, version 1.0.1 (2016)', 'https://doi.org/10.5281/zenodo.1411479')]
+icon_hash = '56e9da39a6d70217090cdf17'
+upstream_license = ("CC BY 4.0", "https://github.com/evelinag/StarWars-social-network/blob/129fbbdb8919e0dd14bc2db4a44f496a14e5ea07/networks/LICENSE.txt")
+upstream_prefix = 'https://zenodo.org/records/1411479/files/evelinag'
+
+_archive = 'star-wars-network-data-1.0.1.zip:evelinag-star-wars-network-data-04538e0'
+
+def _alts():
+    out = []
+    for ep in [str(i) for i in range(1, 8)] + ["full"]:
+        prefix = "full" if ep == "full" else f"episode{ep}"
+        fprefix = "full" if ep == "full" else f"episode-{ep}"
+        out.append((f"{_archive}/starwars-{fprefix}-interactions.json",
+                    f"{prefix}_interactions", None))
+        out.append((f"{_archive}/starwars-{fprefix}-interactions-allCharacters.json",
+                    f"{prefix}_interactions_all", None))
+        if ep == "full":
+            out.append((f"{_archive}/starwars-full-interactions-allCharacters-merged.json",
+                        "full_interactions_all_merged", None))
+        out.append((f"{_archive}/starwars-{fprefix}-mentions.json",
+                    f"{prefix}_mentions", None))
+    return out
+
+files = _alts()
+
+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]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        with open_upstream_file(name, fnames, "rb") as f:
+            d = json.load(f)
+        g = Graph(directed=False)
+        g.add_vertex(len(d["nodes"]))
+        g.vp.name = g.new_vp("string", vals=[x["name"] for x in d["nodes"]])
+        g.vp.scenes = g.new_vp("int", vals=[x["value"] for x in d["nodes"]])
+        g.vp.colour = g.new_vp("string", vals=[x["colour"] for x in d["nodes"]])
+        g.ep.weight = g.new_ep("int")
+        g.add_edge_list([(l["source"], l["target"], l["value"])
+                         for l in d["links"]], eprops=[g.ep.weight])
+        yield alt, g