Post-Classical Clean Up 4: Hyperion


In [1]:
%run startup.ipy


Last notebook update: 2018-06-06
Git repo: git@bitbucket.org:loujine/musicbrainz-dataviz.git
Importing libs
Defining database parameters

Defining *sql* helper function
Last database update: 2018-06-02

Python packages versions:
numpy       1.14.3
pandas      0.23.0
sqlalchemy  1.2.8
CPython 3.7.0b5
IPython 6.4.0

In [2]:
label = 'hyperion'

In [3]:
import pandas as pd
pd.set_option('display.max_colwidth', -1)

In [4]:
df = sql("""SELECT id, gid, name, comment FROM label WHERE name IN ('hyperion', 'helios');""")
label_mbid = df.gid.tolist()
df.head()


Out[4]:
id gid name comment
0 388 08e6c3c8-81ab-405f-9cff-10f6b8db064c hyperion UK classical
1 22708 0a94e96a-9219-4dd7-a529-18d34e77f50f helios UK classical

 New releases added after Feb. 1st

Actually I'm checking when "release label" links were added to release, which is most of the time done together.


In [5]:
new_releases = sql("""
SELECT editor.name AS editor,
       COUNT(*) AS edit_count
  FROM label
  JOIN edit_label  ON label.id = edit_label.label
  JOIN edit        ON edit.id = edit_label.edit
  JOIN editor      ON editor.id = edit.editor
 WHERE label.name IN ('hyperion', 'helios')
   AND edit.open_time >= '2018-02-01'
GROUP BY editor.name
ORDER BY edit_count DESC
   ;""")
new_releases


Out[5]:
editor edit_count
0 loujin 99
1 reosarevok 42
2 ListMyCDs.com 38
3 mmirG 19
4 MetaTunes 15
5 stupidname 11
6 steinbdj 9
7 CatCat 8
8 Griomo 5
9 mhendu 4
10 ntitley 2
11 PeaceablePisces94 2
12 beedaddy 2
13 loadfix 1
14 ghenriks 1
15 Magic_ 1
16 obtext 1
17 Hape40 1
18 mll 1
19 wcw1966 1
20 Mellthas 1
21 djphrydy 1
22 AllanBjorklund 1
23 Ataki 1
24 dj_judas21 1

In [6]:
new_releases.edit_count.sum()


Out[6]:
268

Recording edits

Find all edits between Feb. 1st and March 14th regarding recordings present on Hyperion/Helios releases


In [7]:
recording_edits = sql("""
SELECT editor.name AS editor,
       COUNT(*) AS edit_count
  FROM recording     AS rec
  JOIN edit_recording      ON rec.id = edit_recording.recording
  JOIN edit                ON edit.id = edit_recording.edit
  JOIN editor              ON editor.id = edit.editor
  JOIN track               on track.recording = rec.id
  JOIN medium        AS m  ON track.medium = m.id
  JOIN release       AS r  ON m.release = r.id
  JOIN release_label AS rl ON rl.release = r.id
  JOIN label               ON rl.label = label.id
 WHERE label.name IN ('hyperion', 'helios')
   AND edit.open_time >= '2018-02-01'
GROUP BY editor.name
ORDER BY edit_count DESC
   ;""")
recording_edits


Out[7]:
editor edit_count
0 loujin 22106
1 reosarevok 14867
2 ListMyCDs.com 11245
3 stupidname 10799
4 CatCat 5395
5 dosoe 3747
6 obtext 3065
7 steinbdj 1357
8 MetaTunes 1233
9 Griomo 807
10 Magic_ 780
11 mmirG 628
12 monxton 567
13 BitPerfectRichard 546
14 ProfChris 435
15 wonder_al 414
16 PeaceablePisces94 353
17 Verbex 252
18 MajorLurker 177
19 Mellthas 144
20 ntitley 124
21 mhendu 120
22 djphrydy 116
23 beedaddy 76
24 Hape40 75
25 dj_judas21 65
26 fmera 48
27 wcw1966 48
28 loadfix 37
29 RichardKS 37
30 ghenriks 20
31 AllanBjorklund 19
32 wanda2 14
33 mll 13
34 MrH 4
35 Sophist 1

In [8]:
recording_edits.edit_count.sum()


Out[8]:
79734

 Release covers added


In [9]:
sql("""
SELECT COUNT(*) AS edit_count
  FROM release        AS r
  JOIN edit_release        ON r.id = edit_release.release
  JOIN edit                ON edit.id = edit_release.edit
  JOIN release_label AS rl ON rl.release = r.id
  JOIN label               ON rl.label = label.id
 WHERE label.name IN ('hyperion', 'helios')
   AND edit.open_time >= '2018-02-01'
   AND edit.type = 314
   ;""")


Out[9]:
edit_count
0 486

phonographic relationships added on recordings

NB: Phonographic copyright ℗ should use 'Hyperion Records Ltd', not Hyperion or Helios


In [10]:
sql("""
SELECT COUNT(*) AS edit_count
  FROM recording     AS r
  JOIN edit_recording      ON r.id = edit_recording.recording
  JOIN edit                ON edit.id = edit_recording.edit
  JOIN l_label_recording AS lar ON r.id = lar.entity1
  JOIN label                    ON label.id = lar.entity0
  JOIN link                     ON link.id = lar.link
 WHERE label.name = 'Hyperion Records Ltd, London'
   AND edit.open_time >= '2018-02-01'
   AND link.link_type = 867
;""")


Out[10]:
edit_count
0 30200

Booklet editor relation

Relation created for this community sprint if I'm not mistaken


In [11]:
sql("""
SELECT a.name, COUNT(*) AS cnt
  FROM release            AS r
  JOIN l_artist_release   AS lar ON r.id = lar.entity1
  JOIN artist             AS a   ON a.id = lar.entity0
  JOIN link               AS l   ON l.id = lar.link
 WHERE l.link_type=929
 GROUP BY a.name
 ORDER BY cnt DESC
 LIMIT 5
""")


Out[11]:
name cnt
0 Tim Parry 101
1 Nick Flower 8
2 Peter Hall 8
3 Finn S. Gundersen 8
4 Eleanor Wilson 5

4 of those 5 work for Hyperion

Recording engineer relation


In [13]:
sql("""
SELECT a.name, COUNT(*) AS cnt
  FROM recording          AS r
  JOIN l_artist_recording AS lar ON r.id = lar.entity1
  JOIN artist             AS a   ON a.id = lar.entity0
  JOIN link               AS l   ON l.id = lar.link
 WHERE l.link_type=128
 GROUP BY a.name
 ORDER BY cnt DESC
 LIMIT 20
""")


Out[13]:
name cnt
0 Rudy van Gelder 5558
1 Antony Howell 2078
2 Tony Faulkner 1582
3 Simon Eadon 1233
4 John Cooper 1155
5 Juha Norlund 941
6 秋田昌美 930
7 Lewis Layton 907
8 Philip Hobbs 810
9 Shawn Murphy 778
10 Julian Millard 723
11 Enno Mäemets 714
12 相澤光紀 688
13 Alan Lomax 684
14 David Hinitt 603
15 Peter Arts 575
16 Florian Oestreicher 575
17 James A. Farber 569
18 C. Jared Sacks 565
19 Chris Anderson 557

(Recording) producer relation


In [14]:
sql("""
SELECT a.name, COUNT(*) AS cnt
  FROM recording          AS r
  JOIN l_artist_recording AS lar ON r.id = lar.entity1
  JOIN artist             AS a   ON a.id = lar.entity0
  JOIN link               AS l   ON l.id = lar.link
 WHERE l.link_type=141
 GROUP BY a.name
 ORDER BY cnt DESC
 LIMIT 20
""")


Out[14]:
name cnt
0 Andrew Keener 3485
1 Manfred Eicher 3209
2 Brian Couzens 2426
3 James Mallinson 2255
4 Hans Weber 2186
5 Martin Compton 2055
6 Alfred Lion 2049
7 Martin Sauer 1943
8 James Ginsburg 1869
9 Walter Legge 1868
10 Mark Brown 1848
11 Norman Granz 1713
12 John Fraser 1638
13 Michel Glotz 1575
14 Andrew Cornall 1498
15 Orrin Keepnews 1451
16 Seppo Siirala 1436
17 Günter Appenheimer 1396
18 Ingo Petry 1326
19 Richard Mohr 1308