service.proto 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.enterpriseknowledgegraph.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/enterpriseknowledgegraph/v1/job_state.proto";
  21. import "google/cloud/enterpriseknowledgegraph/v1/operation_metadata.proto";
  22. import "google/protobuf/empty.proto";
  23. import "google/protobuf/struct.proto";
  24. import "google/protobuf/timestamp.proto";
  25. import "google/protobuf/wrappers.proto";
  26. import "google/rpc/status.proto";
  27. option csharp_namespace = "Google.Cloud.EnterpriseKnowledgeGraph.V1";
  28. option go_package = "google.golang.org/genproto/googleapis/cloud/enterpriseknowledgegraph/v1;enterpriseknowledgegraph";
  29. option java_multiple_files = true;
  30. option java_outer_classname = "ServiceProto";
  31. option java_package = "com.google.cloud.enterpriseknowledgegraph.v1";
  32. option php_namespace = "Google\\Cloud\\EnterpriseKnowledgeGraph\\V1";
  33. option ruby_package = "Google::Cloud::EnterpriseKnowledgeGraph::V1";
  34. option (google.api.resource_definition) = {
  35. type: "bigquery.googleapis.com/Dataset"
  36. pattern: "projects/{project}/datasets/{dataset}"
  37. };
  38. option (google.api.resource_definition) = {
  39. type: "bigquery.googleapis.com/Table"
  40. pattern: "projects/{project}/datasets/{dataset}/tables/{table}"
  41. };
  42. option (google.api.resource_definition) = {
  43. type: "enterpriseknowledgegraph.googleapis.com/CloudKnowledgeGraphEntity"
  44. pattern: "projects/{project}/locations/{location}/cloudKnowledgeGraphEntities/{cloud_knowledge_graph_entity}"
  45. };
  46. option (google.api.resource_definition) = {
  47. type: "enterpriseknowledgegraph.googleapis.com/PublicKnowledgeGraphEntity"
  48. pattern: "projects/{project}/locations/{location}/publicKnowledgeGraphEntities/{public_knowledge_graph_entity}"
  49. };
  50. // APIs for enterprise knowledge graph product.
  51. service EnterpriseKnowledgeGraphService {
  52. option (google.api.default_host) = "enterpriseknowledgegraph.googleapis.com";
  53. option (google.api.oauth_scopes) =
  54. "https://www.googleapis.com/auth/cloud-platform";
  55. // Creates a EntityReconciliationJob. A EntityReconciliationJob once created
  56. // will right away be attempted to start.
  57. rpc CreateEntityReconciliationJob(CreateEntityReconciliationJobRequest)
  58. returns (EntityReconciliationJob) {
  59. option (google.api.http) = {
  60. post: "/v1/{parent=projects/*/locations/*}/entityReconciliationJobs"
  61. body: "entity_reconciliation_job"
  62. };
  63. option (google.api.method_signature) = "parent,entity_reconciliation_job";
  64. }
  65. // Gets a EntityReconciliationJob.
  66. rpc GetEntityReconciliationJob(GetEntityReconciliationJobRequest)
  67. returns (EntityReconciliationJob) {
  68. option (google.api.http) = {
  69. get: "/v1/{name=projects/*/locations/*/entityReconciliationJobs/*}"
  70. };
  71. option (google.api.method_signature) = "name";
  72. }
  73. // Lists Entity Reconciliation Jobs.
  74. rpc ListEntityReconciliationJobs(ListEntityReconciliationJobsRequest)
  75. returns (ListEntityReconciliationJobsResponse) {
  76. option (google.api.http) = {
  77. get: "/v1/{parent=projects/*/locations/*}/entityReconciliationJobs"
  78. };
  79. option (google.api.method_signature) = "parent";
  80. }
  81. // Cancels a EntityReconciliationJob. Success of cancellation is not
  82. // guaranteed.
  83. rpc CancelEntityReconciliationJob(CancelEntityReconciliationJobRequest)
  84. returns (google.protobuf.Empty) {
  85. option (google.api.http) = {
  86. post: "/v1/{name=projects/*/locations/*/entityReconciliationJobs/*}:cancel"
  87. body: "*"
  88. };
  89. option (google.api.method_signature) = "name";
  90. }
  91. // Deletes a EntityReconciliationJob.
  92. // It only deletes the job when the job state is in FAILED, SUCCEEDED, and
  93. // CANCELLED.
  94. rpc DeleteEntityReconciliationJob(DeleteEntityReconciliationJobRequest)
  95. returns (google.protobuf.Empty) {
  96. option (google.api.http) = {
  97. delete: "/v1/{name=projects/*/locations/*/entityReconciliationJobs/*}"
  98. };
  99. option (google.api.method_signature) = "name";
  100. }
  101. // Finds the Cloud KG entities with CKG ID(s).
  102. rpc Lookup(LookupRequest) returns (LookupResponse) {
  103. option (google.api.http) = {
  104. get: "/v1/{parent=projects/*/locations/*}/cloudKnowledgeGraphEntities:Lookup"
  105. };
  106. option (google.api.method_signature) = "parent,ids";
  107. }
  108. // Searches the Cloud KG entities with entity name.
  109. rpc Search(SearchRequest) returns (SearchResponse) {
  110. option (google.api.http) = {
  111. get: "/v1/{parent=projects/*/locations/*}/cloudKnowledgeGraphEntities:Search"
  112. };
  113. option (google.api.method_signature) = "parent,query";
  114. }
  115. // Finds the public KG entities with public KG ID(s).
  116. rpc LookupPublicKg(LookupPublicKgRequest) returns (LookupPublicKgResponse) {
  117. option (google.api.http) = {
  118. get: "/v1/{parent=projects/*/locations/*}/publicKnowledgeGraphEntities:Lookup"
  119. };
  120. option (google.api.method_signature) = "parent,ids";
  121. }
  122. // Searches the public KG entities with entity name.
  123. rpc SearchPublicKg(SearchPublicKgRequest) returns (SearchPublicKgResponse) {
  124. option (google.api.http) = {
  125. get: "/v1/{parent=projects/*/locations/*}/publicKnowledgeGraphEntities:Search"
  126. };
  127. option (google.api.method_signature) = "parent,query";
  128. }
  129. }
  130. // The desired input location and metadata.
  131. message InputConfig {
  132. // The type of entities we will support. Currently, we only support people,
  133. // establishment, property, and product types. If the type is
  134. // unspecified, it will be generic type.
  135. enum EntityType {
  136. // The default value.
  137. ENTITY_TYPE_UNSPECIFIED = 0;
  138. // People entity.
  139. PEOPLE = 1 [deprecated = true];
  140. // Establishment entity.
  141. ESTABLISHMENT = 2 [deprecated = true];
  142. // Property entity. e.g. real estate property.
  143. PROPERTY = 3 [deprecated = true];
  144. // Product entity.
  145. PRODUCT = 4;
  146. // Organization entity.
  147. ORGANIZATION = 5;
  148. // Local Business entity.
  149. LOCAL_BUSINESS = 6;
  150. // Person entity.
  151. PERSON = 7;
  152. }
  153. // Set of input BigQuery tables.
  154. repeated BigQueryInputConfig bigquery_input_configs = 1;
  155. // Entity type
  156. EntityType entity_type = 2;
  157. // Optional. Provide the bigquery table containing the previous results if
  158. // cluster ID stability is desired. Format is
  159. // `projects/*/datasets/*/tables/*`.
  160. string previous_result_bigquery_table = 3 [
  161. (google.api.field_behavior) = OPTIONAL,
  162. (google.api.resource_reference) = { type: "bigquery.googleapis.com/Table" }
  163. ];
  164. }
  165. // The input config for BigQuery tables.
  166. message BigQueryInputConfig {
  167. // Required. Format is `projects/*/datasets/*/tables/*`.
  168. string bigquery_table = 1 [
  169. (google.api.field_behavior) = REQUIRED,
  170. (google.api.resource_reference) = { type: "bigquery.googleapis.com/Table" }
  171. ];
  172. // Required. Schema mapping file
  173. string gcs_uri = 2 [(google.api.field_behavior) = REQUIRED];
  174. }
  175. // The desired output location and metadata.
  176. message OutputConfig {
  177. // Format is “projects/*/datasets/*”.
  178. string bigquery_dataset = 1 [(google.api.resource_reference) = {
  179. type: "bigquery.googleapis.com/Dataset"
  180. }];
  181. }
  182. // Recon configs
  183. message ReconConfig {
  184. // Options for experimental changes on entity clustering behavior.
  185. message Options {
  186. // If true, separate clusters by their geographic region (from geocoding).
  187. // Uses the following entity features:
  188. //
  189. // - schema.org/addressLocality
  190. // - schema.org/addressRegion
  191. // - schema.org/addressCountry
  192. // Warning: processing will no longer be regionalized!
  193. bool enable_geocoding_separation = 100;
  194. }
  195. // Model Configs
  196. message ModelConfig {
  197. // Model name. Refer to external documentation for valid names.
  198. // If unspecified, it defaults to the one mentioned in the documentation.
  199. string model_name = 1;
  200. // Model version tag. Refer to external documentation for valid tags.
  201. // If unspecified, it defaults to the one mentioned in the documentation.
  202. string version_tag = 2;
  203. }
  204. // Choice of clustering algorithm. Default is ConnectedComponentsConfig.
  205. oneof clustering_config {
  206. // Configs for connected components.
  207. ConnectedComponentsConfig connected_components_config = 1;
  208. // Configs for affinity clustering.
  209. AffinityClusteringConfig affinity_clustering_config = 2;
  210. }
  211. // Extra options that affect entity clustering behavior.
  212. Options options = 3;
  213. // Model Configs
  214. ModelConfig model_config = 4;
  215. }
  216. // Options for connected components.
  217. message ConnectedComponentsConfig {
  218. // Threshold used for connected components. Default value is 0.85.
  219. float weight_threshold = 1;
  220. }
  221. // Options for affinity clustering.
  222. message AffinityClusteringConfig {
  223. // Number of iterations to perform. Default value is 1.
  224. int64 compression_round_count = 1;
  225. }
  226. // Details of operations that perform deletes of any entities.
  227. message DeleteOperationMetadata {
  228. // The common part of the operation metadata.
  229. CommonOperationMetadata common_metadata = 1;
  230. }
  231. // Request message for CreateEntityReconciliationJob.
  232. message CreateEntityReconciliationJobRequest {
  233. // Required. The resource name of the Location to create the
  234. // EntityReconciliationJob in. Format:
  235. // `projects/{project}/locations/{location}`
  236. string parent = 1 [
  237. (google.api.field_behavior) = REQUIRED,
  238. (google.api.resource_reference) = {
  239. child_type: "enterpriseknowledgegraph.googleapis.com/EntityReconciliationJob"
  240. }
  241. ];
  242. // Required. The EntityReconciliationJob to create.
  243. EntityReconciliationJob entity_reconciliation_job = 2
  244. [(google.api.field_behavior) = REQUIRED];
  245. }
  246. // Request message for GetEntityReconciliationJob.
  247. message GetEntityReconciliationJobRequest {
  248. // Required. The name of the EntityReconciliationJob resource.
  249. // Format:
  250. // `projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`
  251. string name = 1 [
  252. (google.api.field_behavior) = REQUIRED,
  253. (google.api.resource_reference) = {
  254. type: "enterpriseknowledgegraph.googleapis.com/EntityReconciliationJob"
  255. }
  256. ];
  257. }
  258. // Request message for
  259. // [EnterpriseKnowledgeGraphService.ListEntityReconciliationJobs][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.ListEntityReconciliationJobs].
  260. message ListEntityReconciliationJobsRequest {
  261. // Required. The name of the EntityReconciliationJob's parent resource.
  262. // Format: `projects/{project}/locations/{location}`
  263. string parent = 1 [
  264. (google.api.field_behavior) = REQUIRED,
  265. (google.api.resource_reference) = {
  266. child_type: "enterpriseknowledgegraph.googleapis.com/EntityReconciliationJob"
  267. }
  268. ];
  269. // An expression for filtering the results of the request. For field names
  270. // both snake_case and camelCase are supported.
  271. string filter = 2;
  272. // The standard list page size.
  273. int32 page_size = 3;
  274. // The standard list page token.
  275. string page_token = 4;
  276. }
  277. // Response message for
  278. // [EnterpriseKnowledgeGraphService.ListEntityReconciliationJobs][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.ListEntityReconciliationJobs].
  279. message ListEntityReconciliationJobsResponse {
  280. // A list of EntityReconciliationJobs that matches the specified filter in the
  281. // request.
  282. repeated EntityReconciliationJob entity_reconciliation_jobs = 1;
  283. // The standard List next-page token.
  284. string next_page_token = 2;
  285. }
  286. // Request message for CancelEntityReconciliationJob.
  287. message CancelEntityReconciliationJobRequest {
  288. // Required. The name of the EntityReconciliationJob resource.
  289. // Format:
  290. // `projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`
  291. string name = 1 [
  292. (google.api.field_behavior) = REQUIRED,
  293. (google.api.resource_reference) = {
  294. type: "enterpriseknowledgegraph.googleapis.com/EntityReconciliationJob"
  295. }
  296. ];
  297. }
  298. // Request message for DeleteEntityReconciliationJob.
  299. message DeleteEntityReconciliationJobRequest {
  300. // Required. The name of the EntityReconciliationJob resource.
  301. // Format:
  302. // `projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`
  303. string name = 1 [
  304. (google.api.field_behavior) = REQUIRED,
  305. (google.api.resource_reference) = {
  306. type: "enterpriseknowledgegraph.googleapis.com/EntityReconciliationJob"
  307. }
  308. ];
  309. }
  310. // Entity reconciliation job message.
  311. message EntityReconciliationJob {
  312. option (google.api.resource) = {
  313. type: "enterpriseknowledgegraph.googleapis.com/EntityReconciliationJob"
  314. pattern: "projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}"
  315. };
  316. // Output only. Resource name of the EntityReconciliationJob.
  317. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  318. // Required. Information about the input BigQuery tables.
  319. InputConfig input_config = 2 [(google.api.field_behavior) = REQUIRED];
  320. // Required. The desired output location.
  321. OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED];
  322. // Output only. The detailed state of the job.
  323. JobState state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  324. // Output only. Only populated when the job's state is JOB_STATE_FAILED or
  325. // JOB_STATE_CANCELLED.
  326. google.rpc.Status error = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  327. // Output only. Time when the EntityReconciliationJob was created.
  328. google.protobuf.Timestamp create_time = 6
  329. [(google.api.field_behavior) = OUTPUT_ONLY];
  330. // Output only. Time when the EntityReconciliationJob entered any of the
  331. // following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`,
  332. // `JOB_STATE_CANCELLED`.
  333. google.protobuf.Timestamp end_time = 7
  334. [(google.api.field_behavior) = OUTPUT_ONLY];
  335. // Output only. Time when the EntityReconciliationJob was most recently
  336. // updated.
  337. google.protobuf.Timestamp update_time = 8
  338. [(google.api.field_behavior) = OUTPUT_ONLY];
  339. // Optional. Recon configs to adjust the clustering behavior.
  340. ReconConfig recon_config = 9 [(google.api.field_behavior) = OPTIONAL];
  341. }
  342. // Request message for
  343. // [EnterpriseKnowledgeGraphService.Lookup][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Lookup].
  344. message LookupRequest {
  345. // Required. The name of the Entity's parent resource.
  346. // Format:
  347. // `projects/{project}/locations/{location}`
  348. string parent = 1 [
  349. (google.api.field_behavior) = REQUIRED,
  350. (google.api.resource_reference) = {
  351. child_type: "enterpriseknowledgegraph.googleapis.com/CloudKnowledgeGraphEntity"
  352. }
  353. ];
  354. // Required. The list of entity ids to be used for lookup.
  355. repeated string ids = 2 [(google.api.field_behavior) = REQUIRED];
  356. // The list of language codes (defined in ISO 693) to run the query with,
  357. // e.g. 'en'.
  358. repeated string languages = 3;
  359. }
  360. // Response message for
  361. // [EnterpriseKnowledgeGraphService.Lookup][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Lookup].
  362. message LookupResponse {
  363. // The local context applicable for the response. See more details at
  364. // http://www.w3.org/TR/json-ld/#context-definitions.
  365. google.protobuf.Value context = 1;
  366. // The schema type of top-level JSON-LD object, e.g. ItemList.
  367. google.protobuf.Value type = 2;
  368. // The item list of search results.
  369. google.protobuf.ListValue item_list_element = 3;
  370. }
  371. // Request message for
  372. // [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
  373. message SearchRequest {
  374. // Required. The name of the Entity's parent resource.
  375. // Format:
  376. // `projects/{project}/locations/{location}`
  377. string parent = 1 [
  378. (google.api.field_behavior) = REQUIRED,
  379. (google.api.resource_reference) = {
  380. child_type: "enterpriseknowledgegraph.googleapis.com/CloudKnowledgeGraphEntity"
  381. }
  382. ];
  383. // Required. The literal query string for search.
  384. string query = 2 [(google.api.field_behavior) = REQUIRED];
  385. // The list of language codes (defined in ISO 693) to run the query with,
  386. // e.g. 'en'.
  387. repeated string languages = 3;
  388. // Restricts returned entities with these types, e.g. Person
  389. // (as defined in http://schema.org/Person). If multiple types are specified,
  390. // returned entities will contain one or more of these types.
  391. repeated string types = 4;
  392. // Limits the number of entities to be returned.
  393. google.protobuf.Int32Value limit = 6;
  394. }
  395. // Response message for
  396. // [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
  397. message SearchResponse {
  398. // The local context applicable for the response. See more details at
  399. // http://www.w3.org/TR/json-ld/#context-definitions.
  400. google.protobuf.Value context = 1;
  401. // The schema type of top-level JSON-LD object, e.g. ItemList.
  402. google.protobuf.Value type = 2;
  403. // The item list of search results.
  404. google.protobuf.ListValue item_list_element = 3;
  405. }
  406. // Request message for
  407. // [EnterpriseKnowledgeGraphService.LookupPublicKg][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.LookupPublicKg].
  408. message LookupPublicKgRequest {
  409. // Required. The name of the Entity's parent resource.
  410. // Format:
  411. // `projects/{project}/locations/{location}`
  412. string parent = 1 [
  413. (google.api.field_behavior) = REQUIRED,
  414. (google.api.resource_reference) = {
  415. child_type: "enterpriseknowledgegraph.googleapis.com/PublicKnowledgeGraphEntity"
  416. }
  417. ];
  418. // Required. The list of entity ids to be used for lookup.
  419. repeated string ids = 2 [(google.api.field_behavior) = REQUIRED];
  420. // The list of language codes (defined in ISO 693) to run the query with,
  421. // e.g. 'en'.
  422. repeated string languages = 3;
  423. }
  424. // Response message for
  425. // [EnterpriseKnowledgeGraphService.LookupPublicKg][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.LookupPublicKg].
  426. message LookupPublicKgResponse {
  427. // The local context applicable for the response. See more details at
  428. // http://www.w3.org/TR/json-ld/#context-definitions.
  429. google.protobuf.Value context = 1;
  430. // The schema type of top-level JSON-LD object, e.g. ItemList.
  431. google.protobuf.Value type = 2;
  432. // The item list of search results.
  433. google.protobuf.ListValue item_list_element = 3;
  434. }
  435. // Request message for
  436. // [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
  437. message SearchPublicKgRequest {
  438. // Required. The name of the Entity's parent resource.
  439. // Format:
  440. // `projects/{project}/locations/{location}`
  441. string parent = 1 [
  442. (google.api.field_behavior) = REQUIRED,
  443. (google.api.resource_reference) = {
  444. child_type: "enterpriseknowledgegraph.googleapis.com/PublicKnowledgeGraphEntity"
  445. }
  446. ];
  447. // Required. The literal query string for search.
  448. string query = 2 [(google.api.field_behavior) = REQUIRED];
  449. // The list of language codes (defined in ISO 693) to run the query with,
  450. // e.g. 'en'.
  451. repeated string languages = 3;
  452. // Restricts returned entities with these types, e.g. Person
  453. // (as defined in http://schema.org/Person). If multiple types are specified,
  454. // returned entities will contain one or more of these types.
  455. repeated string types = 4;
  456. // Limits the number of entities to be returned.
  457. google.protobuf.Int32Value limit = 6;
  458. }
  459. // Response message for
  460. // [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
  461. message SearchPublicKgResponse {
  462. // The local context applicable for the response. See more details at
  463. // http://www.w3.org/TR/json-ld/#context-definitions.
  464. google.protobuf.Value context = 1;
  465. // The schema type of top-level JSON-LD object, e.g. ItemList.
  466. google.protobuf.Value type = 2;
  467. // The item list of search results.
  468. google.protobuf.ListValue item_list_element = 3;
  469. }