Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Easy access to the Google Knowledge Graph API (v1).

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

racorreia/gkgraphR

Repository files navigation

R build statusCRAN StatusBuild StatusAppVeyor build statusDOI

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

Before starting

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

Installation

You can obtain the current development version from github:

# install.packages("devtools")devtools::install_github("racorreia/gkgraphR", build_vignettes = T)

Querying the API

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 key

Similarly, 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 key

More 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

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp