Class: Google::Apis::KgsearchV1::KgsearchService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::KgsearchV1::KgsearchService
- Defined in:
- lib/google/apis/kgsearch_v1/service.rb
Overview
Knowledge Graph Search API
Searches the Google Knowledge Graph for entities.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://kgsearch.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#initialize ⇒ KgsearchService
constructor
A new instance of KgsearchService.
-
#search_entities(ids: nil, indent: nil, languages: nil, limit: nil, prefix: nil, query: nil, types: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KgsearchV1::SearchResponse
Searches Knowledge Graph for entities that match the constraints.
Constructor Details
#initialize ⇒ KgsearchService
Returns a new instance of KgsearchService.
47 48 49 50 51 52 |
# File 'lib/google/apis/kgsearch_v1/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-kgsearch_v1', client_version: Google::Apis::KgsearchV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
40 41 42 |
# File 'lib/google/apis/kgsearch_v1/service.rb', line 40 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45 46 47 |
# File 'lib/google/apis/kgsearch_v1/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#search_entities(ids: nil, indent: nil, languages: nil, limit: nil, prefix: nil, query: nil, types: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::KgsearchV1::SearchResponse
Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/google/apis/kgsearch_v1/service.rb', line 93 def search_entities(ids: nil, indent: nil, languages: nil, limit: nil, prefix: nil, query: nil, types: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/entities:search', ) command.response_representation = Google::Apis::KgsearchV1::SearchResponse::Representation command.response_class = Google::Apis::KgsearchV1::SearchResponse command.query['ids'] = ids unless ids.nil? command.query['indent'] = indent unless indent.nil? command.query['languages'] = languages unless languages.nil? command.query['limit'] = limit unless limit.nil? command.query['prefix'] = prefix unless prefix.nil? command.query['query'] = query unless query.nil? command.query['types'] = types unless types.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |