- Notifications
You must be signed in to change notification settings - Fork0
Easy access to the Google Knowledge Graph API (v1).
License
Unknown, MIT licenses found
Licenses found
racorreia/gkgraphR
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Easy access to the Google Knowledge Graph API (v1) from R. More information about the Google Knowledge Graph API can be found here:https://developers.google.com/knowledge-graph
Please note that in order to access the API, users must register a Google account and create a project in the Google API console to obtain an API key. Using the Google Knowledge Graph API is free and a regular API account allows for up to 100.000 queries per day; additional API credits may be obtained through special request. More information on how to register an account and create a project can be found here:https://developers.google.com/knowledge-graph/prereqs
You can obtain the current development version from github:
# install.packages("devtools")devtools::install_github("racorreia/gkgraphR", build_vignettes = T)Querying the Google Knowledge Graph API throughgkgraphR can be achieved through the functionquerygkg(). A simple query requires a valid Google API key and one of two elements: i) a search query, or ii) a Google Knowledge Graph entity ID. For example, a simple list of entities recognized by the Google Knowledge Graph API in relation to the term "apple" can be achieved with the following code:
# Load gkgraphR librarylibrary(gkgraphR)# Query the API for entities related to the term "apple"query_apple <- querygkg(query = "apple", api.key = {YOUR_API_KEY}) # Replace YOUR_API_KEY with a valid Google API keySimilarly, querying the API for the entity "apple" representing the fruit or the entity "apple" representing the technology company can be achieved with the following queries:
# Query the API for the entity "apple" representing the fruitquery_apple_fruit <- querygkg(ids = "/m/014j1m", api.key = {YOUR_API_KEY}) # Replace YOUR_API_KEY with a valid Google API key# Query the API for the entity "apple" representing the fruitquery_apple_company <- querygkg(ids = "/m/0k8z", api.key = {YOUR_API_KEY}) # Replace YOUR_API_KEY with a valid Google API keyMore information on how to use packagegkgraphR can be found in the package vignette:
vignette("gkgraphR")About
Easy access to the Google Knowledge Graph API (v1).
Resources
License
Unknown, MIT licenses found
Licenses found
Uh oh!
There was an error while loading.Please reload this page.