History of imdb_movies_2005
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 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/imdb_movies_2005/__init__.py b/entries/imdb_movies_2005/__init__.py
index e3f42b5..4db804a 100644
--- a/entries/imdb_movies_2005/__init__.py
+++ b/entries/imdb_movies_2005/__init__.py
@@ -28,7 +28,7 @@ Vertex properties: `is_movie`, which marks the movies (the remaining nodes are a
tags = ['Economic', 'Employment', 'Unweighted', 'Multigraph', 'Metadata']
url = 'https://mozart.diei.unipg.it/gdcontest/contest2005/gdevolving2005.html'
citation = [('Graph Drawing Contest 2005, "Evolving-graph drawing competition: IMDb movie-actor graph." 13th International Symposium on Graph Drawing (GD 2005).', 'https://mozart.diei.unipg.it/gdcontest/contest2005/gdevolving2005.html')]
-icon_hash = '592debb167ec90f1500d4e49'
+date_added = '2026-10-25'
upstream_license = None
upstream_prefix = 'https://mozart.diei.unipg.it/gdcontest/contest2005/graphs'
files = [('imdb.graphml.bz2', None, None)]
[entries] Remove unneeded code from the entries 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/imdb_movies_2005/__init__.py b/entries/imdb_movies_2005/__init__.py
index 22b9bdf..e3f42b5 100644
--- a/entries/imdb_movies_2005/__init__.py
+++ b/entries/imdb_movies_2005/__init__.py
@@ -41,7 +41,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:
@@ -51,7 +50,6 @@ def parse(alts=None):
idx = {}
names, movie, year, genre = [], [], [], []
edges = []
- keys = {"k0": names, "k1": movie, "k2": year, "k3": genre}
defaults = {"k0": "not available", "k1": False, "k2": 0,
"k3": "not available"}
with open_upstream_file(name, fnames, "rb") as f:
[entries] New entry: imdb_movies_2005 72aa097
diff --git a/entries/imdb_movies_2005/__init__.py b/entries/imdb_movies_2005/__init__.py
new file mode 100644
index 0000000..22b9bdf
--- /dev/null
+++ b/entries/imdb_movies_2005/__init__.py
@@ -0,0 +1,83 @@
+#! /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 bz2
+from xml.etree import ElementTree
+
+title = "IMDb actor-movie network (2005)"
+description = """A bipartite network of actors and the movies they appeared in, based on the Internet Movie Database (IMDb), released as the data set of the evolving-graph drawing competition of the 13th International Symposium on Graph Drawing (GD 2005). Nodes are movies and actors, and an edge connects each movie to each of its actors. The network has 428,440 movies and 896,308 actors, connected by 3,792,390 edges; 124,823 movies have no actors in the data (isolated nodes), and 9,927 edges are repeated (an actor listed more than once in the same movie, e.g. in several roles).
+
+Vertex properties: `is_movie`, which marks the movies (the remaining nodes are actors); `name`, the title of the movie or the name of the actor (titles are in the IMDb format, e.g. with leading articles moved to the end, as in "Matrix, The"); `year`, the release year of the movie (0 for actors, or if unknown; a few movies have invalid values, such as 1 or 9006); `genre`, the genre of the movie ("not available" for actors, or if unknown)."""
+tags = ['Economic', 'Employment', 'Unweighted', 'Multigraph', 'Metadata']
+url = 'https://mozart.diei.unipg.it/gdcontest/contest2005/gdevolving2005.html'
+citation = [('Graph Drawing Contest 2005, "Evolving-graph drawing competition: IMDb movie-actor graph." 13th International Symposium on Graph Drawing (GD 2005).', 'https://mozart.diei.unipg.it/gdcontest/contest2005/gdevolving2005.html')]
+icon_hash = '592debb167ec90f1500d4e49'
+upstream_license = None
+upstream_prefix = 'https://mozart.diei.unipg.it/gdcontest/contest2005/graphs'
+files = [('imdb.graphml.bz2', None, None)]
+
+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
+ # graph-tool's GraphML reader does not read this (pre-1.0) GraphML
+ # file, so it is parsed here
+ idx = {}
+ names, movie, year, genre = [], [], [], []
+ edges = []
+ keys = {"k0": names, "k1": movie, "k2": year, "k3": genre}
+ defaults = {"k0": "not available", "k1": False, "k2": 0,
+ "k3": "not available"}
+ with open_upstream_file(name, fnames, "rb") as f:
+ for ev, elem in ElementTree.iterparse(bz2.open(f), events=("end",)):
+ tag = elem.tag.split("}")[-1]
+ if tag == "node":
+ idx[elem.get("id")] = len(idx)
+ vals = dict(defaults)
+ for d in elem:
+ k = d.get("key")
+ vals[k] = d.text if d.text is not None else ""
+ names.append(vals["k0"])
+ movie.append(vals["k1"] in (True, "true"))
+ year.append(int(vals["k2"]))
+ genre.append(vals["k3"])
+ elem.clear()
+ elif tag == "edge":
+ edges.append((idx[elem.get("source")],
+ idx[elem.get("target")]))
+ elem.clear()
+ # Edges connect actors to movies; the bipartite graph is undirected
+ g = Graph(directed=False)
+ g.add_vertex(len(idx))
+ g.add_edge_list(edges)
+ g.vp.is_movie = g.new_vp("bool", vals=movie)
+ g.vp.name = g.new_vp("string", vals=names)
+ g.vp.year = g.new_vp("int", vals=year)
+ g.vp.genre = g.new_vp("string", vals=genre)
+ yield alt, g