NAME
WWW::Google::KnowledgeGraphSearch - Interface to Google Knowledge Graph Search API.
VERSION
Version 0.07
DESCRIPTION
The Knowledge Graph Search API lets you find entities in the Google Knowledge Graph. The Google Knowledge Graph Search API requires the use of an API key which you can get from the Google APIs console. The API provides 100,000 search queries per day for free. If you need more, you may sign up for billing in the console.
The official Google API document can be found here.
Important:The version v1 of the Google Knowledge Graph Search API is in Labs and its features might change unexpectedly until it graduates.
SYNOPSIS
use strict; use warnings;
use WWW::Google::KnowledgeGraphSearch;
my $api_key = 'Your_API_Key';
my $engine = WWW::Google::KnowledgeGraphSearch->new(api_key => $api_key);
my $result = $engine->search('Taylor Swift');
print $result->[0]->id, "\n";
print $result->[0]->name, "\n";
print $result->[0]->description, "\n";
print $result->[0]->descriptionBody, "\n";
print $result->[0]->resultScore, "\n";
See WWW::Google::KnowledgeGraphSearch::Result for further details of the search result.
CONSTRUCTOR
The constructor expects application API Key api_key
mandatory, all others are optional.
+-----------+---------------------------------------------------------------+
| Key | Description |
+-----------+---------------------------------------------------------------+
| api_key | API Key for Google Knowledge Graph Search API. |
| | |
| languages | A comma separated list of language codes (defined in ISO 639).|
| | Default is 'en'. |
| | |
| limit | Limits the number of entities to be returned. Default is 1. |
+-----------+---------------------------------------------------------------+
LANGUAGE ISO 639
+-------------------+-------------------------------------------------------+
| Language | Value |
+-------------------+-------------------------------------------------------+
| Abkhazian | ab |
| Afar | aa |
| Afrikaan | af |
| Akan | ak |
| Albanian | sq |
| Amharic | am |
| Arabic | ar |
| Aragonese | an |
| Armenian | hy |
| Assamese | as |
| Avaric | av |
| Avestan | ae |
| Aymara | ay |
| Azerbaijani | az |
| Bambara | bm |
| Bashkir | br |
| Basque | eu |
| Belarusian | be |
| Bengali | bn |
| Bihari languages | bh |
| Bislama | bi |
| Bosnian | bs |
| Breton | br |
| Bulgarian | bg |
| Burmese | my |
| Catalan | ca |
| Chamorro | ch |
| Chechen | ce |
| Chichewa | ny |
| Chinese | zh |
| Chuvash | cv |
| Cornish | kw |
| Corsican | co |
| Cree | cr |
| Croatian | hr |
| Czech | cs |
| Danish | da |
| Divehi | dv |
| Dutch | nl |
| Dzongkha | dz |
| English | en |
| Esperanto | eo |
| Estonian | et |
| Ewe | ee |
| Faroese | fo |
| Fijian | fj |
| Finnish | fi |
| French | fr |
| Fulah | ff |
| Galician | gl |
| Georgian | ka |
| German | de |
| Greek | el |
| Guarani | gn |
| Gujarati | gu |
| Haitian | ht |
| Hausa | ha |
| Hebrew | he |
| Herero | hz |
| Hindi | hi |
| Hiri Motu | ho |
| Hungarian | hu |
| Interlingua | ia |
| Indonesian | id |
| Interlingue | ie |
| Irish | ga |
| Igbo | ig |
| Inupiaq | ik |
| Ido | io |
| Icelandic | is |
| Italian | it |
| Inuktitut | iu |
| Japanese | ja |
| Javanese | jv |
| Kalaallisut | kl |
| Kannada | kn |
| Kanuri | kr |
| Kashmiri | ks |
| Kazakh | kk |
| Central Khmer | km |
| Kikuyu | ki |
| Kinyarwanda | rw |
| Kirghiz | ky |
| Komi | kv |
| Kongo | kg |
| Korean | ko |
| Kurdish | ku |
| Kuanyama | kj |
| Latin | la |
| Luxembourgish | lb |
| Ganda | lg |
| Limburgan | li |
| Lingala | ln |
| Lao | lo |
| Lithuanian | lt |
| Luba-Katanga | lu |
| Latvian | lv |
| Manx | gv |
| Macedonian | mk |
| Malagasy | mg |
| Malay | ms |
| Malayalam | ml |
| Maltese | mt |
| Maori | mi |
| Marathi | mr |
| Marshallese | mh |
| Mongolian | mn |
| Nauru | na |
| Navajo | nv |
| North Ndebele | nd |
| Nepali | ne |
| Ndonga | ng |
| Norwegian Bokmal | nb |
| Norwegian Nynorsk | nn |
| Norwegian | no |
| Sichuan Yi | ii |
| South Ndebele | nr |
| Occitan | oc |
| Ojibwa | oj |
| Church Slavic | cu |
| Oromo | om |
| Oriya | or |
| Ossetian | os |
| Panjabi | pa |
| Pali | pi |
| Persian | fa |
| Polish | pl |
| Pashto | ps |
| Portuguese | pt |
| Quechua | qu |
| Romansh | rm |
| Rundi | rn |
| Romanian | ro |
| Russian | ru |
| Sanskrit | sa |
| Sardinian | sc |
| Sindhi | sd |
| Northern Sami | se |
| Samoan | sm |
| Sango | sg |
| Serbian | sr |
| Gaelic | gd |
| Shona | sn |
| Sinhala | si |
| Slovak | sk |
| Slovenian | sl |
| Somali | so |
| Southern Sotho | st |
| Spanish | es |
| Sundanese | su |
| Swahili | sw |
| Swati | ss |
| Swedish | sv |
| Tamil | ta |
| Telugu | te |
| Tajik | tg |
| Thai | th |
| Tigrinya | t1 |
| Tibetan | bo |
| Turkmen | tk |
| Tagalog | tl |
| Tswana | tn |
| Tonga | to |
| Turkish | tr |
| Tsonga | ts |
| Tatar | tt |
| Twi | tw |
| Tahitian | ty |
| Uighur | ug |
| Ukrainian | uk |
| Urdu | ur |
| Uzbek | uz |
| Venda | ve |
| Vietnamese | vi |
| Volapuk | vo |
| Walloon | wa |
| Welsh | cy |
| Wolof | wo |
| Western Frisian | fy |
| Xhosa | xh |
| Yiddish | yi |
| Yoruba | yo |
| Zhuang | za |
| Zulu | zu |
+-------------------+-------------------------------------------------------+
KNOWLEDGE GRAPH ENTITY TYPES
The API search the following knowledge graph entity types:
+---------------------------------------------------------------------------+
| Book |
| BookSeries |
| EducationalOrganization |
| Event |
| GovernmentOrganization |
| LocalBusiness |
| Movie |
| MovieSeries |
| MusicAlbum |
| MusicGroup |
| MusicRecording |
| Organization |
| Periodical |
| Person |
| Place |
| SportsTeam |
| TVEpisode |
| TVSeries |
| VideoGame |
| VideoGameSeries |
| WebSite |
+---------------------------------------------------------------------------+
METHODS
search($query_string)
Get search result WWW::Google::KnowledgeGraphSearch::Result.
use strict; use warnings;
use WWW::Google::KnowledgeGraphSearch;
my $api_key = 'Your_API_Key';
my $engine = WWW::Google::KnowledeGraphSearch->new(api_key => $api_key);
my $result = $engine->search('Taylor Swift');
print $result->[0]->id, "\n";
print $result->[0]->name, "\n";
print $result->[0]->description, "\n";
print $result->[0]->descriptionBody, "\n";
print $result->[0]->resultScore, "\n";
AUTHOR
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
REPOSITORY
https://github.com/manwar/WWW-Google-KnowledgeGraphSearch
BUGS
Please report any bugs or feature requests to bug-www-google-knowledgegraphsearch at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Google-KnowledgeGraphSearch. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc WWW::Google::KnowledgeGraphSearch
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Google-KnowledgeGraphSearch
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Google-KnowledgeGraphSearch
Search CPAN
http://search.cpan.org/dist/WWW-Google-KnowledgeGraphSearch/
LICENSE AND COPYRIGHT
Copyright (C) 2017 Mohammad S Anwar.
This program is free software; you can redistribute it and / or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License.By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you,you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement,then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.