Viola is the Finnish national discography and the national bibliography of sheet music, maintained by the National Library of Finland. It contains information on Finnish music recordings and sheet music, as well as music archives included in the National Library's collections.
This R Markdown document provides a comprehensive guide to querying and analyzing Viola collection data using the Finna API and the fetch_viola_records
function.
The fetch_viola_records
function allows batch processing of data from the Viola collection in Finna, across multiple year ranges, and handles records without date information.
The following example fetches data from the Viola collection for the year ranges: 0–1699, 1700–1799, and 1800–1899.
library(finna) # Fetch records results <- fetch_viola_records( base_query = "*", base_filters = c('collection:"VIO"'), # Filters for the Viola collection year_ranges = list(c(0,1699),c(1700,1799),c(1800,1899)), # Year ranges to query include_na = TRUE, # Include records with missing dates limit_per_query = 100000, # Maximum records per query total_limit = Inf, # Overall record limit delay_after_query = 3 # Delay between API calls ) # View the number of records fetched print(nrow(results)) head(results)
You can also fetch records missing the main_date_str
field:
# Fetch undated records undated_records <- search_finna( query = "*", filters = c('collection:"VIO"', '-main_date_str:*'), limit = Inf ) # View undated records print(undated_records)
The Viola collection data can be visualized using metadata refinement and plotting functions.
library(finna) library(ggplot2) # Refine metadata and visualize author distribution refined_data <- refine_metadata(results) top_plot(refined_data, field = "Year") + xlab("Frequency") + # Custom X-axis label ylab("Year") # Custom Y-axis label
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.