Package: tidywikidatar 0.5.9.9000

Giorgio Comai

tidywikidatar: Explore 'Wikidata' Through Tidy Data Frames

Query 'Wikidata' API <https://www.wikidata.org/wiki/Wikidata:Main_Page> with ease, get tidy data frames in response, and cache data in a local database.

Authors:Giorgio Comai [aut, cre, cph], EDJNet [fnd]

tidywikidatar_0.5.9.9000.tar.gz
tidywikidatar_0.5.9.9000.zip(r-4.5)tidywikidatar_0.5.9.9000.zip(r-4.4)tidywikidatar_0.5.9.9000.zip(r-4.3)
tidywikidatar_0.5.9.9000.tgz(r-4.4-any)tidywikidatar_0.5.9.9000.tgz(r-4.3-any)
tidywikidatar_0.5.9.9000.tar.gz(r-4.5-noble)tidywikidatar_0.5.9.9000.tar.gz(r-4.4-noble)
tidywikidatar_0.5.9.9000.tgz(r-4.4-emscripten)tidywikidatar_0.5.9.9000.tgz(r-4.3-emscripten)
tidywikidatar.pdf |tidywikidatar.html
tidywikidatar/json (API)
NEWS

# Install 'tidywikidatar' in R:
install.packages('tidywikidatar', repos = c('https://edjnet.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/edjnet/tidywikidatar/issues

Datasets:
  • tw_empty_image_metadata - A zero-rows tibble used internally when 'tw_get_image_metadata()' would not return any value.
  • tw_empty_item - A zero-rows tibble used internally when 'tw_get()' would not return any value.
  • tw_empty_qualifiers - A zero-rows tibble used internally when 'tw_get_qualifiers()' would not return any value.
  • tw_empty_search - A zero-rows tibble used internally when 'tw_search()' would not return any value.
  • tw_empty_wikipedia_category_members - A zero-rows tibble used internally when 'tw_empty_wikipedia_category_members()' would not return any value.
  • tw_empty_wikipedia_page - A zero-rows tibble used internally when 'tw_get_wikipedia_page_qid()' would not return any value.
  • tw_empty_wikipedia_page_links - A zero-rows tibble used internally when 'tw_get_wikipedia_page_links()' would not return any value.
  • tw_empty_wikipedia_page_sections - A zero-rows tibble used internally when 'tw_get_wikipedia_page_sections()' would not return any value.
  • tw_qid_airports - The Wikidata Q identifier of European airports found in Eurostat's 'avia_par_' dataset
  • tw_qid_meps - The Wikidata Q identifier of all members of the European Parliament since its establishment
  • tw_test_items - A list mostly used for testing with some Wikidata items in the format resulting from 'WikidataR::get_item()'

On CRAN:

wikidata

87 exports 24 stars 2.55 score 102 dependencies 46 scripts 446 downloads

Last updated 2 months agofrom:ad49f247b9. Checks:OK: 1 NOTE: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 13 2024
R-4.5-winNOTESep 13 2024
R-4.5-linuxNOTESep 13 2024
R-4.4-winNOTESep 13 2024
R-4.4-macNOTESep 13 2024
R-4.3-winNOTESep 13 2024
R-4.3-macNOTESep 13 2024

Exports::=.data%>%as_labelas_nameenquoenquosexprsymsymstw_check_cachetw_check_cache_foldertw_check_cache_indextw_check_cached_itemstw_check_pidtw_check_qidtw_check_searchtw_connect_to_cachetw_create_cache_foldertw_disable_cachetw_disconnect_from_cachetw_enable_cachetw_extract_qualifiertw_filtertw_filter_firsttw_filter_peopletw_gettw_get_all_with_ptw_get_cache_dbtw_get_cache_filetw_get_cache_foldertw_get_cache_table_nametw_get_cached_itemtw_get_cached_qualifierstw_get_cached_searchtw_get_cached_wikipedia_category_memberstw_get_cached_wikipedia_page_linkstw_get_cached_wikipedia_page_qidtw_get_cached_wikipedia_page_sectionstw_get_descriptiontw_get_fieldtw_get_imagetw_get_image_metadatatw_get_image_same_lengthtw_get_labeltw_get_languagetw_get_ptw_get_p_widetw_get_p1tw_get_propertytw_get_property_descriptiontw_get_property_labeltw_get_property_same_lengthtw_get_property_with_detailstw_get_qualifierstw_get_wikipediatw_get_wikipedia_base_api_urltw_get_wikipedia_category_memberstw_get_wikipedia_page_linkstw_get_wikipedia_page_qidtw_get_wikipedia_page_section_linkstw_get_wikipedia_page_sectionstw_get_wikipedia_section_links_api_urltw_get_wikipedia_sections_api_urltw_index_cache_itemtw_index_cache_searchtw_labeltw_querytw_reset_item_cachetw_reset_qualifiers_cachetw_reset_wikipedia_category_members_cachetw_reset_wikipedia_page_cachetw_reset_wikipedia_page_links_cachetw_reset_wikipedia_page_sections_cachetw_searchtw_search_itemtw_search_propertytw_set_cache_dbtw_set_cache_foldertw_set_languagetw_write_item_to_cachetw_write_qid_of_wikipedia_page_to_cachetw_write_qualifiers_to_cachetw_write_search_to_cachetw_write_wikipedia_category_members_to_cachetw_write_wikipedia_page_links_to_cachetw_write_wikipedia_page_sections_to_cache

Dependencies:askpassassertthatbackportsbase64encbitbit64blobbslibcachemcheckmateclicliprclustercolorspacecpp11crayoncurldata.tableDBIdigestdplyrevaluatefansifarverfastmapfontawesomeforeignFormulafsgenericsggplot2gluegridExtragtablehighrHmischmshtmlTablehtmltoolshtmlwidgetshttrhttr2isobandjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclemagrittrMASSMatrixmemoisemgcvmimemunsellnlmennetopensslpbapplypillarpkgconfigplogrpoolprettyunitsprogresspurrrR6rappdirsratelimitrRColorBrewerRcppreadrrexrlangrmarkdownrpartRSQLiterstudioapisassscalesstringistringrsystibbletidyrtidyselecttinytextzdbutf8vctrsviridisviridisLitevroomWikidataQueryServiceRWikidataRWikipediRwithrxfunyaml

How caching works in tidywikidatar

Rendered fromcaching.Rmdusingknitr::rmarkdownon Sep 13 2024.

Last update: 2023-01-31
Started: 2021-06-07

Using Wikipedia as a starting point

Rendered fromwikipedia_start.Rmdusingknitr::rmarkdownon Sep 13 2024.

Last update: 2022-01-25
Started: 2022-01-24

Readme and manuals

Help Manual

Help pageTopics
Check caching status in the current session, and override it upon requesttw_check_cache
Checks if cache folder exists, if not returns an informative messagetw_check_cache_folder
Check if cache table is indexedtw_check_cache_index
Check if given items are present in cachetw_check_cached_items
Ensures that input appears to be a valid Wikidata property id (i.e. it starts with P and is followed only by digits)tw_check_pid
Ensures that input appears to be a valid Wikidata idtw_check_qid
Checks if an input is a search; if not, it tries to return a searchtw_check_search
Return a connection to be used for cachingtw_connect_to_cache
Creates the base cache folder where 'tidywikidatar' caches data.tw_create_cache_folder
Disable caching for the current sessiontw_disable_cache
Ensure that connection to cache is disconnected consistentlytw_disconnect_from_cache
A zero-rows tibble used internally when 'tw_get_image_metadata()' would not return any value.tw_empty_image_metadata
A zero-rows tibble used internally when 'tw_get()' would not return any value.tw_empty_item
A zero-rows tibble used internally when 'tw_get_qualifiers()' would not return any value.tw_empty_qualifiers
A zero-rows tibble used internally when 'tw_search()' would not return any value.tw_empty_search
A zero-rows tibble used internally when 'tw_empty_wikipedia_category_members()' would not return any value.tw_empty_wikipedia_category_members
A zero-rows tibble used internally when 'tw_get_wikipedia_page_qid()' would not return any value.tw_empty_wikipedia_page
A zero-rows tibble used internally when 'tw_get_wikipedia_page_links()' would not return any value.tw_empty_wikipedia_page_links
A zero-rows tibble used internally when 'tw_get_wikipedia_page_sections()' would not return any value.tw_empty_wikipedia_page_sections
Enable caching for the current sessiontw_enable_cache
Extract qualifiers from an object of class Wikidata created with 'WikidataR'tw_extract_qualifier
Extract item data from an object of class Wikidata created with 'WikidataR'tw_extract_single
Filter search result and keep only items with matching property and Q identifiertw_filter
Filter search result and keep only and keep only the first matchtw_filter_first
Filter search result and keep only peopletw_filter_people
Return (most) information from a Wikidata item in a tidy formattw_get
Get all items that have a given property (irrespective of the value)tw_get_all_with_p
Get database connection settings from the environmenttw_get_cache_db
Gets location of cache filetw_get_cache_file
Gets name of table inside the databasetw_get_cache_table_name
Retrieve cached itemtw_get_cached_item
Retrieve cached qualifiertw_get_cached_qualifiers
Retrieve cached searchtw_get_cached_search
Gets members of Wikipedia categories from local cachetw_get_cached_wikipedia_category_members
Gets links of Wikipedia pages from local cachetw_get_cached_wikipedia_page_links
Gets id of Wikipedia pages from local cachetw_get_cached_wikipedia_page_qid
Gets sections of Wikipedia pages from local cachetw_get_cached_wikipedia_page_sections
Get Wikidata description in given languagetw_get_description
Gets a field such a label or description from a dataframe typically generated with 'tw_get()'tw_get_field
Get image from Wikimedia Commonstw_get_image
Get metadata for images from Wikimedia Commonstw_get_image_metadata
Get metadata for images from Wikimedia Commonstw_get_image_metadata_single
Get image from Wikimedia Commonstw_get_image_same_length
Get Wikidata label in given languagetw_get_label
Efficiently get a wide table with various properties of a given set of Wikidata identifierstw_get_p_wide
Get Wikidata property of an item as a character vector of the same length as inputtw_get_p1
Get Wikidata property of one or more items as a tidy data frametw_get_property
Get description of a Wikidata property in a given languagetw_get_property_description
Get label of a Wikidata property in a given languagetw_get_property_label
Get label of a Wikidata property in a given languagetw_get_property_label_single
Get Wikidata property of an item as a vector or list of the same length as inputtw_get_p tw_get_property_same_length
Gets all details of a propertytw_get_property_with_details
Gets all details of a propertytw_get_property_with_details_single
Get Wikidata qualifiers for a given property of a given itemtw_get_qualifiers
Get Wikidata qualifiers for a given property of a given itemtw_get_qualifiers_single
Return (most) information from a Wikidata item in a tidy format from a single Wikidata identifiertw_get_single
Get URL to a Wikipedia article corresponding to a Wikidata Q identifier in given languagetw_get_wikipedia
Facilitates the creation of MediaWiki API base URLstw_get_wikipedia_base_api_url
Get all Wikidata Q identifiers of all Wikipedia pages (or files, or subcategories) that are members of the given category,tw_get_wikipedia_category_members
Get all Wikidata Q identifiers of all Wikipedia pages that appear in a given pagetw_get_wikipedia_category_members_single
Get all Wikidata Q identifiers of all Wikipedia pages that appear in one or more pagestw_get_wikipedia_page_links
Get all Wikidata Q identifiers of all Wikipedia pages that appear in a given pagetw_get_wikipedia_page_links_single
Gets the Wikidata Q identifier of one or more Wikipedia pagestw_get_wikipedia_page_qid
Gets the Wikidata id of a Wikipedia pagetw_get_wikipedia_page_qid_single
Get links from a specific section of a Wikipedia pagetw_get_wikipedia_page_section_links
Get sections of a Wikipedia pagetw_get_wikipedia_page_sections
Get all Wikidata Q identifiers of all Wikipedia pages that appear in a given pagetw_get_wikipedia_page_sections_single
Facilitates the creation of MediaWiki API base URLs to retrieve sections of a pagetw_get_wikipedia_section_links_api_url
Facilitates the creation of MediaWiki API base URLs to retrieve sections of a pagetw_get_wikipedia_sections_api_url
Add index to caching table for search queries for increased speedtw_index_cache_item
Add index to caching table for search queries for increased speedtw_index_cache_search
Gets labels for all columns with names such as "id" and "property".tw_label
The Wikidata Q identifier of European airports found in Eurostat's 'avia_par_' datasettw_qid_airports
The Wikidata Q identifier of all members of the European Parliament since its establishmenttw_qid_meps
Perform simple Wikidata queriestw_query
Reset qualifiers cachetw_reset_item_cache
Reset qualifiers cachetw_reset_qualifiers_cache
Reset Wikipedia category members cachetw_reset_wikipedia_category_members_cache
Reset Wikipedia page cachetw_reset_wikipedia_page_cache
Reset Wikipedia page link cachetw_reset_wikipedia_page_links_cache
Reset Wikipedia page link cachetw_reset_wikipedia_page_sections_cache
Search for Wikidata items or properties and return Wikidata id, label, and description.tw_search
Search for Wikidata properties in Wikidata and return Wikidata id, label, and description.tw_search_item
Search for Wikidata properties in Wikidata and return Wikidata id, label, and description.tw_search_property
Search for Wikidata items or properties and return Wikidata id, label, and description.tw_search_single
Set database connection settings for the sessiontw_set_cache_db
Set folder for caching datatw_get_cache_folder tw_set_cache_folder
Set language to be used by all functionstw_get_language tw_set_language
A list mostly used for testing with some Wikidata items in the format resulting from 'WikidataR::get_item()'tw_test_items
Writes item to cachetw_write_item_to_cache
Write Wikidata identifier (qid) of Wikipedia page to cachetw_write_qid_of_wikipedia_page_to_cache
Write qualifiers to cachetw_write_qualifiers_to_cache
Writes search to cachetw_write_search_to_cache
Write Wikipedia page links to cachetw_write_wikipedia_category_members_to_cache
Write Wikipedia page links to cachetw_write_wikipedia_page_links_to_cache
Write Wikipedia page links to cachetw_write_wikipedia_page_sections_to_cache