Research in programming Wikidata/Musical Compositions
This article is about research of musical compositions using the knowledge base of international project called Wikidata. With the help of SPARQL queries for items classified as "musical compositions" the following were received: the list of all musical compositions, the list of musical compositions that has a composer, the bubble diagram for composers that shows composers with most compositions. Moreover, the task of searching music gaps in public domain was done and completeness of Wikidata was evaluated.
List of musical compositions
edit- Item: musical composition (Q207628).
- Property: instance of (P31).
Let's build a list of all musical compositions.
#List of all musical compositions
SELECT ?composition ?compositionLabel
WHERE {
?composition wdt:P31 wd:Q207628.
SERVICE wikibase:label { bd:serviceParam wikibase:language "ru". }
}
SPARQL query, 5494 records.
👍>The most complete and well-developed musical compositions on Wikidata are The Magic Flute, Für Elise, Mozart's Requiem, Eine kleine Nachtmusik.
👎>Almost empty and uninformative musical compositions were Flight of the Bumblebee, Romeo and Juliet, Iron Foundry, Binks’ Waltz, The Rose-bud March, Leola.
Search music gaps in public domain
editThe task is to find musical works the composers of which passed away more than 70 years ago and audios of which are absent from Wikimedia Commons. The list of compositions must be sorted the in ascending order by publication date. This script can be used to find musical compositions that need to be digitized and then uploaded to Wikimedia Commons.
#Search music gaps in public domain
SELECT ?composition ?compositionLabel ?publication
WHERE {
?composition wdt:P31 wd:Q207628. # instance of compostion
?composition wdt:P86 ?composer. # composition has a composer
?composition wdt:P577 ?publication. # composition has a publication date
?composer wdt:P570 ?death. # composer has a date of death
MINUS {?composition wdt:P51 []}. # compositions without audio
FILTER(?death < "1947-01-01T00:00:00Z"^^xsd:dateTime) # composers that passed away more than 70 years ago
FILTER(?publication < "1947-01-01T00:00:00Z"^^xsd:dateTime) # compositions that were published more than 70 years ago
SERVICE wikibase:label { bd:serviceParam wikibase:language "ru". }
}
ORDER BY ASC(?publication)
SPARQL query, 140 records.
Completeness of Wikidata
editLet's analyze the completeness of Wikidata .
According to Grove Dictionary of Music and Musicians[1] there are 20374 composers.
According to the category "List of composers by name" of Russian Wikipedia there are 6130 composers.
According to the category "List of composers by name" of English Wikipedia there are 4685 composers.
The number of musical compositions with filled property "composer (P86)" equals 3862, which is shown in SPARQL query, and that's if you take into account the fact that one composer could have written several musical compositions. For example Wolfgang Amadeus Mozart is the composer of 95 compositions, which decreases the number of unique composers. The number of 3862 is lower than the amount of composers from both Russian and English Wikipedia and substantially lower than the amount of composers from Grove Dictionary of Music and Musicians which confirms the incompleteness of Wikidata.
SPARQL query for compositions with filled property "composer (P86)" and property "country of origin (P495)" with value of "Russian Empire (Q34266)", "USSR (Q15180)" or "Russia (Q159)", gave us only 8 compositions, which means that it's impossible to analyze Russian musical compositions due to lack of data.
Let's build the bubble diagram for composers of musical compositions.
#composers of musical compositions
#defaultView:BubbleChart
SELECT ?composer ?form (COUNT(*) AS ?count) WHERE {
?composition wdt:P31 wd:Q207628. # instance of composition
?composition wdt:P86 ?composer. # composition has a composer
OPTIONAL {
?composer rdfs:label ?form.
FILTER((LANG(?form)) = "en")
}
}
GROUP BY ?composer ?form
ORDER BY DESC(?count) ?form
SPARQL query, 773 records.
Size of a bubble tells us about the amount of musical compositions. This diagram shows us that some composers have more compositions that the others. Top 5 includes Niels Gade (173 compositions), Johann Sebastian Bach (155 compositions), Christian Sinding (125 compositions), Johan Halvorsen (121 compositions), Alan Hovhaness (108 compositions).
Filling of Wikidata
editThe decision was made to fill "composer (P86)" property for "musical composition (Q207628)" items to get better results while performing the query for searching music gaps in public domain.
Let's build a list of all musical compostions with filled property "composer (P86)".
#Lists of compositions that has a composer in Russian
SELECT ?composition ?compositionLabel ?composer ?composerLabel
WHERE {
?composition wdt:P31 wd:Q207628. # instance of composition
?composition wdt:P86 ?composer. # composition has a composer
SERVICE wikibase:label { bd:serviceParam wikibase:language "ru". }
}
}
SPARQL query, 3864 records at 30/10/2017, 10:51.
SPARQL query, 3965 records at 30/10/2017, 12:47.
Future work
edit- Find a list of musical compositions that were created during The Age of Classicism (XVII—XVIII centuries).
Property: "inception (P571)". - Find a composer that had written more symphonies than the others.
Properties: "instance of (P31)", "composer (P86)". - Build a histogram that displays the amount of songs by The Beatles by the year of publication.
Properties: "performer (P175)", "publication date (P577)".
Tasks
edit
SPARQL query with answers:
- SPARQL query for the list of composers sorted in ascending order by the amount of compositions, 782 records.
- SPARQL query for the list of musical compositions that had been created in Russian Empire, 4 records.
- SPARQL query for the list of all musical compostions, 5259 records.
- SPARQL query for the list of compositions that were created in 21st century, 5 records.
- SPARQL query for the list of compositions that were created in 20th century, 49 records.
- SPARQL query for musical compositions that contain logos, 9 records.
Notes
editReferences
edit- "Grove Dictionary of Music and Musicians". Oxford University Press. 2001.
- Krizhanovsky A., Vershinin I. The search of music gaps in public domain using Wikidata // Nauchkor