| Title: | Access the 'Finto' API |
|---|---|
| Description: | Access and retrieve vocabulary data 'Finto' API <https://api.finto.fi/>, which is a centralized service for interoperable thesauri, ontology and classification schemes for different subject areas. |
| Authors: | Akewak Jeba [aut, cre] (ORCID: <https://orcid.org/0009-0007-1347-7552>), Leo Lahti [aut] (ORCID: <https://orcid.org/0000-0001-5537-637X>) |
| Maintainer: | Akewak Jeba <[email protected]> |
| License: | BSD_2_clause + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-06-01 07:24:04 UTC |
| Source: | https://github.com/fennicahub/finto |
A 300-record sample from the Fennica dataset (Melinda) for demonstration and testing.
A data frame with 300 rows and 28 variables:
Melinda record ID (001)
MARC leader field
Fixed-length data elements (008)
Personal name of the main author (100a)
Birth/death dates or period of activity (100d)
Combined authority ID from fields 100$0 and 264a
Language code(s) (041a)
Original language (041h)
Uniform title (240a)
Main title (245a)
Remainder of title (245b)
Place of publication (260a)
Name of publisher (260b)
Dimensions (300c)
Extent (300a)
Publication frequency (310a)
Dates of publication (362a)
Call number or shelf mark
Library location (852a)
Universal Decimal Classification (080a)
Auxiliary UDC notation (080x)
Part/section of a work (245n)
Genre/form terms (655a)
Topical subject headings (650a)
General note (500a)
Added entry – personal name (700a)
Authority ID for added personal name (700$0)
Unidentified field (parsing artifact)
https://www.kansalliskirjasto.fi/fi/palvelut/fennica-suomen-kansallisbibliografia
This function retrieves RDF data for a given concept from the Finto API. The user only needs to provide the asteriID, which is appended to a fixed base URI.
fetch_kanto_info(asteriID, format = "application/json")fetch_kanto_info(asteriID, format = "application/json")
asteriID |
The unique identifier to append to the base URI. |
format |
The MIME type of the serialization format (e.g., "application/rdf+xml" or "text/turtle"). Default is "application/json". |
A tibble containing the RDF data for the concept.
concept_data <- fetch_kanto_info(asteriID = "000094320") print(concept_data)concept_data <- fetch_kanto_info(asteriID = "000094320") print(concept_data)
This function retrieves broader/narrower relationships and constructs a hierarchical structure.
fetch_profession_hierarchy(concept_uri, vocid = "mts", depth = 3)fetch_profession_hierarchy(concept_uri, vocid = "mts", depth = 3)
concept_uri |
The URI of the starting profession (root). |
vocid |
The vocabulary ID (default: "mts"). |
depth |
The depth of hierarchy to fetch (default: 3). |
A data.frame representing the hierarchy.
hierarchy_df <- fetch_profession_hierarchy("http://urn.fi/URN:NBN:fi:au:mts:m3357") print(hierarchy_df)hierarchy_df <- fetch_profession_hierarchy("http://urn.fi/URN:NBN:fi:au:mts:m3357") print(hierarchy_df)
This function queries the Finto API for a given concept URI and extracts all relevant metadata fields.
fetch_profession_info(concept_uri)fetch_profession_info(concept_uri)
concept_uri |
The URI of the concept to fetch. |
A tibble containing the full metadata.
metadata <- fetch_profession_info("http://urn.fi/URN:NBN:fi:au:mts:m3357") print(metadata)metadata <- fetch_profession_info("http://urn.fi/URN:NBN:fi:au:mts:m3357") print(metadata)
Helper function to send requests to the Finto Skosmos API
finto_api_request(endpoint, params = list())finto_api_request(endpoint, params = list())
endpoint |
API endpoint to request. |
params |
List of query parameters. |
Parsed JSON response from the API.
## Not run: finto_api_request("vocabularies") ## End(Not run)## Not run: finto_api_request("vocabularies") ## End(Not run)
Get the initial letters of the alphabetical index for labels in a specific vocabulary from the Finto Skosmos API
get_alphabetical_index_letters(vocid, lang = NULL)get_alphabetical_index_letters(vocid, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
lang |
The language of labels, e.g., "en" or "fi". Optional. |
A tibble containing the initial letters of the alphabetical index.
result <- get_alphabetical_index_letters(vocid = "yso", lang = "fi") print(result)result <- get_alphabetical_index_letters(vocid = "yso", lang = "fi") print(result)
Get broader concepts for a specific concept from the Finto Skosmos API
get_broader_concepts(vocid, uri, lang = NULL)get_broader_concepts(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose broader concepts to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing the broader concepts (prefLabel and uri) for the specified concept.
conepts <- get_broader_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(conepts)conepts <- get_broader_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(conepts)
Get broader transitive concepts for a specific concept from the Finto Skosmos API
get_broader_transitive_concepts(vocid, uri, lang = NULL)get_broader_transitive_concepts(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose broader transitive concepts to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing the broader transitive concepts (prefLabel and uri) for the specified concept.
concepts <- get_broader_transitive_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(concepts)concepts <- get_broader_transitive_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(concepts)
Get children concepts for a specific concept from the Finto Skosmos API
get_children_concepts(vocid, uri, lang = NULL)get_children_concepts(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose children concepts to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing the children concepts (prefLabel, uri, hasChildren) for the specified concept.
children <- get_children_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p690", lang = "fi") print(children)children <- get_children_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p690", lang = "fi") print(children)
Get RDF data for a specific concept from the Finto Skosmos API
get_concept_data(uri, format = "application/json")get_concept_data(uri, format = "application/json")
uri |
The URI of the concept to retrieve data for. |
format |
The MIME type of the serialization format (e.g., "application/rdf+xml" or "text/turtle"). Default is "application/json". |
A tibble containing the RDF data for the concept.
concept_data <- get_concept_data(uri = "http://www.yso.fi/onto/afo/") print(concept_data)concept_data <- get_concept_data(uri = "http://www.yso.fi/onto/afo/") print(concept_data)
Get concept groups for a given vocabulary from the Finto Skosmos API
get_concept_groups(vocid, lang = NULL)get_concept_groups(vocid, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
lang |
The language of labels, e.g., "en" or "fi". Optional. |
A tibble containing concept groups, with fields for URI, prefLabel, and hasMembers.
result <- get_concept_groups(vocid = "yso", lang = "fi") print(result)result <- get_concept_groups(vocid = "yso", lang = "fi") print(result)
Get labels for a specific concept from the Finto Skosmos API and return as a tibble
get_concept_labels(uri, lang = NULL)get_concept_labels(uri, lang = NULL)
uri |
The URI of the concept to retrieve labels for. |
lang |
The language of labels to retrieve, e.g., "en" or "fi". Optional. |
A tibble containing the URI, preferred label (prefLabel), alternative labels (altLabel), and hidden labels (hiddenLabel) for the concept.
labeles <- get_concept_labels(uri = "http://www.yso.fi/onto/koko/p91024", lang = "fi") print(labeles)labeles <- get_concept_labels(uri = "http://www.yso.fi/onto/koko/p91024", lang = "fi") print(labeles)
Get labels for a specific concept from the Finto Skosmos API
get_concept_labels_vocid(vocid, uri, lang = NULL)get_concept_labels_vocid(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose labels to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing the labels (prefLabel, altLabel, hiddenLabel) for the specified concept.
lables <- get_concept_labels_vocid(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(lables)lables <- get_concept_labels_vocid(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(lables)
Get concepts starting with a specific letter in the alphabetical index for a given vocabulary
get_concepts_by_letter(vocid, letter, lang = NULL)get_concepts_by_letter(vocid, letter, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
letter |
The initial letter, or "0-9" for numeric or "!*" for special character labels. |
lang |
The language of labels, e.g., "en" or "fi". Optional. |
A tibble containing concepts with labels starting with the given letter.
result <- get_concepts_by_letter(vocid = "yso", letter = "A", lang = "fi") print(result)result <- get_concepts_by_letter(vocid = "yso", letter = "A", lang = "fi") print(result)
Get members of a specific concept group from the Finto Skosmos API
get_group_members(vocid, uri, lang = NULL)get_group_members(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept group whose members to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing members associated with the specified concept group.
group_members_data <- get_group_members(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p26580", lang = "fi") print(head(group_members_data))group_members_data <- get_group_members(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p26580", lang = "fi") print(head(group_members_data))
Get the hierarchical context for a specific concept from the Finto Skosmos API
get_hierarchy(vocid, uri, lang = NULL)get_hierarchy(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose hierarchical context to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing the hierarchical context (broader, narrower, prefLabel, etc.) for the specified concept.
hierarchy <- get_hierarchy(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p24489", lang = "fi") print(hierarchy)hierarchy <- get_hierarchy(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p24489", lang = "fi") print(hierarchy)
This function extracts Asteri IDs from the 'author_ID' column as list, fetches RDF data from the Finto Skosmos API using those IDs, and returns a cleaned tibble with the retrieved metadata and profession labels.
get_kanto(data)get_kanto(data)
data |
A dataframe containing an 'author_ID' column with values like "(FIN11)000069536". |
A tibble with author_ID, RDF data, and extracted profession labels.
Get label statistics by language in a specific vocabulary from the Finto Skosmos API
get_label_statistics(vocid)get_label_statistics(vocid)
vocid |
The vocabulary ID, e.g., "yso". |
A tibble containing the label statistics for each language, with columns for language, literal, property, and label count.
result <- get_label_statistics(vocid = "yso") print(result)result <- get_label_statistics(vocid = "yso") print(result)
Get mappings for a specific concept from the Finto Skosmos API
get_mappings(vocid, uri, lang = NULL)get_mappings(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose mappings to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing mappings associated with the specified concept.
mappings_data <- get_mappings(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(mappings_data)mappings_data <- get_mappings(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p22922", lang = "fi") print(mappings_data)
Get modified concepts in a specific vocabulary from the Finto Skosmos API
get_modified_concepts(vocid, lang = NULL, offset = NULL, limit = NULL)get_modified_concepts(vocid, lang = NULL, offset = NULL, limit = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
lang |
The language of labels, e.g., "en" or "fi". Optional. |
offset |
Offset for the starting index of the results. Optional. |
limit |
Maximum number of concepts to return. Optional. |
A tibble containing the modified concepts with URI, label, and modification date.
result <- get_modified_concepts(vocid = "yso", lang = "fi", limit = 10) print(result)result <- get_modified_concepts(vocid = "yso", lang = "fi", limit = 10) print(result)
Get narrower concepts for a specific concept from the Finto Skosmos API
get_narrower_concepts(vocid, uri, lang = NULL)get_narrower_concepts(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose narrower concepts to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing the narrower concepts (prefLabel and uri) for the specified concept.
narrower_concepts <- get_narrower_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p690", lang = "fi") print(narrower_concepts)narrower_concepts <- get_narrower_concepts(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p690", lang = "fi") print(narrower_concepts)
Get narrower transitive concepts for a specific concept from the Finto Skosmos API
get_narrower_transitive(vocid, uri, lang = NULL)get_narrower_transitive(vocid, uri, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
uri |
The URI of the concept whose narrower transitive hierarchy to retrieve. |
lang |
The language code for the labels, e.g., "fi" or "en". Optional. |
A tibble containing the narrower transitive concepts (prefLabel and uri) for the specified concept.
narrow <- get_narrower_transitive(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p690", lang = "fi") print(narrow)narrow <- get_narrower_transitive(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p690", lang = "fi") print(narrow)
Get new concepts in a specific vocabulary from the Finto Skosmos API
get_new_concepts(vocid, lang = NULL, offset = NULL, limit = NULL)get_new_concepts(vocid, lang = NULL, offset = NULL, limit = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
lang |
The language of labels, e.g., "en" or "fi". Optional. |
offset |
Offset for the starting index of the results. Optional. |
limit |
Maximum number of concepts to return. Optional. |
A tibble containing the new concepts with URI, label, and creation date.
result <- get_new_concepts(vocid = "yso", lang = "fi", limit = 10) print(result)result <- get_new_concepts(vocid = "yso", lang = "fi", limit = 10) print(result)
Get top concepts of a specific vocabulary from the Finto Skosmos API
get_top_concepts(vocid, lang = NULL, scheme = NULL)get_top_concepts(vocid, lang = NULL, scheme = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
lang |
The language of labels to retrieve, e.g., "en" or "fi". Optional. |
scheme |
The concept scheme to retrieve top concepts from. Optional. |
A tibble containing the URI, label, topConceptOf, notation, and hasChildren for each top concept.
result <- get_top_concepts(vocid = "yso", lang = "fi") print(result)result <- get_top_concepts(vocid = "yso", lang = "fi") print(result)
Get information about the types (classes) of objects in all vocabularies from the Finto Skosmos API
get_types(lang = NULL)get_types(lang = NULL)
lang |
The language of labels to retrieve, e.g., "en" or "fi". Optional. |
A tibble containing the URI, label, and superclass for each type.
result <- get_types(lang = "fi") print(result)result <- get_types(lang = "fi") print(result)
Get available vocabularies from the Finto Skosmos API
get_vocabularies(lang = "fi")get_vocabularies(lang = "fi")
lang |
Language of labels, e.g., "en" or "fi" (default is "fi") |
A data frame with the vocabulary details: uri, id, and title
result <- get_vocabularies(lang = "fi") print(result)result <- get_vocabularies(lang = "fi") print(result)
Get and structure RDF data of the whole vocabulary or a specific concept from the Finto Skosmos API
get_vocabulary_data( vocid, format = "application/rdf+xml", uri = NULL, lang = NULL )get_vocabulary_data( vocid, format = "application/rdf+xml", uri = NULL, lang = NULL )
vocid |
The vocabulary ID, e.g., "yso". |
format |
The MIME type of the serialization format, e.g., "application/rdf+xml". Default is "application/rdf+xml". |
uri |
The URI of a specific concept to retrieve data for. If NULL, retrieves data for the entire vocabulary. Optional. |
lang |
The RDF language code for the requested resource, e.g., "fi" or "en". Optional. |
A character string containing the raw RDF response.
rdf_xml_data <- get_vocabulary_data( vocid = "yso", uri = "http://www.w3.org/2004/02/skos/core#Concept", format = "application/rdf+xml" ) cat(rdf_xml_data) turtle_data <- get_vocabulary_data( vocid = "yso", format = "text/turtle" ) cat(turtle_data) # Print the Turtle datardf_xml_data <- get_vocabulary_data( vocid = "yso", uri = "http://www.w3.org/2004/02/skos/core#Concept", format = "application/rdf+xml" ) cat(rdf_xml_data) turtle_data <- get_vocabulary_data( vocid = "yso", format = "text/turtle" ) cat(turtle_data) # Print the Turtle data
Get general information about a specific vocabulary from the Finto Skosmos API
get_vocabulary_info(vocid, lang = NULL)get_vocabulary_info(vocid, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
lang |
The language of labels to retrieve, e.g., "en" or "fi". Optional. |
A list containing the vocabulary details such as URI, title, languages, and concept schemes.
result <- get_vocabulary_info(vocid = "yso", lang = "fi") print(result)result <- get_vocabulary_info(vocid = "yso", lang = "fi") print(result)
Get vocabulary statistics as a single tibble containing concepts, subtypes, and concept groups
get_vocabulary_statistics(vocid, lang = NULL)get_vocabulary_statistics(vocid, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
lang |
The language of labels, e.g., "en" or "fi". Optional. |
A tibble containing counts of concepts, subtypes, and concept groups, with each entry in one row.
result <- get_vocabulary_statistics(vocid = "yso", lang = "fi") print(result)result <- get_vocabulary_statistics(vocid = "yso", lang = "fi") print(result)
This function retrieves information about the types (classes) of objects
in a given Finto/Skosmos vocabulary, using the /types endpoint.
get_vocabulary_types(vocid, lang = NULL)get_vocabulary_types(vocid, lang = NULL)
vocid |
A Skosmos vocabulary identifier, e.g. |
lang |
Optional language code for labels, e.g. |
A tibble with one row per type, typically containing columns
uri, label, and (optionally) superclass.
types <- get_vocabulary_types("yso", lang = "fi") print(types)types <- get_vocabulary_types("yso", lang = "fi") print(types)
Look up concepts by label in a specific vocabulary from the Finto Skosmos API
lookup_concept_by_label(vocid, label, lang = NULL)lookup_concept_by_label(vocid, label, lang = NULL)
vocid |
The vocabulary ID, e.g., "yso". |
label |
The label to look up, e.g., "cat". |
lang |
The search language, e.g., "en" or "fi". Optional. |
A tibble containing the best matching concept(s) with fields like uri, type, prefLabel, and altLabel.
result <- lookup_concept_by_label(vocid = "yso", label = "cat", lang = "en") print(result)result <- lookup_concept_by_label(vocid = "yso", label = "cat", lang = "en") print(result)
Search for concepts in the Finto Skosmos API by query term with additional parameters
search_concepts( query, lang = NULL, labellang = NULL, vocab = NULL, type = NULL, parent = NULL, group = NULL, maxhits = NULL, offset = NULL, fields = NULL, unique = NULL )search_concepts( query, lang = NULL, labellang = NULL, vocab = NULL, type = NULL, parent = NULL, group = NULL, maxhits = NULL, offset = NULL, fields = NULL, unique = NULL )
query |
The term to search for, e.g., "sibelius". |
lang |
Language of labels to match, e.g., "en" or "fi". Optional. |
labellang |
Language of labels to return, e.g., "en" or "fi". Optional. |
vocab |
Vocabulary or vocabularies to limit search to, e.g., "yso". Optional. |
type |
Limit search to concepts of the given type(s), e.g., "skos:Concept". Optional. |
parent |
Limit search to concepts which have the given concept as a parent. Optional. |
group |
Limit search to concepts in a specific group. Optional. |
maxhits |
Maximum number of results to return (default is 191 as per the screenshot). Optional. |
offset |
Offset to start in the result set, useful for paging. Optional. |
fields |
Extra fields to include in the results (space-separated list). Optional. |
unique |
Boolean flag to return each concept only once. Optional. |
A data frame containing search results with columns: uri, type, prefLabel, altLabel, hiddenLabel, lang, and vocab.
concepts <- search_concepts(query = "sibelius", lang = "fi") print(concepts)concepts <- search_concepts(query = "sibelius", lang = "fi") print(concepts)
Search for concepts and collections in a specific vocabulary from the Finto Skosmos API
search_vocabulary_concepts( vocid, query, lang = NULL, type = NULL, maxhits = NULL, offset = NULL )search_vocabulary_concepts( vocid, query, lang = NULL, type = NULL, maxhits = NULL, offset = NULL )
vocid |
The vocabulary ID, e.g., "yso". |
query |
The search term, e.g., "cat*". |
lang |
The language of labels to match, e.g., "en" or "fi". Optional. |
type |
Limit search to concepts of a given type, e.g., "skos:Concept". Optional. |
maxhits |
Maximum number of results to return. Optional. |
offset |
Offset where to start in the result set, useful for paging. Optional. |
A tibble containing the search results with fields such as uri, type, prefLabel, and altLabel.
search_results <- search_vocabulary_concepts(vocid = "yso", query = "cat", lang = "en") print(search_results)search_results <- search_vocabulary_concepts(vocid = "yso", query = "cat", lang = "en") print(search_results)
Fetch place information from YSO places (yso-paikat)
yso_place(x)yso_place(x)
x |
Place id, page URL, or YSO URI |
A one-row tibble with key fields for the place
place <- yso_place("http://www.yso.fi/onto/yso/p94257") print(place)place <- yso_place("http://www.yso.fi/onto/yso/p94257") print(place)