Class: Google::Apis::KgsearchV1::KgsearchService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::KgsearchV1::KgsearchService
- Defined in:
- generated/google/apis/kgsearch_v1/service.rb
Overview
Knowledge Graph Search API
Searches the Google Knowledge Graph for entities.
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.
45 46 47 48 |
# File 'generated/google/apis/kgsearch_v1/service.rb', line 45 def initialize super('https://kgsearch.googleapis.com/', '') @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.
38 39 40 |
# File 'generated/google/apis/kgsearch_v1/service.rb', line 38 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.
43 44 45 |
# File 'generated/google/apis/kgsearch_v1/service.rb', line 43 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
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'generated/google/apis/kgsearch_v1/service.rb', line 89 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 |