History of discogs_label
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/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index f2f34f1..6d99c6d 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -37,7 +37,7 @@ The networks have the following properties:
tags = ['Informational', 'Relatedness', 'Affiliation', 'Weighted', 'Metadata']
url = 'https://data.discogs.com/'
citation = [('Discogs, "Discogs data dumps: releases, 1 October 2015."', 'https://data.discogs.com/')]
-icon_hash = '5759c68fbd3e93b53c6955e0'
+date_added = '2020-08-11'
upstream_license = ("Creative Commons CC0 1.0 Universal (Public Domain Dedication)",
"https://creativecommons.org/publicdomain/zero/1.0/")
dump = 'discogs_20151001_releases.xml.gz'
[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/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index ad80599..f2f34f1 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -30,9 +30,10 @@ The dump of 2015 does not contain label ids, and labels are therefore identified
The networks have the following properties:
-- `is_label`: whether the node is a label (otherwise it is a genre or style).
-- `name`: the name of the label, genre or style.
-- Edges: `count`, the number of releases of that label with that genre or style; `first_year` and `last_year`, the earliest and latest release years among them (-1 if none of them has a known year; the years are as entered in Discogs, and a few are evidently mistyped)."""
+- (Node) `is_label`: whether the node is a label (otherwise it is a genre or style).
+- (Node) `name`: the name of the label, genre or style.
+- (Edge) `count`: the number of releases of that label with that genre or style.
+- (Edge) `first_year` and `last_year`: the earliest and latest release years among them (-1 if none of them has a known year; the years are as entered in Discogs, and a few are evidently mistyped)."""
tags = ['Informational', 'Relatedness', 'Affiliation', 'Weighted', 'Metadata']
url = 'https://data.discogs.com/'
citation = [('Discogs, "Discogs data dumps: releases, 1 October 2015."', 'https://data.discogs.com/')]
[entries] Use American spelling in the descriptions 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/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index eec987e..ad80599 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -21,7 +21,7 @@ import array
from lxml import etree
title = "Discogs label-genre and label-style affiliations (2015)"
-description = """Two bipartite networks of record labels and the genres or styles of their releases, from the Discogs database. Discogs (discogs.com) is a user-built online database of music recordings, whose contributors catalogue releases (albums, singles, compilations, etc.) with their labels, and classify each release into one or more of 15 broad genres (e.g. Rock, Electronic, Jazz) and, optionally, into finer styles (e.g. Deep House, Free Jazz, Punk); its content is published as monthly XML dumps. These networks are built from the releases dump of 1 October 2015, which contains the 6,379,659 releases accepted in the database at that time (drafts and the few rejected or deleted releases of the dump are excluded). Nodes are labels and genres (`genre`) or styles (`style`), and an undirected edge connects a label to a genre or style if the label has at least one release of that genre or style, weighted by the number of such releases. When a release has several labels (co-releases, sublabels, distributors listed as labels), each of them is connected to the genres and styles of the release.
+description = """Two bipartite networks of record labels and the genres or styles of their releases, from the Discogs database. Discogs (discogs.com) is a user-built online database of music recordings, whose contributors catalog releases (albums, singles, compilations, etc.) with their labels, and classify each release into one or more of 15 broad genres (e.g. Rock, Electronic, Jazz) and, optionally, into finer styles (e.g. Deep House, Free Jazz, Punk); its content is published as monthly XML dumps. These networks are built from the releases dump of 1 October 2015, which contains the 6,379,659 releases accepted in the database at that time (drafts and the few rejected or deleted releases of the dump are excluded). Nodes are labels and genres (`genre`) or styles (`style`), and an undirected edge connects a label to a genre or style if the label has at least one release of that genre or style, weighted by the number of such releases. When a release has several labels (co-releases, sublabels, distributors listed as labels), each of them is connected to the genres and styles of the release.
- `genre`: labels and genres.
- `style`: labels and styles.
[entries] Move more KONECT-derived entries to their original sources bf9dc0e
The entries now download the data from where KONECT obtained them (live, or via the Wayback Machine), using the same release as KONECT where it is still available, and gain the metadata KONECT dropped; descriptions and citations are rewritten from the original sources: - Linton Freeman's UCINET data page: bible_nouns, bison, cattle, hens, highschool, kangaroo, macaques, moreno_sheep, physician_trust (the three relations and the physicians' attributes), rhesus_monkey, train_terrorists, windsurfers (now the networks `interaction` and `closeness`), college_freshmen, crime, interactome_yeast (from the primary source), moreno_taro (undirected), residence_hall, zebras - other pages, archived: contiguous_usa, advogato, google, github, digg_reply, twitter, bookcrossing, dbtropes_feature (without KONECT's spurious "ItemName" tropes) - movielens_100k (in fact the MovieLens 10M tag assignments) - dblp release 2017-05-02: dblp_author_paper, dblp_cite, dblp_coauthor - DBpedia 3.9: dbpedia_country, dbpedia_genre, dbpedia_location, dbpedia_occupation, dbpedia_producer, dbpedia_recordlabel, dbpedia_starring, dbpedia_team, dbpedia_writer, dbpedia_all, dbpedia_link - Discogs releases dump of October 2015: discogs_affiliation, discogs_genre and discogs_label (now with genre and style networks)
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index 594b31a..eec987e 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -17,33 +17,130 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
+import array
+from lxml import etree
-title = "Discogs label affiliations"
-description = """Two bipartite networks of the affiliations between musical labels and either musical genres or musical \"styles,\" as given in the discogs.com database. Edges represent that a label was involved in a production of a musical release of a given genre or given style. The date of this snapshot is uncertain.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Informational', 'Relatedness', 'Unweighted', 'Multigraph']
-url = 'http://konect.cc/networks/discogs_lgenre'
-citation = [('J. Kunegis, "Discogs network dataset." KONECT (2016)', 'https://doi.org/10.1145/2487788.2488173')]
+title = "Discogs label-genre and label-style affiliations (2015)"
+description = """Two bipartite networks of record labels and the genres or styles of their releases, from the Discogs database. Discogs (discogs.com) is a user-built online database of music recordings, whose contributors catalogue releases (albums, singles, compilations, etc.) with their labels, and classify each release into one or more of 15 broad genres (e.g. Rock, Electronic, Jazz) and, optionally, into finer styles (e.g. Deep House, Free Jazz, Punk); its content is published as monthly XML dumps. These networks are built from the releases dump of 1 October 2015, which contains the 6,379,659 releases accepted in the database at that time (drafts and the few rejected or deleted releases of the dump are excluded). Nodes are labels and genres (`genre`) or styles (`style`), and an undirected edge connects a label to a genre or style if the label has at least one release of that genre or style, weighted by the number of such releases. When a release has several labels (co-releases, sublabels, distributors listed as labels), each of them is connected to the genres and styles of the release.
+
+- `genre`: labels and genres.
+- `style`: labels and styles.
+
+The dump of 2015 does not contain label ids, and labels are therefore identified by their names, which are unique in Discogs. Discogs uses placeholder labels such as "Not On Label" (with variants for self-released records), which are kept as nodes. Labels without any release with a genre (or style) are not included in the corresponding network.
+
+The networks have the following properties:
+
+- `is_label`: whether the node is a label (otherwise it is a genre or style).
+- `name`: the name of the label, genre or style.
+- Edges: `count`, the number of releases of that label with that genre or style; `first_year` and `last_year`, the earliest and latest release years among them (-1 if none of them has a known year; the years are as entered in Discogs, and a few are evidently mistyped)."""
+tags = ['Informational', 'Relatedness', 'Affiliation', 'Weighted', 'Metadata']
+url = 'https://data.discogs.com/'
+citation = [('Discogs, "Discogs data dumps: releases, 1 October 2015."', 'https://data.discogs.com/')]
icon_hash = '5759c68fbd3e93b53c6955e0'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.discogs_lgenre.tar.bz2', None, 'konect')]
+upstream_license = ("Creative Commons CC0 1.0 Universal (Public Domain Dedication)",
+ "https://creativecommons.org/publicdomain/zero/1.0/")
+dump = 'discogs_20151001_releases.xml.gz'
+upstream_prefix = 'https://data.discogs.com/?download=data%2F2015%2F'
+files = [(dump, 'genre', None), (dump, 'style', None)]
def fetch_upstream(force=False):
- return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
- force)
+ # The files are served under a query string, so they are downloaded
+ # here, streaming to disk (the dump has 3.4 GB)
+ name = __name__.split(".")[-1]
+ fname = f"cache/upstream/{name}/{dump}"
+ if os.path.exists(fname) and not force:
+ return
+ os.makedirs(os.path.dirname(fname), exist_ok=True)
+ with open_url(upstream_prefix + dump) as f, open(fname + ".part", "wb") as out:
+ shutil.copyfileobj(f, out, 1 << 24)
+ os.replace(fname + ".part", fname)
+
+def read_releases(f):
+ """Iterate over the accepted releases of a Discogs releases XML dump, yielding
+ (id, year, labels, artists, extra_artists, genres, styles), where artists
+ are (id, name) pairs, and labels, genres and styles are lists of distinct
+ names."""
+ def year(s):
+ s = (s or "")[:4]
+ return int(s) if s.isdigit() and int(s) > 0 else -1
+ def distinct(xs):
+ return list(dict.fromkeys(x for x in xs if x))
+ def artists(el, path):
+ return [(int(a.findtext("id")), a.findtext("name") or "")
+ for a in el.iterfind(path) if (a.findtext("id") or "").isdigit()]
+ for ev, el in etree.iterparse(f, events=("end",), tag="release"):
+ # A few releases are drafts, or were rejected or deleted
+ if el.get("status") == "Accepted":
+ yield (int(el.get("id")), year(el.findtext("released")),
+ distinct(l.get("name") for l in el.iterfind("labels/label")),
+ artists(el, "artists/artist"),
+ artists(el, "extraartists/artist"),
+ distinct(x.text for x in el.iterfind("genres/genre")),
+ distinct(x.text for x in el.iterfind("styles/style")))
+ el.clear()
+ while el.getprevious() is not None:
+ del el.getparent()[0]
+
+def aggregate(src, tgt, year):
+ """Collapse the (source, target, year) records into distinct (source,
+ target) pairs, with the number of records and the earliest and latest
+ known years."""
+ src = numpy.frombuffer(src, dtype="int64")
+ tgt = numpy.frombuffer(tgt, dtype="int64")
+ year = numpy.frombuffer(year, dtype="int64")
+ idx = numpy.lexsort((tgt, src))
+ src, tgt, year = src[idx], tgt[idx], year[idx]
+ start = numpy.flatnonzero(numpy.r_[True, (src[1:] != src[:-1]) |
+ (tgt[1:] != tgt[:-1])])
+ count = numpy.diff(numpy.r_[start, len(src)])
+ big = numpy.iinfo("int64").max
+ first = numpy.minimum.reduceat(numpy.where(year < 0, big, year), start)
+ first[first == big] = -1
+ last = numpy.maximum.reduceat(year, start)
+ return src[start], tgt[start], count, first, last
@cache_network()
-@coerce_props()
+@coerce_props(vforce={"name": "string"})
@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
- if isinstance(fnames, str):
- fnames = [fnames]
- with ExitStack() as stack:
- fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
- g = parse_graph(fs, fmt, directed=False)
+ alts = [alt for fn, alt, fmt in files if alts is None or alt in alts]
+ nodes = {} # key -> (index, name)
+ cats = {alt: {} for alt in alts} # genre/style name -> index
+ recs = {alt: (array.array("l"), array.array("l"), array.array("l"))
+ for alt in alts}
+ with open_upstream_file(name, dump, "rb") as f:
+ for rid, year, ls, main, xtra, genres, styles in read_releases(f):
+ us = [(l, l) for l in ls]
+ for alt, cs in (("genre", genres), ("style", styles)):
+ if alt not in recs or not cs:
+ continue
+ src, tgt, yr = recs[alt]
+ cidx = [cats[alt].setdefault(c, len(cats[alt])) for c in cs]
+ for key, uname in us:
+ u = nodes.setdefault(key, (len(nodes), uname))[0]
+ for c in cidx:
+ src.append(u)
+ tgt.append(c)
+ yr.append(year)
+ for alt in alts:
+ src, tgt, count, first, last = aggregate(*recs[alt])
+ recs[alt] = None
+ # Only the nodes with some edge in this network
+ used, src = numpy.unique(src, return_inverse=True)
+ N = len(used)
+ g = Graph(directed=False)
+ g.add_vertex(N + len(cats[alt]))
+ g.add_edge_list(numpy.column_stack((src, tgt + N)))
+ g.ep.count = g.new_ep("int32_t", vals=count)
+ g.ep.first_year = g.new_ep("int16_t", vals=first)
+ g.ep.last_year = g.new_ep("int16_t", vals=last)
+ g.vp.is_label = g.new_vp("bool")
+ g.vp.is_label.a[:N] = True
+ g.vp.name = g.new_vp("string")
+ keys = {i: n for k, (i, n) in nodes.items()}
+ for v, i in enumerate(used):
+ g.vp.name[v] = keys[i]
+ for c, i in cats[alt].items():
+ g.vp.name[N + i] = c
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index fded01e..594b31a 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# 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
Update copyright information 3d288ea
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index 4a1fd94..fded01e 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 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
Update copyright information 8d005ae
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index 84c8743..4a1fd94 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 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
Update copyright info db2efcc
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index e2602c9..84c8743 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 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
Un-orphan KONECT datasets 894eba5
KONECT has been brought back from the dead for the time being.
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index c7b538a..e2602c9 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/discogs_lgenre'
citation = [('J. Kunegis, "Discogs network dataset." KONECT (2016)', 'https://doi.org/10.1145/2487788.2488173')]
icon_hash = '5759c68fbd3e93b53c6955e0'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.discogs_lgenre.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Update citations to use DOIs e878874
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index 587dab2..c7b538a 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -23,7 +23,7 @@ description = """Two bipartite networks of the affiliations between musical labe
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Informational', 'Relatedness', 'Unweighted', 'Multigraph']
url = 'http://konect.cc/networks/discogs_lgenre'
-citation = [('J. Kunegis, "Discogs network dataset." KONECT (2016)', 'http://konect.cc/networks/')]
+citation = [('J. Kunegis, "Discogs network dataset." KONECT (2016)', 'https://doi.org/10.1145/2487788.2488173')]
icon_hash = '5759c68fbd3e93b53c6955e0'
upstream_prefix = 'http://konect.cc/files'
orphan = True
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index 7aa409f..587dab2 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/discogs_lgenre'
citation = [('J. Kunegis, "Discogs network dataset." KONECT (2016)', 'http://konect.cc/networks/')]
icon_hash = '5759c68fbd3e93b53c6955e0'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.discogs_lgenre.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index 1d8d555..7aa409f 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -3,18 +3,18 @@
#
# Copyright (C) 2020 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 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 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 General Public License for more details.
+# 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 General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# 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 *
Add explicit attribution to descriptions obtained from ICON 1645314
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
index 0f47600..1d8d555 100644
--- a/entries/discogs_label/__init__.py
+++ b/entries/discogs_label/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Discogs label affiliations"
-description = "Two bipartite networks of the affiliations between musical labels and either musical genres or musical \"styles,\" as given in the discogs.com database. Edges represent that a label was involved in a production of a musical release of a given genre or given style. The date of this snapshot is uncertain."
+description = """Two bipartite networks of the affiliations between musical labels and either musical genres or musical \"styles,\" as given in the discogs.com database. Edges represent that a label was involved in a production of a musical release of a given genre or given style. The date of this snapshot is uncertain.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Informational', 'Relatedness', 'Unweighted', 'Multigraph']
url = 'http://konect.cc/networks/discogs_lgenre'
citation = [('J. Kunegis, "Discogs network dataset." KONECT (2016)', 'http://konect.cc/networks/')]
Initial commit cc85872
diff --git a/entries/discogs_label/__init__.py b/entries/discogs_label/__init__.py
new file mode 100644
index 0000000..0f47600
--- /dev/null
+++ b/entries/discogs_label/__init__.py
@@ -0,0 +1,48 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 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 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "Discogs label affiliations"
+description = "Two bipartite networks of the affiliations between musical labels and either musical genres or musical \"styles,\" as given in the discogs.com database. Edges represent that a label was involved in a production of a musical release of a given genre or given style. The date of this snapshot is uncertain."
+tags = ['Informational', 'Relatedness', 'Unweighted', 'Multigraph']
+url = 'http://konect.cc/networks/discogs_lgenre'
+citation = [('J. Kunegis, "Discogs network dataset." KONECT (2016)', 'http://konect.cc/networks/')]
+icon_hash = '5759c68fbd3e93b53c6955e0'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.discogs_lgenre.tar.bz2', None, 'konect')]
+
+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
+ if isinstance(fnames, str):
+ fnames = [fnames]
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "rb")) for fn in fnames]
+ g = parse_graph(fs, fmt, directed=False)
+ yield alt, g