Title: Access the 'Finto' API
Version: 0.1.1
Date: 2025-10-29
Maintainer: Akewak Jeba <akjeba@utu.fi>
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.
License: BSD_2_clause + file LICENSE
Encoding: UTF-8
Imports: tibble, httr, dplyr, jsonlite, tidyr, stringr, purrr
Suggests: testthat (≥ 3.0.0), rmarkdown, knitr
URL: https://fennicahub.github.io/finto/
BugReports: https://github.com/fennicahub/finto/issues
RoxygenNote: 7.3.2
Config/testthat/edition: 3
VignetteBuilder: knitr
Depends: R (≥ 3.5)
NeedsCompilation: no
Packaged: 2025-11-19 15:14:17 UTC; akasia
Author: Akewak Jeba ORCID iD [aut, cre], Leo Lahti ORCID iD [aut]
Repository: CRAN
Date/Publication: 2025-11-24 09:30:17 UTC

Fetch RDF data for a specific concept from the Finto Skosmos API using a single asteriID

Description

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.

Usage

fetch_kanto_info(asteriID, format = "application/json")

Arguments

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".

Value

A tibble containing the RDF data for the concept.

Examples

concept_data <- fetch_kanto_info(asteriID = "000094320")
print(concept_data)

Fetch hierarchy of professions from Finto API

Description

This function retrieves broader/narrower relationships and constructs a hierarchical structure.

Usage

fetch_profession_hierarchy(concept_uri, vocid = "mts", depth = 3)

Arguments

concept_uri

The URI of the starting profession (root).

vocid

The vocabulary ID (default: "mts").

depth

The depth of hierarchy to fetch (default: 3).

Value

A data.frame representing the hierarchy.

Examples

hierarchy_df <- fetch_profession_hierarchy("http://urn.fi/URN:NBN:fi:au:mts:m3357")
print(hierarchy_df)

Fetch all metadata from Finto Skosmos API

Description

This function queries the Finto API for a given concept URI and extracts all relevant metadata fields.

Usage

fetch_profession_info(concept_uri)

Arguments

concept_uri

The URI of the concept to fetch.

Value

A tibble containing the full metadata.

Examples

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

Description

Helper function to send requests to the Finto Skosmos API

Usage

finto_api_request(endpoint, params = list())

Arguments

endpoint

API endpoint to request.

params

List of query parameters.

Value

Parsed JSON response from the API.

Examples

## 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

Description

Get the initial letters of the alphabetical index for labels in a specific vocabulary from the Finto Skosmos API

Usage

get_alphabetical_index_letters(vocid, lang = NULL)

Arguments

vocid

The vocabulary ID, e.g., "yso".

lang

The language of labels, e.g., "en" or "fi". Optional.

Value

A tibble containing the initial letters of the alphabetical index.

Examples

result <- get_alphabetical_index_letters(vocid = "yso", lang = "fi")
print(result)

Get broader concepts for a specific concept from the Finto Skosmos API

Description

Get broader concepts for a specific concept from the Finto Skosmos API

Usage

get_broader_concepts(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing the broader concepts (prefLabel and uri) for the specified concept.

Examples

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

Description

Get broader transitive concepts for a specific concept from the Finto Skosmos API

Usage

get_broader_transitive_concepts(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing the broader transitive concepts (prefLabel and uri) for the specified concept.

Examples

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

Description

Get children concepts for a specific concept from the Finto Skosmos API

Usage

get_children_concepts(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing the children concepts (prefLabel, uri, hasChildren) for the specified concept.

Examples

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

Description

Get RDF data for a specific concept from the Finto Skosmos API

Usage

get_concept_data(uri, format = "application/json")

Arguments

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".

Value

A tibble containing the RDF data for the concept.

Examples

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

Description

Get concept groups for a given vocabulary from the Finto Skosmos API

Usage

get_concept_groups(vocid, lang = NULL)

Arguments

vocid

The vocabulary ID, e.g., "yso".

lang

The language of labels, e.g., "en" or "fi". Optional.

Value

A tibble containing concept groups, with fields for URI, prefLabel, and hasMembers.

Examples

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

Description

Get labels for a specific concept from the Finto Skosmos API and return as a tibble

Usage

get_concept_labels(uri, lang = NULL)

Arguments

uri

The URI of the concept to retrieve labels for.

lang

The language of labels to retrieve, e.g., "en" or "fi". Optional.

Value

A tibble containing the URI, preferred label (prefLabel), alternative labels (altLabel), and hidden labels (hiddenLabel) for the concept.

Examples

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

Description

Get labels for a specific concept from the Finto Skosmos API

Usage

get_concept_labels_vocid(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing the labels (prefLabel, altLabel, hiddenLabel) for the specified concept.

Examples

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

Description

Get concepts starting with a specific letter in the alphabetical index for a given vocabulary

Usage

get_concepts_by_letter(vocid, letter, lang = NULL)

Arguments

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.

Value

A tibble containing concepts with labels starting with the given letter.

Examples

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

Description

Get members of a specific concept group from the Finto Skosmos API

Usage

get_group_members(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing members associated with the specified concept group.

Examples

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

Description

Get the hierarchical context for a specific concept from the Finto Skosmos API

Usage

get_hierarchy(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing the hierarchical context (broader, narrower, prefLabel, etc.) for the specified concept.

Examples

hierarchy <- get_hierarchy(vocid = "yso", uri = "http://www.yso.fi/onto/yso/p24489", lang = "fi")
print(hierarchy)

Process and Fetch KANTO Information using a list of author_IDs as column

Description

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.

Usage

get_kanto(data)

Arguments

data

A dataframe containing an 'author_ID' column with values like "(FIN11)000069536".

Value

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

Description

Get label statistics by language in a specific vocabulary from the Finto Skosmos API

Usage

get_label_statistics(vocid)

Arguments

vocid

The vocabulary ID, e.g., "yso".

Value

A tibble containing the label statistics for each language, with columns for language, literal, property, and label count.

Examples

result <- get_label_statistics(vocid = "yso")
print(result)

Get mappings for a specific concept from the Finto Skosmos API

Description

Get mappings for a specific concept from the Finto Skosmos API

Usage

get_mappings(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing mappings associated with the specified concept.

Examples

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

Description

Get modified concepts in a specific vocabulary from the Finto Skosmos API

Usage

get_modified_concepts(vocid, lang = NULL, offset = NULL, limit = NULL)

Arguments

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.

Value

A tibble containing the modified concepts with URI, label, and modification date.

Examples

result <- get_modified_concepts(vocid = "yso", lang = "fi", limit = 10)
print(result)

Get narrower concepts for a specific concept from the Finto Skosmos API

Description

Get narrower concepts for a specific concept from the Finto Skosmos API

Usage

get_narrower_concepts(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing the narrower concepts (prefLabel and uri) for the specified concept.

Examples

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

Description

Get narrower transitive concepts for a specific concept from the Finto Skosmos API

Usage

get_narrower_transitive(vocid, uri, lang = NULL)

Arguments

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.

Value

A tibble containing the narrower transitive concepts (prefLabel and uri) for the specified concept.

Examples

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

Description

Get new concepts in a specific vocabulary from the Finto Skosmos API

Usage

get_new_concepts(vocid, lang = NULL, offset = NULL, limit = NULL)

Arguments

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.

Value

A tibble containing the new concepts with URI, label, and creation date.

Examples

result <- get_new_concepts(vocid = "yso", lang = "fi", limit = 10)
print(result)

Description

Get related concepts for a specific concept from the Finto Skosmos API

Usage

get_related_concepts(vocid, uri, lang = NULL)

Arguments

vocid

The vocabulary ID, e.g., "yso".

uri

The URI of the concept whose related concepts to retrieve.

lang

The language code for the labels, e.g., "fi" or "en". Optional.

Value

A tibble containing the related concepts (prefLabel and uri) for the specified concept.

Examples

related <- get_related_concepts(vocid = "yso",
uri = "http://www.yso.fi/onto/yso/p24489", lang = "fi")
print(related)

Get top concepts of a specific vocabulary from the Finto Skosmos API

Description

Get top concepts of a specific vocabulary from the Finto Skosmos API

Usage

get_top_concepts(vocid, lang = NULL, scheme = NULL)

Arguments

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.

Value

A tibble containing the URI, label, topConceptOf, notation, and hasChildren for each top concept.

Examples

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

Description

Get information about the types (classes) of objects in all vocabularies from the Finto Skosmos API

Usage

get_types(lang = NULL)

Arguments

lang

The language of labels to retrieve, e.g., "en" or "fi". Optional.

Value

A tibble containing the URI, label, and superclass for each type.

Examples

result <- get_types(lang = "fi")
print(result)

Get available vocabularies from the Finto Skosmos API

Description

Get available vocabularies from the Finto Skosmos API

Usage

get_vocabularies(lang = "fi")

Arguments

lang

Language of labels, e.g., "en" or "fi" (default is "fi")

Value

A data frame with the vocabulary details: uri, id, and title

Examples

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

Description

Get and structure RDF data of the whole vocabulary or a specific concept from the Finto Skosmos API

Usage

get_vocabulary_data(
  vocid,
  format = "application/rdf+xml",
  uri = NULL,
  lang = NULL
)

Arguments

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.

Value

A character string containing the raw RDF response.

Examples


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 data


Get general information about a specific vocabulary from the Finto Skosmos API

Description

Get general information about a specific vocabulary from the Finto Skosmos API

Usage

get_vocabulary_info(vocid, lang = NULL)

Arguments

vocid

The vocabulary ID, e.g., "yso".

lang

The language of labels to retrieve, e.g., "en" or "fi". Optional.

Value

A list containing the vocabulary details such as URI, title, languages, and concept schemes.

Examples

result <- get_vocabulary_info(vocid = "yso", lang = "fi")
print(result)

Get vocabulary statistics as a single tibble containing concepts, subtypes, and concept groups

Description

Get vocabulary statistics as a single tibble containing concepts, subtypes, and concept groups

Usage

get_vocabulary_statistics(vocid, lang = NULL)

Arguments

vocid

The vocabulary ID, e.g., "yso".

lang

The language of labels, e.g., "en" or "fi". Optional.

Value

A tibble containing counts of concepts, subtypes, and concept groups, with each entry in one row.

Examples

result <- get_vocabulary_statistics(vocid = "yso", lang = "fi")
print(result)

Get type information for a Finto vocabulary

Description

This function retrieves information about the types (classes) of objects in a given Finto/Skosmos vocabulary, using the ⁠/types⁠ endpoint.

Usage

get_vocabulary_types(vocid, lang = NULL)

Arguments

vocid

A Skosmos vocabulary identifier, e.g. "yso".

lang

Optional language code for labels, e.g. "fi" or "en". If NULL (default), the API's default language is used.

Value

A tibble with one row per type, typically containing columns uri, label, and (optionally) superclass.

Examples

types <- get_vocabulary_types("yso", lang = "fi")
print(types)

Look up concepts by label in a specific vocabulary from the Finto Skosmos API

Description

Look up concepts by label in a specific vocabulary from the Finto Skosmos API

Usage

lookup_concept_by_label(vocid, label, lang = NULL)

Arguments

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.

Value

A tibble containing the best matching concept(s) with fields like uri, type, prefLabel, and altLabel.

Examples

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

Description

Search for concepts in the Finto Skosmos API by query term with additional parameters

Usage

search_concepts(
  query,
  lang = NULL,
  labellang = NULL,
  vocab = NULL,
  type = NULL,
  parent = NULL,
  group = NULL,
  maxhits = NULL,
  offset = NULL,
  fields = NULL,
  unique = NULL
)

Arguments

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.

Value

A data frame containing search results with columns: uri, type, prefLabel, altLabel, hiddenLabel, lang, and vocab.

Examples

concepts <- search_concepts(query = "sibelius", lang = "fi")
print(concepts)

Search for concepts and collections in a specific vocabulary from the Finto Skosmos API

Description

Search for concepts and collections in a specific vocabulary from the Finto Skosmos API

Usage

search_vocabulary_concepts(
  vocid,
  query,
  lang = NULL,
  type = NULL,
  maxhits = NULL,
  offset = NULL
)

Arguments

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.

Value

A tibble containing the search results with fields such as uri, type, prefLabel, and altLabel.

Examples

search_results <- search_vocabulary_concepts(vocid = "yso", query = "cat", lang = "en")
print(search_results)